VTK  9.2.6
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=========================================================================*/
49#ifndef vtkSplineFilter_h
50#define vtkSplineFilter_h
51
52#include "vtkFiltersGeneralModule.h" // For export macro
54
55#define VTK_SUBDIVIDE_SPECIFIED 0
56#define VTK_SUBDIVIDE_LENGTH 1
57
58#define VTK_TCOORDS_OFF 0
59#define VTK_TCOORDS_FROM_NORMALIZED_LENGTH 1
60#define VTK_TCOORDS_FROM_LENGTH 2
61#define VTK_TCOORDS_FROM_SCALARS 3
62
63class vtkCellArray;
64class vtkCellData;
65class vtkFloatArray;
66class vtkPointData;
67class vtkPoints;
68class vtkSpline;
69
70class VTKFILTERSGENERAL_EXPORT vtkSplineFilter : public vtkPolyDataAlgorithm
71{
72public:
74 void PrintSelf(ostream& os, vtkIndent indent) override;
75
81
83
87 vtkSetClampMacro(MaximumNumberOfSubdivisions, int, 1, VTK_INT_MAX);
88 vtkGetMacro(MaximumNumberOfSubdivisions, int);
90
92
95 vtkSetClampMacro(Subdivide, int, VTK_SUBDIVIDE_SPECIFIED, VTK_SUBDIVIDE_LENGTH);
96 vtkGetMacro(Subdivide, int);
97 void SetSubdivideToSpecified() { this->SetSubdivide(VTK_SUBDIVIDE_SPECIFIED); }
98 void SetSubdivideToLength() { this->SetSubdivide(VTK_SUBDIVIDE_LENGTH); }
99 const char* GetSubdivideAsString();
101
103
108 vtkSetClampMacro(NumberOfSubdivisions, int, 1, VTK_INT_MAX);
109 vtkGetMacro(NumberOfSubdivisions, int);
111
113
118 vtkSetClampMacro(Length, double, 0.0000001, VTK_DOUBLE_MAX);
119 vtkGetMacro(Length, double);
121
123
126 virtual void SetSpline(vtkSpline*);
127 vtkGetObjectMacro(Spline, vtkSpline);
129
131
138 vtkSetClampMacro(GenerateTCoords, int, VTK_TCOORDS_OFF, VTK_TCOORDS_FROM_SCALARS);
139 vtkGetMacro(GenerateTCoords, int);
140 void SetGenerateTCoordsToOff() { this->SetGenerateTCoords(VTK_TCOORDS_OFF); }
142 {
143 this->SetGenerateTCoords(VTK_TCOORDS_FROM_NORMALIZED_LENGTH);
144 }
145 void SetGenerateTCoordsToUseLength() { this->SetGenerateTCoords(VTK_TCOORDS_FROM_LENGTH); }
146 void SetGenerateTCoordsToUseScalars() { this->SetGenerateTCoords(VTK_TCOORDS_FROM_SCALARS); }
149
151
157 vtkSetClampMacro(TextureLength, double, 0.000001, VTK_INT_MAX);
158 vtkGetMacro(TextureLength, double);
160
161protected:
164
165 // Usual data generation method
167
171 double Length;
177 double TextureLength; // this length is mapped to [0,1) texture space
178
179 // helper methods
180 int GeneratePoints(vtkIdType offset, vtkIdType npts, const vtkIdType* pts, vtkPoints* inPts,
181 vtkPoints* newPts, vtkPointData* pd, vtkPointData* outPD, int genTCoords,
182 vtkFloatArray* newTCoords);
183
184 void GenerateLine(vtkIdType offset, vtkIdType numGenPts, vtkIdType inCellId, vtkCellData* cd,
185 vtkCellData* outCD, vtkCellArray* newLines);
186
187 // helper members
189
190private:
191 vtkSplineFilter(const vtkSplineFilter&) = delete;
192 void operator=(const vtkSplineFilter&) = delete;
193};
194
195#endif
object to represent cell connectivity
represent and manipulate cell attribute data
Definition vtkCellData.h:51
dynamic, self-adjusting array of float
a simple class to control print indentation
Definition vtkIndent.h:49
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:49
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:63
#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:332
#define VTK_DOUBLE_MAX
Definition vtkType.h:165
#define VTK_INT_MAX
Definition vtkType.h:155