VTK
vtkRibbonFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkRibbonFilter.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 =========================================================================*/
36 #ifndef vtkRibbonFilter_h
37 #define vtkRibbonFilter_h
38 
39 #include "vtkFiltersModelingModule.h" // For export macro
40 #include "vtkPolyDataAlgorithm.h"
41 
42 #define VTK_TCOORDS_OFF 0
43 #define VTK_TCOORDS_FROM_NORMALIZED_LENGTH 1
44 #define VTK_TCOORDS_FROM_LENGTH 2
45 #define VTK_TCOORDS_FROM_SCALARS 3
46 
47 class vtkCellArray;
48 class vtkCellData;
49 class vtkDataArray;
50 class vtkFloatArray;
51 class vtkPointData;
52 class vtkPoints;
53 
54 class VTKFILTERSMODELING_EXPORT vtkRibbonFilter : public vtkPolyDataAlgorithm
55 {
56 public:
58  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
59 
64  static vtkRibbonFilter *New();
65 
67 
71  vtkSetClampMacro(Width,double,0,VTK_DOUBLE_MAX);
72  vtkGetMacro(Width,double);
74 
76 
80  vtkSetClampMacro(Angle,double,0,360);
81  vtkGetMacro(Angle,double);
83 
85 
89  vtkSetMacro(VaryWidth,int);
90  vtkGetMacro(VaryWidth,int);
91  vtkBooleanMacro(VaryWidth,int);
93 
95 
99  vtkSetMacro(WidthFactor,double);
100  vtkGetMacro(WidthFactor,double);
102 
104 
108  vtkSetVector3Macro(DefaultNormal,double);
109  vtkGetVectorMacro(DefaultNormal,double,3);
111 
113 
117  vtkSetMacro(UseDefaultNormal,int);
118  vtkGetMacro(UseDefaultNormal,int);
119  vtkBooleanMacro(UseDefaultNormal,int);
121 
123 
127  vtkSetClampMacro(GenerateTCoords,int,VTK_TCOORDS_OFF,
129  vtkGetMacro(GenerateTCoords,int);
131  {this->SetGenerateTCoords(VTK_TCOORDS_OFF);}
133  {this->SetGenerateTCoords(VTK_TCOORDS_FROM_NORMALIZED_LENGTH);}
135  {this->SetGenerateTCoords(VTK_TCOORDS_FROM_LENGTH);}
137  {this->SetGenerateTCoords(VTK_TCOORDS_FROM_SCALARS);}
138  const char *GetGenerateTCoordsAsString();
140 
142 
148  vtkSetClampMacro(TextureLength,double,0.000001,VTK_INT_MAX);
149  vtkGetMacro(TextureLength,double);
151 
152 protected:
153  vtkRibbonFilter();
154  ~vtkRibbonFilter() VTK_OVERRIDE;
155 
156  int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE;
157  double Width;
158  double Angle;
159  int VaryWidth; //controls whether width varies with scalar data
160  double WidthFactor;
161  double DefaultNormal[3];
162  int UseDefaultNormal;
163  int GenerateTCoords; //control texture coordinate generation
164  double TextureLength; //this length is mapped to [0,1) texture space
165 
166  // Helper methods
167  int GeneratePoints(vtkIdType offset, vtkIdType npts, vtkIdType *pts,
168  vtkPoints *inPts, vtkPoints *newPts,
169  vtkPointData *pd, vtkPointData *outPD,
170  vtkFloatArray *newNormals, vtkDataArray *inScalars,
171  double range[2], vtkDataArray *inNormals);
172  void GenerateStrip(vtkIdType offset, vtkIdType npts, vtkIdType *pts,
173  vtkIdType inCellId, vtkCellData *cd, vtkCellData *outCD,
174  vtkCellArray *newStrips);
175  void GenerateTextureCoords(vtkIdType offset, vtkIdType npts, vtkIdType *pts,
176  vtkPoints *inPts, vtkDataArray *inScalars,
177  vtkFloatArray *newTCoords);
178  vtkIdType ComputeOffset(vtkIdType offset,vtkIdType npts);
179 
180  // Helper data members
181  double Theta;
182 
183 private:
184  vtkRibbonFilter(const vtkRibbonFilter&) VTK_DELETE_FUNCTION;
185  void operator=(const vtkRibbonFilter&) VTK_DELETE_FUNCTION;
186 };
187 
188 #endif
#define VTK_TCOORDS_OFF
void SetGenerateTCoordsToOff()
Control whether and how texture coordinates are produced.
#define VTK_TCOORDS_FROM_NORMALIZED_LENGTH
represent and manipulate point attribute data
Definition: vtkPointData.h:31
create oriented ribbons from lines defined in polygonal dataset
#define VTK_DOUBLE_MAX
Definition: vtkType.h:167
Store vtkAlgorithm input/output information.
#define VTK_INT_MAX
Definition: vtkType.h:157
represent and manipulate cell attribute data
Definition: vtkCellData.h:32
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:35
int vtkIdType
Definition: vtkType.h:345
void SetGenerateTCoordsToUseLength()
Control whether and how texture coordinates are produced.
static vtkPolyDataAlgorithm * New()
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:33
void SetGenerateTCoordsToUseScalars()
Control whether and how texture coordinates are produced.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:48
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
object to represent cell connectivity
Definition: vtkCellArray.h:44
void SetGenerateTCoordsToNormalizedLength()
Control whether and how texture coordinates are produced.
#define VTK_TCOORDS_FROM_LENGTH
#define VTK_TCOORDS_FROM_SCALARS
Store zero or more vtkInformation instances.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
represent and manipulate 3D points
Definition: vtkPoints.h:33
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.