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 "vtkPolyDataAlgorithm.h"
43 
44 #define VTK_SUBDIVIDE_SPECIFIED 0
45 #define VTK_SUBDIVIDE_LENGTH 1
46 
47 #define VTK_TCOORDS_OFF 0
48 #define VTK_TCOORDS_FROM_NORMALIZED_LENGTH 1
49 #define VTK_TCOORDS_FROM_LENGTH 2
50 #define VTK_TCOORDS_FROM_SCALARS 3
51 
52 class vtkCellArray;
53 class vtkCellData;
54 class vtkFloatArray;
55 class vtkPointData;
56 class vtkPoints;
57 class vtkSpline;
58 
60 {
61 public:
63  void PrintSelf(ostream& os, vtkIndent indent);
64 
67  static vtkSplineFilter *New();
68 
70 
72  vtkSetClampMacro(MaximumNumberOfSubdivisions,int,1,VTK_LARGE_INTEGER);
73  vtkGetMacro(MaximumNumberOfSubdivisions,int);
75 
77 
78  vtkSetClampMacro(Subdivide,int,VTK_SUBDIVIDE_SPECIFIED,VTK_SUBDIVIDE_LENGTH);
79  vtkGetMacro(Subdivide,int);
81  {this->SetSubdivide(VTK_SUBDIVIDE_SPECIFIED);}
83  {this->SetSubdivide(VTK_SUBDIVIDE_LENGTH);}
84  const char *GetSubdivideAsString();
86 
88 
91  vtkSetClampMacro(NumberOfSubdivisions,int,1,VTK_LARGE_INTEGER);
92  vtkGetMacro(NumberOfSubdivisions,int);
94 
96 
99  vtkSetClampMacro(Length,double,0.0000001,VTK_DOUBLE_MAX);
100  vtkGetMacro(Length,double);
102 
104 
105  virtual void SetSpline(vtkSpline*);
106  vtkGetObjectMacro(Spline,vtkSpline);
108 
110 
115  vtkSetClampMacro(GenerateTCoords,int,VTK_TCOORDS_OFF,
117  vtkGetMacro(GenerateTCoords,int);
119  {this->SetGenerateTCoords(VTK_TCOORDS_OFF);}
121  {this->SetGenerateTCoords(VTK_TCOORDS_FROM_NORMALIZED_LENGTH);}
123  {this->SetGenerateTCoords(VTK_TCOORDS_FROM_LENGTH);}
125  {this->SetGenerateTCoords(VTK_TCOORDS_FROM_SCALARS);}
126  const char *GetGenerateTCoordsAsString();
128 
130 
134  vtkSetClampMacro(TextureLength,double,0.000001,VTK_LARGE_INTEGER);
135  vtkGetMacro(TextureLength,double);
137 
138 protected:
139  vtkSplineFilter();
140  ~vtkSplineFilter();
141 
142  // Usual data generation method
144 
148  double Length;
154  double TextureLength; //this length is mapped to [0,1) texture space
155 
156  //helper methods
157  int GeneratePoints(vtkIdType offset, vtkIdType npts, vtkIdType *pts,
158  vtkPoints *inPts, vtkPoints *newPts, vtkPointData *pd,
159  vtkPointData *outPD, int genTCoords,
160  vtkFloatArray *newTCoords);
161 
162  void GenerateLine(vtkIdType offset, vtkIdType numGenPts, vtkIdType inCellId,
163  vtkCellData *cd, vtkCellData *outCD, vtkCellArray *newLines);
164 
165  //helper members
167 
168 private:
169  vtkSplineFilter(const vtkSplineFilter&); // Not implemented.
170  void operator=(const vtkSplineFilter&); // Not implemented.
171 };
172 
173 #endif