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=========================================================================*/
39
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) override;
66
72
74
78 vtkSetClampMacro(MaximumNumberOfSubdivisions, int, 1, VTK_INT_MAX);
79 vtkGetMacro(MaximumNumberOfSubdivisions, int);
81
83
87 vtkGetMacro(Subdivide, int);
90 const char* GetSubdivideAsString();
92
94
99 vtkSetClampMacro(NumberOfSubdivisions, int, 1, VTK_INT_MAX);
100 vtkGetMacro(NumberOfSubdivisions, int);
102
104
109 vtkSetClampMacro(Length, double, 0.0000001, VTK_DOUBLE_MAX);
110 vtkGetMacro(Length, double);
112
114
117 virtual void SetSpline(vtkSpline*);
118 vtkGetObjectMacro(Spline, vtkSpline);
120
122
130 vtkGetMacro(GenerateTCoords, int);
140
142
148 vtkSetClampMacro(TextureLength, double, 0.000001, VTK_INT_MAX);
149 vtkGetMacro(TextureLength, double);
151
152protected:
155
156 // Usual data generation method
158
162 double Length;
168 double TextureLength; // this length is mapped to [0,1) texture space
169
170 // helper methods
171 int GeneratePoints(vtkIdType offset, vtkIdType npts, const vtkIdType* pts, vtkPoints* inPts,
172 vtkPoints* newPts, vtkPointData* pd, vtkPointData* outPD, int genTCoords,
173 vtkFloatArray* newTCoords);
174
175 void GenerateLine(vtkIdType offset, vtkIdType numGenPts, vtkIdType inCellId, vtkCellData* cd,
176 vtkCellData* outCD, vtkCellArray* newLines);
177
178 // helper members
180
181private:
182 vtkSplineFilter(const vtkSplineFilter&) = delete;
183 void operator=(const vtkSplineFilter&) = delete;
184};
185
186#endif
object to represent cell connectivity
represent and manipulate cell attribute data
Definition vtkCellData.h:42
dynamic, self-adjusting array of float
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
represent and manipulate 3D points
Definition vtkPoints.h:40
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
virtual void SetSubdivide(int)
Specify how the number of subdivisions is determined.
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.
virtual void SetGenerateTCoords(int)
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_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:332
#define VTK_DOUBLE_MAX
Definition vtkType.h:165
#define VTK_INT_MAX
Definition vtkType.h:155