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 =========================================================================*/
37 #ifndef vtkSplineFilter_h
38 #define vtkSplineFilter_h
39 
40 #include "vtkFiltersGeneralModule.h" // For export macro
41 #include "vtkPolyDataAlgorithm.h"
42 
43 #define VTK_SUBDIVIDE_SPECIFIED 0
44 #define VTK_SUBDIVIDE_LENGTH 1
45 
46 #define VTK_TCOORDS_OFF 0
47 #define VTK_TCOORDS_FROM_NORMALIZED_LENGTH 1
48 #define VTK_TCOORDS_FROM_LENGTH 2
49 #define VTK_TCOORDS_FROM_SCALARS 3
50 
51 class vtkCellArray;
52 class vtkCellData;
53 class vtkFloatArray;
54 class vtkPointData;
55 class vtkPoints;
56 class vtkSpline;
57 
58 class VTKFILTERSGENERAL_EXPORT vtkSplineFilter : public vtkPolyDataAlgorithm
59 {
60 public:
62  void PrintSelf(ostream& os, vtkIndent indent) override;
63 
68  static vtkSplineFilter *New();
69 
71 
75  vtkSetClampMacro(MaximumNumberOfSubdivisions,int,1,VTK_INT_MAX);
76  vtkGetMacro(MaximumNumberOfSubdivisions,int);
78 
80 
83  vtkSetClampMacro(Subdivide,int,VTK_SUBDIVIDE_SPECIFIED,VTK_SUBDIVIDE_LENGTH);
84  vtkGetMacro(Subdivide,int);
86  {this->SetSubdivide(VTK_SUBDIVIDE_SPECIFIED);}
88  {this->SetSubdivide(VTK_SUBDIVIDE_LENGTH);}
89  const char *GetSubdivideAsString();
91 
93 
98  vtkSetClampMacro(NumberOfSubdivisions,int,1,VTK_INT_MAX);
99  vtkGetMacro(NumberOfSubdivisions,int);
101 
103 
108  vtkSetClampMacro(Length,double,0.0000001,VTK_DOUBLE_MAX);
109  vtkGetMacro(Length,double);
111 
113 
116  virtual void SetSpline(vtkSpline*);
117  vtkGetObjectMacro(Spline,vtkSpline);
119 
121 
128  vtkSetClampMacro(GenerateTCoords,int,VTK_TCOORDS_OFF,
130  vtkGetMacro(GenerateTCoords,int);
132  {this->SetGenerateTCoords(VTK_TCOORDS_OFF);}
134  {this->SetGenerateTCoords(VTK_TCOORDS_FROM_NORMALIZED_LENGTH);}
136  {this->SetGenerateTCoords(VTK_TCOORDS_FROM_LENGTH);}
138  {this->SetGenerateTCoords(VTK_TCOORDS_FROM_SCALARS);}
139  const char *GetGenerateTCoordsAsString();
141 
143 
149  vtkSetClampMacro(TextureLength,double,0.000001,VTK_INT_MAX);
150  vtkGetMacro(TextureLength,double);
152 
153 protected:
154  vtkSplineFilter();
155  ~vtkSplineFilter() override;
156 
157  // Usual data generation method
159 
163  double Length;
169  double TextureLength; //this length is mapped to [0,1) texture space
170 
171  //helper methods
172  int GeneratePoints(vtkIdType offset, vtkIdType npts, vtkIdType *pts,
173  vtkPoints *inPts, vtkPoints *newPts, vtkPointData *pd,
174  vtkPointData *outPD, int genTCoords,
175  vtkFloatArray *newTCoords);
176 
177  void GenerateLine(vtkIdType offset, vtkIdType numGenPts, vtkIdType inCellId,
178  vtkCellData *cd, vtkCellData *outCD, vtkCellArray *newLines);
179 
180  //helper members
182 
183 private:
184  vtkSplineFilter(const vtkSplineFilter&) = delete;
185  void operator=(const vtkSplineFilter&) = delete;
186 };
187 
188 #endif
#define VTK_SUBDIVIDE_SPECIFIED
void SetGenerateTCoordsToOff()
Control whether and how texture coordinates are produced.
#define VTK_TCOORDS_FROM_LENGTH
represent and manipulate point attribute data
Definition: vtkPointData.h:31
#define VTK_DOUBLE_MAX
Definition: vtkType.h:169
Store vtkAlgorithm input/output information.
generate uniformly subdivided polylines from a set of input polyline using a vtkSpline
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
#define VTK_INT_MAX
Definition: vtkType.h:159
vtkSpline * XSpline
represent and manipulate cell attribute data
Definition: vtkCellData.h:32
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:35
#define VTK_TCOORDS_FROM_NORMALIZED_LENGTH
void SetSubdivideToLength()
Specify how the number of subdivisions is determined.
int vtkIdType
Definition: vtkType.h:347
static vtkPolyDataAlgorithm * New()
void SetSubdivideToSpecified()
Specify how the number of subdivisions is determined.
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:33
spline abstract class for interpolating splines
Definition: vtkSpline.h:62
#define VTK_TCOORDS_OFF
#define VTK_TCOORDS_FROM_SCALARS
object to represent cell connectivity
Definition: vtkCellArray.h:44
void SetGenerateTCoordsToNormalizedLength()
Control whether and how texture coordinates are produced.
Store zero or more vtkInformation instances.
vtkSpline * YSpline
vtkFloatArray * TCoordMap
#define VTK_SUBDIVIDE_LENGTH
void SetGenerateTCoordsToUseScalars()
Control whether and how texture coordinates are produced.
vtkSpline * ZSpline
void SetGenerateTCoordsToUseLength()
Control whether and how texture coordinates are produced.
represent and manipulate 3D points
Definition: vtkPoints.h:33
vtkSpline * Spline
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.