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 =========================================================================*/
42 #ifndef vtkRibbonFilter_h
43 #define vtkRibbonFilter_h
44 
45 #include "vtkFiltersModelingModule.h" // For export macro
46 #include "vtkPolyDataAlgorithm.h"
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 vtkDataArray;
56 class vtkFloatArray;
57 class vtkPointData;
58 class vtkPoints;
59 
60 class VTKFILTERSMODELING_EXPORT vtkRibbonFilter : public vtkPolyDataAlgorithm
61 {
62 public:
64  void PrintSelf(ostream& os, vtkIndent indent);
65 
70  static vtkRibbonFilter *New();
71 
73 
77  vtkSetClampMacro(Width,double,0,VTK_DOUBLE_MAX);
78  vtkGetMacro(Width,double);
80 
82 
86  vtkSetClampMacro(Angle,double,0,360);
87  vtkGetMacro(Angle,double);
89 
91 
95  vtkSetMacro(VaryWidth,int);
96  vtkGetMacro(VaryWidth,int);
97  vtkBooleanMacro(VaryWidth,int);
99 
101 
105  vtkSetMacro(WidthFactor,double);
106  vtkGetMacro(WidthFactor,double);
108 
110 
114  vtkSetVector3Macro(DefaultNormal,double);
115  vtkGetVectorMacro(DefaultNormal,double,3);
117 
119 
123  vtkSetMacro(UseDefaultNormal,int);
124  vtkGetMacro(UseDefaultNormal,int);
125  vtkBooleanMacro(UseDefaultNormal,int);
127 
129 
133  vtkSetClampMacro(GenerateTCoords,int,VTK_TCOORDS_OFF,
135  vtkGetMacro(GenerateTCoords,int);
137  {this->SetGenerateTCoords(VTK_TCOORDS_OFF);}
139  {this->SetGenerateTCoords(VTK_TCOORDS_FROM_NORMALIZED_LENGTH);}
141  {this->SetGenerateTCoords(VTK_TCOORDS_FROM_LENGTH);}
143  {this->SetGenerateTCoords(VTK_TCOORDS_FROM_SCALARS);}
146 
148 
154  vtkSetClampMacro(TextureLength,double,0.000001,VTK_INT_MAX);
155  vtkGetMacro(TextureLength,double);
157 
158 protected:
161 
163  double Width;
164  double Angle;
165  int VaryWidth; //controls whether width varies with scalar data
166  double WidthFactor;
167  double DefaultNormal[3];
169  int GenerateTCoords; //control texture coordinate generation
170  double TextureLength; //this length is mapped to [0,1) texture space
171 
172  // Helper methods
174  vtkPoints *inPts, vtkPoints *newPts,
175  vtkPointData *pd, vtkPointData *outPD,
176  vtkFloatArray *newNormals, vtkDataArray *inScalars,
177  double range[2], vtkDataArray *inNormals);
179  vtkIdType inCellId, vtkCellData *cd, vtkCellData *outCD,
180  vtkCellArray *newStrips);
182  vtkPoints *inPts, vtkDataArray *inScalars,
183  vtkFloatArray *newTCoords);
185 
186  // Helper data members
187  double Theta;
188 
189 private:
190  vtkRibbonFilter(const vtkRibbonFilter&) VTK_DELETE_FUNCTION;
191  void operator=(const vtkRibbonFilter&) VTK_DELETE_FUNCTION;
192 };
193 
194 #endif
object to represent cell connectivity
Definition: vtkCellArray.h:51
represent and manipulate cell attribute data
Definition: vtkCellData.h:39
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:42
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
Definition: vtkPointData.h:38
represent and manipulate 3D points
Definition: vtkPoints.h:40
Superclass for algorithms that produce only polydata as output.
create oriented ribbons from lines defined in polygonal dataset
void SetGenerateTCoordsToUseLength()
void SetGenerateTCoordsToUseScalars()
void SetGenerateTCoordsToNormalizedLength()
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
const char * GetGenerateTCoordsAsString()
void GenerateTextureCoords(vtkIdType offset, vtkIdType npts, vtkIdType *pts, vtkPoints *inPts, vtkDataArray *inScalars, vtkFloatArray *newTCoords)
vtkIdType ComputeOffset(vtkIdType offset, vtkIdType npts)
void SetGenerateTCoordsToOff()
static vtkRibbonFilter * New()
Construct ribbon so that width is 0.1, the width does not vary with scalar values,...
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
void GenerateStrip(vtkIdType offset, vtkIdType npts, vtkIdType *pts, vtkIdType inCellId, vtkCellData *cd, vtkCellData *outCD, vtkCellArray *newStrips)
int GeneratePoints(vtkIdType offset, vtkIdType npts, vtkIdType *pts, vtkPoints *inPts, vtkPoints *newPts, vtkPointData *pd, vtkPointData *outPD, vtkFloatArray *newNormals, vtkDataArray *inScalars, double range[2], vtkDataArray *inNormals)
@ range
Definition: vtkX3D.h:238
@ offset
Definition: vtkX3D.h:438
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
#define VTK_TCOORDS_FROM_SCALARS
#define VTK_TCOORDS_FROM_LENGTH
#define VTK_TCOORDS_FROM_NORMALIZED_LENGTH
#define VTK_TCOORDS_OFF
int vtkIdType
Definition: vtkType.h:287
#define VTK_DOUBLE_MAX
Definition: vtkType.h:163
#define VTK_INT_MAX
Definition: vtkType.h:153