VTK
vtkSplineFilter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkSplineFilter.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=========================================================================*/
40#ifndef vtkSplineFilter_h
41#define vtkSplineFilter_h
42
43#include "vtkFiltersGeneralModule.h" // For export macro
45
46#define VTK_SUBDIVIDE_SPECIFIED 0
47#define VTK_SUBDIVIDE_LENGTH 1
48
49#define VTK_TCOORDS_OFF 0
50#define VTK_TCOORDS_FROM_NORMALIZED_LENGTH 1
51#define VTK_TCOORDS_FROM_LENGTH 2
52#define VTK_TCOORDS_FROM_SCALARS 3
53
54class vtkCellArray;
55class vtkCellData;
56class vtkFloatArray;
57class vtkPointData;
58class vtkPoints;
59class vtkSpline;
60
61class VTKFILTERSGENERAL_EXPORT vtkSplineFilter : public vtkPolyDataAlgorithm
62{
63public:
65 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
66
72
74
78 vtkSetClampMacro(MaximumNumberOfSubdivisions,int,1,VTK_INT_MAX);
79 vtkGetMacro(MaximumNumberOfSubdivisions,int);
81
83
86 vtkSetClampMacro(Subdivide,int,VTK_SUBDIVIDE_SPECIFIED,VTK_SUBDIVIDE_LENGTH);
87 vtkGetMacro(Subdivide,int);
89 {this->SetSubdivide(VTK_SUBDIVIDE_SPECIFIED);}
91 {this->SetSubdivide(VTK_SUBDIVIDE_LENGTH);}
92 const char *GetSubdivideAsString();
94
96
101 vtkSetClampMacro(NumberOfSubdivisions,int,1,VTK_INT_MAX);
102 vtkGetMacro(NumberOfSubdivisions,int);
104
106
111 vtkSetClampMacro(Length,double,0.0000001,VTK_DOUBLE_MAX);
112 vtkGetMacro(Length,double);
114
116
119 virtual void SetSpline(vtkSpline*);
120 vtkGetObjectMacro(Spline,vtkSpline);
122
124
131 vtkSetClampMacro(GenerateTCoords,int,VTK_TCOORDS_OFF,
133 vtkGetMacro(GenerateTCoords,int);
135 {this->SetGenerateTCoords(VTK_TCOORDS_OFF);}
137 {this->SetGenerateTCoords(VTK_TCOORDS_FROM_NORMALIZED_LENGTH);}
139 {this->SetGenerateTCoords(VTK_TCOORDS_FROM_LENGTH);}
141 {this->SetGenerateTCoords(VTK_TCOORDS_FROM_SCALARS);}
144
146
152 vtkSetClampMacro(TextureLength,double,0.000001,VTK_INT_MAX);
153 vtkGetMacro(TextureLength,double);
155
156protected:
158 ~vtkSplineFilter() VTK_OVERRIDE;
159
160 // Usual data generation method
161 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE;
162
163 int MaximumNumberOfSubdivisions;
164 int Subdivide;
165 int NumberOfSubdivisions;
166 double Length;
167 vtkSpline *Spline;
168 vtkSpline *XSpline;
169 vtkSpline *YSpline;
170 vtkSpline *ZSpline;
171 int GenerateTCoords;
172 double TextureLength; //this length is mapped to [0,1) texture space
173
174 //helper methods
175 int GeneratePoints(vtkIdType offset, vtkIdType npts, vtkIdType *pts,
176 vtkPoints *inPts, vtkPoints *newPts, vtkPointData *pd,
177 vtkPointData *outPD, int genTCoords,
178 vtkFloatArray *newTCoords);
179
180 void GenerateLine(vtkIdType offset, vtkIdType numGenPts, vtkIdType inCellId,
181 vtkCellData *cd, vtkCellData *outCD, vtkCellArray *newLines);
182
183 //helper members
184 vtkFloatArray *TCoordMap;
185
186private:
187 vtkSplineFilter(const vtkSplineFilter&) VTK_DELETE_FUNCTION;
188 void operator=(const vtkSplineFilter&) VTK_DELETE_FUNCTION;
189};
190
191#endif
object to represent cell connectivity
Definition: vtkCellArray.h:51
represent and manipulate cell attribute data
Definition: vtkCellData.h:39
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:42
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate point attribute data
Definition: vtkPointData.h:38
represent and manipulate 3D points
Definition: vtkPoints.h:40
Superclass for algorithms that produce only polydata as output.
generate uniformly subdivided polylines from a set of input polyline using a vtkSpline
void SetGenerateTCoordsToNormalizedLength()
void SetGenerateTCoordsToOff()
void SetGenerateTCoordsToUseScalars()
static vtkSplineFilter * New()
Construct the class with no limit on the number of subdivisions and using an instance of vtkCardinalS...
void SetSubdivideToLength()
~vtkSplineFilter() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void SetSpline(vtkSpline *)
Specify an instance of vtkSpline to use to perform the interpolation.
const char * GetSubdivideAsString()
const char * GetGenerateTCoordsAsString()
void SetSubdivideToSpecified()
void SetGenerateTCoordsToUseLength()
spline abstract class for interpolating splines
Definition: vtkSpline.h:63
@ offset
Definition: vtkX3D.h:438
#define VTK_TCOORDS_FROM_SCALARS
#define VTK_TCOORDS_FROM_LENGTH
#define VTK_SUBDIVIDE_LENGTH
#define VTK_TCOORDS_FROM_NORMALIZED_LENGTH
#define VTK_TCOORDS_OFF
#define VTK_SUBDIVIDE_SPECIFIED
int vtkIdType
Definition: vtkType.h:287
#define VTK_DOUBLE_MAX
Definition: vtkType.h:163
#define VTK_INT_MAX
Definition: vtkType.h:153