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 =========================================================================*/
39 #ifndef vtkSplineFilter_h
40 #define vtkSplineFilter_h
41 
42 #include "vtkFiltersGeneralModule.h" // For export macro
43 #include "vtkPolyDataAlgorithm.h"
44 
45 #define VTK_SUBDIVIDE_SPECIFIED 0
46 #define VTK_SUBDIVIDE_LENGTH 1
47 
48 #define VTK_TCOORDS_OFF 0
49 #define VTK_TCOORDS_FROM_NORMALIZED_LENGTH 1
50 #define VTK_TCOORDS_FROM_LENGTH 2
51 #define VTK_TCOORDS_FROM_SCALARS 3
52 
53 class vtkCellArray;
54 class vtkCellData;
55 class vtkFloatArray;
56 class vtkPointData;
57 class vtkPoints;
58 class vtkSpline;
59 
61 {
62 public:
64  void PrintSelf(ostream& os, vtkIndent indent);
65 
68  static vtkSplineFilter *New();
69 
71 
73  vtkSetClampMacro(MaximumNumberOfSubdivisions,int,1,VTK_INT_MAX);
74  vtkGetMacro(MaximumNumberOfSubdivisions,int);
76 
78 
79  vtkSetClampMacro(Subdivide,int,VTK_SUBDIVIDE_SPECIFIED,VTK_SUBDIVIDE_LENGTH);
80  vtkGetMacro(Subdivide,int);
82  {this->SetSubdivide(VTK_SUBDIVIDE_SPECIFIED);}
84  {this->SetSubdivide(VTK_SUBDIVIDE_LENGTH);}
85  const char *GetSubdivideAsString();
87 
89 
92  vtkSetClampMacro(NumberOfSubdivisions,int,1,VTK_INT_MAX);
93  vtkGetMacro(NumberOfSubdivisions,int);
95 
97 
100  vtkSetClampMacro(Length,double,0.0000001,VTK_DOUBLE_MAX);
101  vtkGetMacro(Length,double);
103 
105 
106  virtual void SetSpline(vtkSpline*);
107  vtkGetObjectMacro(Spline,vtkSpline);
109 
111 
116  vtkSetClampMacro(GenerateTCoords,int,VTK_TCOORDS_OFF,
118  vtkGetMacro(GenerateTCoords,int);
120  {this->SetGenerateTCoords(VTK_TCOORDS_OFF);}
122  {this->SetGenerateTCoords(VTK_TCOORDS_FROM_NORMALIZED_LENGTH);}
124  {this->SetGenerateTCoords(VTK_TCOORDS_FROM_LENGTH);}
126  {this->SetGenerateTCoords(VTK_TCOORDS_FROM_SCALARS);}
127  const char *GetGenerateTCoordsAsString();
129 
131 
135  vtkSetClampMacro(TextureLength,double,0.000001,VTK_INT_MAX);
136  vtkGetMacro(TextureLength,double);
138 
139 protected:
140  vtkSplineFilter();
141  ~vtkSplineFilter();
142 
143  // Usual data generation method
145 
149  double Length;
155  double TextureLength; //this length is mapped to [0,1) texture space
156 
157  //helper methods
158  int GeneratePoints(vtkIdType offset, vtkIdType npts, vtkIdType *pts,
159  vtkPoints *inPts, vtkPoints *newPts, vtkPointData *pd,
160  vtkPointData *outPD, int genTCoords,
161  vtkFloatArray *newTCoords);
162 
163  void GenerateLine(vtkIdType offset, vtkIdType numGenPts, vtkIdType inCellId,
164  vtkCellData *cd, vtkCellData *outCD, vtkCellArray *newLines);
165 
166  //helper members
168 
169 private:
170  vtkSplineFilter(const vtkSplineFilter&); // Not implemented.
171  void operator=(const vtkSplineFilter&); // Not implemented.
172 };
173 
174 #endif
#define VTK_SUBDIVIDE_SPECIFIED
void SetGenerateTCoordsToOff()
#define VTK_TCOORDS_FROM_LENGTH
represent and manipulate point attribute data
Definition: vtkPointData.h:36
#define VTK_DOUBLE_MAX
Definition: vtkType.h:140
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)
#define VTK_INT_MAX
Definition: vtkType.h:130
vtkSpline * XSpline
represent and manipulate cell attribute data
Definition: vtkCellData.h:37
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:45
#define VTK_TCOORDS_FROM_NORMALIZED_LENGTH
void SetSubdivideToLength()
int vtkIdType
Definition: vtkType.h:247
static vtkPolyDataAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent)
void SetSubdivideToSpecified()
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:38
spline abstract class for interpolating splines
Definition: vtkSpline.h:61
#define VTK_TCOORDS_OFF
#define VTKFILTERSGENERAL_EXPORT
#define VTK_TCOORDS_FROM_SCALARS
object to represent cell connectivity
Definition: vtkCellArray.h:49
void SetGenerateTCoordsToNormalizedLength()
Store zero or more vtkInformation instances.
vtkSpline * YSpline
vtkFloatArray * TCoordMap
#define VTK_SUBDIVIDE_LENGTH
void SetGenerateTCoordsToUseScalars()
vtkSpline * ZSpline
void SetGenerateTCoordsToUseLength()
represent and manipulate 3D points
Definition: vtkPoints.h:38
vtkSpline * Spline