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 =========================================================================*/
41 #ifndef __vtkRibbonFilter_h
42 #define __vtkRibbonFilter_h
43 
44 #include "vtkPolyDataAlgorithm.h"
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 vtkDataArray;
54 class vtkFloatArray;
55 class vtkPointData;
56 class vtkPoints;
57 
59 {
60 public:
62  void PrintSelf(ostream& os, vtkIndent indent);
63 
66  static vtkRibbonFilter *New();
67 
69 
71  vtkSetClampMacro(Width,double,0,VTK_DOUBLE_MAX);
72  vtkGetMacro(Width,double);
74 
76 
78  vtkSetClampMacro(Angle,double,0,360);
79  vtkGetMacro(Angle,double);
81 
83 
85  vtkSetMacro(VaryWidth,int);
86  vtkGetMacro(VaryWidth,int);
87  vtkBooleanMacro(VaryWidth,int);
89 
91 
93  vtkSetMacro(WidthFactor,double);
94  vtkGetMacro(WidthFactor,double);
96 
98 
100  vtkSetVector3Macro(DefaultNormal,double);
101  vtkGetVectorMacro(DefaultNormal,double,3);
103 
105 
107  vtkSetMacro(UseDefaultNormal,int);
108  vtkGetMacro(UseDefaultNormal,int);
109  vtkBooleanMacro(UseDefaultNormal,int);
111 
113 
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  vtkRibbonFilter();
140  ~vtkRibbonFilter();
141 
143  double Width;
144  double Angle;
145  int VaryWidth; //controls whether width varies with scalar data
146  double WidthFactor;
147  double DefaultNormal[3];
149  int GenerateTCoords; //control texture coordinate generation
150  double TextureLength; //this length is mapped to [0,1) texture space
151 
152  // Helper methods
153  int GeneratePoints(vtkIdType offset, vtkIdType npts, vtkIdType *pts,
154  vtkPoints *inPts, vtkPoints *newPts,
155  vtkPointData *pd, vtkPointData *outPD,
156  vtkFloatArray *newNormals, vtkDataArray *inScalars,
157  double range[2], vtkDataArray *inNormals);
158  void GenerateStrip(vtkIdType offset, vtkIdType npts, vtkIdType *pts,
159  vtkIdType inCellId, vtkCellData *cd, vtkCellData *outCD,
160  vtkCellArray *newStrips);
161  void GenerateTextureCoords(vtkIdType offset, vtkIdType npts, vtkIdType *pts,
162  vtkPoints *inPts, vtkDataArray *inScalars,
163  vtkFloatArray *newTCoords);
164  vtkIdType ComputeOffset(vtkIdType offset,vtkIdType npts);
165 
166  // Helper data members
167  double Theta;
168 
169 private:
170  vtkRibbonFilter(const vtkRibbonFilter&); // Not implemented.
171  void operator=(const vtkRibbonFilter&); // Not implemented.
172 };
173 
174 #endif
#define VTK_GRAPHICS_EXPORT
#define VTK_TCOORDS_OFF
void SetGenerateTCoordsToOff()
#define VTK_TCOORDS_FROM_NORMALIZED_LENGTH
represent and manipulate point attribute data
Definition: vtkPointData.h:35
create oriented ribbons from lines defined in polygonal dataset
#define VTK_DOUBLE_MAX
Definition: vtkType.h:133
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
represent and manipulate cell attribute data
Definition: vtkCellData.h:36
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:42
int vtkIdType
Definition: vtkType.h:255
void SetGenerateTCoordsToUseLength()
static vtkPolyDataAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent)
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:37
void SetGenerateTCoordsToUseScalars()
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:53
object to represent cell connectivity
Definition: vtkCellArray.h:48
void SetGenerateTCoordsToNormalizedLength()
#define VTK_TCOORDS_FROM_LENGTH
#define VTK_TCOORDS_FROM_SCALARS
Store zero or more vtkInformation instances.
#define VTK_LARGE_INTEGER
Definition: vtkType.h:148
represent and manipulate 3D points
Definition: vtkPoints.h:38