VTK  9.0.3
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 "vtkCurveRepresentation.h"
32 #include "vtkInteractionWidgetsModule.h" // For export macro
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:
52  void PrintSelf(ostream& os, vtkIndent indent) override;
53 
61  void GetPolyData(vtkPolyData* pd) override;
62 
66  void SetNumberOfHandles(int npts) override;
67 
69 
74  vtkGetMacro(Resolution, int);
76 
78 
87  vtkGetObjectMacro(ParametricSpline, vtkParametricSpline);
89 
94 
100  double GetSummedLength() override;
101 
109 
115  void BuildRepresentation() override;
116 
117 protected:
120 
121  // The spline
124 
125  // The number of line segments used to represent the spline.
127 
128  // Specialized method to insert a handle on the poly line.
129  int InsertHandleOnLine(double* pos) override;
130 
131 private:
133  void operator=(const vtkSplineRepresentation&) = delete;
134 };
135 
136 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:46
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:67
vtkWidgetRepresentation base class for a widget that represents an curve that connects control points...
dynamic, self-adjusting array of double
a simple class to control print indentation
Definition: vtkIndent.h:34
tessellate parametric functions
parametric function for 1D interpolating splines
create an array of quadrilaterals located in a plane
represent and manipulate 3D points
Definition: vtkPoints.h:34
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:54
represent surface properties of a geometric object
Definition: vtkProperty.h:62
create a polygonal sphere centered at the origin
representation for a spline.
vtkParametricSpline * ParametricSpline
void BuildRepresentation() override
These are methods that satisfy vtkWidgetRepresentation's API.
vtkDoubleArray * GetHandlePositions() override
Get the position of the spline handles.
~vtkSplineRepresentation() override
double GetSummedLength() override
Get the approximate vs.
int InsertHandleOnLine(double *pos) override
Returns the position of insertion or -1 on fail.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkParametricFunctionSource * ParametricFunctionSource
static vtkSplineRepresentation * New()
void SetResolution(int resolution)
Set/Get the number of line segments representing the spline for this widget.
void SetNumberOfHandles(int npts) override
Set the number of handles for this widget.
void InitializeHandles(vtkPoints *points) override
Convenience method to allocate and set the handles from a vtkPoints instance.
void GetPolyData(vtkPolyData *pd) override
Grab the polydata (including points) that defines the spline.
virtual void SetParametricSpline(vtkParametricSpline *)
Set the parametric spline object.
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:55
@ resolution
Definition: vtkX3D.h:472
@ points
Definition: vtkX3D.h:452