VTK  9.3.20240424
vtkSplineFilter.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
67#ifndef vtkSplineFilter_h
68#define vtkSplineFilter_h
69
70#include "vtkFiltersGeneralModule.h" // For export macro
72
73#define VTK_SUBDIVIDE_SPECIFIED 0
74#define VTK_SUBDIVIDE_LENGTH 1
75
76#define VTK_TCOORDS_OFF 0
77#define VTK_TCOORDS_FROM_NORMALIZED_LENGTH 1
78#define VTK_TCOORDS_FROM_LENGTH 2
79#define VTK_TCOORDS_FROM_SCALARS 3
80
81VTK_ABI_NAMESPACE_BEGIN
82class vtkCellArray;
83class vtkCellData;
84class vtkFloatArray;
85class vtkPointData;
86class vtkPoints;
87class vtkSpline;
88
89class VTKFILTERSGENERAL_EXPORT vtkSplineFilter : public vtkPolyDataAlgorithm
90{
91public:
93 void PrintSelf(ostream& os, vtkIndent indent) override;
94
100
102
106 vtkSetClampMacro(MaximumNumberOfSubdivisions, int, 1, VTK_INT_MAX);
107 vtkGetMacro(MaximumNumberOfSubdivisions, int);
109
111
114 vtkSetClampMacro(Subdivide, int, VTK_SUBDIVIDE_SPECIFIED, VTK_SUBDIVIDE_LENGTH);
115 vtkGetMacro(Subdivide, int);
116 void SetSubdivideToSpecified() { this->SetSubdivide(VTK_SUBDIVIDE_SPECIFIED); }
117 void SetSubdivideToLength() { this->SetSubdivide(VTK_SUBDIVIDE_LENGTH); }
118 const char* GetSubdivideAsString();
120
122
127 vtkSetClampMacro(NumberOfSubdivisions, int, 1, VTK_INT_MAX);
128 vtkGetMacro(NumberOfSubdivisions, int);
130
132
137 vtkSetClampMacro(Length, double, 0.0000001, VTK_DOUBLE_MAX);
138 vtkGetMacro(Length, double);
140
142
145 virtual void SetSpline(vtkSpline*);
146 vtkGetObjectMacro(Spline, vtkSpline);
148
150
157 vtkSetClampMacro(GenerateTCoords, int, VTK_TCOORDS_OFF, VTK_TCOORDS_FROM_SCALARS);
158 vtkGetMacro(GenerateTCoords, int);
159 void SetGenerateTCoordsToOff() { this->SetGenerateTCoords(VTK_TCOORDS_OFF); }
161 {
162 this->SetGenerateTCoords(VTK_TCOORDS_FROM_NORMALIZED_LENGTH);
163 }
164 void SetGenerateTCoordsToUseLength() { this->SetGenerateTCoords(VTK_TCOORDS_FROM_LENGTH); }
165 void SetGenerateTCoordsToUseScalars() { this->SetGenerateTCoords(VTK_TCOORDS_FROM_SCALARS); }
168
170
176 vtkSetClampMacro(TextureLength, double, 0.000001, VTK_INT_MAX);
177 vtkGetMacro(TextureLength, double);
179
181
187 vtkSetMacro(OutputPointsPrecision, int);
188 vtkGetMacro(OutputPointsPrecision, int);
190
191protected:
194
195 // Usual data generation method
197
201 double Length;
207 double TextureLength; // this length is mapped to [0,1) texture space
209
210 // helper methods
211 int GeneratePoints(vtkIdType offset, vtkIdType npts, const vtkIdType* pts, vtkPoints* inPts,
212 vtkPoints* newPts, vtkPointData* pd, vtkPointData* outPD, int genTCoords,
213 vtkFloatArray* newTCoords);
214
215 void GenerateLine(vtkIdType offset, vtkIdType numGenPts, vtkIdType inCellId, vtkCellData* cd,
216 vtkCellData* outCD, vtkCellArray* newLines);
217
218 // helper members
220
221private:
222 vtkSplineFilter(const vtkSplineFilter&) = delete;
223 void operator=(const vtkSplineFilter&) = delete;
224};
225
226VTK_ABI_NAMESPACE_END
227#endif
object to represent cell connectivity
represent and manipulate cell attribute data
dynamic, self-adjusting array of float
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate point attribute data
represent and manipulate 3D points
Definition vtkPoints.h:139
Superclass for algorithms that produce only polydata as output.
generate uniformly subdivided polylines from a set of input polyline using a vtkSpline
void SetGenerateTCoordsToNormalizedLength()
Control whether and how texture coordinates are produced.
void SetGenerateTCoordsToOff()
Control whether and how texture coordinates are produced.
void SetGenerateTCoordsToUseScalars()
Control whether and how texture coordinates are produced.
vtkSpline * XSpline
vtkSpline * ZSpline
static vtkSplineFilter * New()
Construct the class with no limit on the number of subdivisions and using an instance of vtkCardinalS...
void SetSubdivideToLength()
Specify how the number of subdivisions is determined.
~vtkSplineFilter() override
int GeneratePoints(vtkIdType offset, vtkIdType npts, const vtkIdType *pts, vtkPoints *inPts, vtkPoints *newPts, vtkPointData *pd, vtkPointData *outPD, int genTCoords, vtkFloatArray *newTCoords)
void GenerateLine(vtkIdType offset, vtkIdType numGenPts, vtkIdType inCellId, vtkCellData *cd, vtkCellData *outCD, vtkCellArray *newLines)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSpline * YSpline
virtual void SetSpline(vtkSpline *)
Specify an instance of vtkSpline to use to perform the interpolation.
vtkFloatArray * TCoordMap
const char * GetSubdivideAsString()
Specify how the number of subdivisions is determined.
const char * GetGenerateTCoordsAsString()
Control whether and how texture coordinates are produced.
void SetSubdivideToSpecified()
Specify how the number of subdivisions is determined.
void SetGenerateTCoordsToUseLength()
Control whether and how texture coordinates are produced.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
spline abstract class for interpolating splines
Definition vtkSpline.h:52
#define VTK_SUBDIVIDE_LENGTH
#define VTK_SUBDIVIDE_SPECIFIED
#define VTK_TCOORDS_FROM_SCALARS
#define VTK_TCOORDS_FROM_LENGTH
#define VTK_TCOORDS_FROM_NORMALIZED_LENGTH
#define VTK_TCOORDS_OFF
int vtkIdType
Definition vtkType.h:315
#define VTK_DOUBLE_MAX
Definition vtkType.h:154
#define VTK_INT_MAX
Definition vtkType.h:144