VTK
vtkSplineRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSplineRepresentation.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
28 #ifndef vtkSplineRepresentation_h
29 #define vtkSplineRepresentation_h
30 
31 #include "vtkInteractionWidgetsModule.h" // For export macro
32 #include "vtkCurveRepresentation.h"
33 
34 class vtkActor;
35 class vtkCellPicker;
36 class vtkDoubleArray;
39 class vtkPlaneSource;
40 class vtkPoints;
41 class vtkPolyData;
42 class vtkProp;
43 class vtkProperty;
44 class vtkSphereSource;
45 class vtkTransform;
46 
47 class VTKINTERACTIONWIDGETS_EXPORT vtkSplineRepresentation : public vtkCurveRepresentation
48 {
49 public:
50  static vtkSplineRepresentation* New();
52  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
53 
61  void GetPolyData(vtkPolyData *pd) VTK_OVERRIDE;
62 
66  void SetNumberOfHandles(int npts) VTK_OVERRIDE;
67 
69 
73  void SetResolution(int resolution);
74  vtkGetMacro(Resolution,int);
76 
78 
86  virtual void SetParametricSpline(vtkParametricSpline*);
87  vtkGetObjectMacro(ParametricSpline,vtkParametricSpline);
89 
93  vtkDoubleArray* GetHandlePositions() VTK_OVERRIDE;
94 
100  double GetSummedLength() VTK_OVERRIDE;
101 
108  void InitializeHandles(vtkPoints* points) VTK_OVERRIDE;
109 
115  void BuildRepresentation() VTK_OVERRIDE;
116 
117 protected:
119  ~vtkSplineRepresentation() VTK_OVERRIDE;
120 
121  // The spline
122  vtkParametricSpline *ParametricSpline;
123  vtkParametricFunctionSource *ParametricFunctionSource;
124 
125  // The number of line segments used to represent the spline.
126  int Resolution;
127 
128  // Specialized method to insert a handle on the poly line.
129  void InsertHandleOnLine(double* pos) VTK_OVERRIDE;
130 
131 private:
132  vtkSplineRepresentation(const vtkSplineRepresentation&) VTK_DELETE_FUNCTION;
133  void operator=(const vtkSplineRepresentation&) VTK_DELETE_FUNCTION;
134 
135 };
136 
137 #endif
138 
139 
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:44
vtkWidgetRepresentation base class for a widget that represents an curve that connects control points...
representation for a spline.
virtual void GetPolyData(vtkPolyData *pd)=0
Grab the polydata (including points) that defines the interpolating curve.
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:45
represent surface properties of a geometric object
Definition: vtkProperty.h:58
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:54
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
virtual void SetNumberOfHandles(int npts)=0
Set/Get the number of handles for this widget.
dynamic, self-adjusting array of double
create a polygonal sphere centered at the origin
parametric function for 1D interpolating splines
a simple class to control print indentation
Definition: vtkIndent.h:33
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual vtkDoubleArray * GetHandlePositions()=0
Set/Get the position of the handles.
create an array of quadrilaterals located in a plane
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:63
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
represent and manipulate 3D points
Definition: vtkPoints.h:33
tessellate parametric functions