VTK  9.2.6
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 =========================================================================*/
48 #ifndef vtkRibbonFilter_h
49 #define vtkRibbonFilter_h
50 
51 #include "vtkFiltersModelingModule.h" // For export macro
52 #include "vtkPolyDataAlgorithm.h"
53 
54 #define VTK_TCOORDS_OFF 0
55 #define VTK_TCOORDS_FROM_NORMALIZED_LENGTH 1
56 #define VTK_TCOORDS_FROM_LENGTH 2
57 #define VTK_TCOORDS_FROM_SCALARS 3
58 
59 class vtkCellArray;
60 class vtkCellData;
61 class vtkDataArray;
62 class vtkFloatArray;
63 class vtkPointData;
64 class vtkPoints;
65 
66 class VTKFILTERSMODELING_EXPORT vtkRibbonFilter : public vtkPolyDataAlgorithm
67 {
68 public:
70  void PrintSelf(ostream& os, vtkIndent indent) override;
71 
76  static vtkRibbonFilter* New();
77 
79 
83  vtkSetClampMacro(Width, double, 0, VTK_DOUBLE_MAX);
84  vtkGetMacro(Width, double);
86 
88 
92  vtkSetClampMacro(Angle, double, 0, 360);
93  vtkGetMacro(Angle, double);
95 
97 
101  vtkSetMacro(VaryWidth, vtkTypeBool);
102  vtkGetMacro(VaryWidth, vtkTypeBool);
103  vtkBooleanMacro(VaryWidth, vtkTypeBool);
105 
107 
111  vtkSetMacro(WidthFactor, double);
112  vtkGetMacro(WidthFactor, double);
114 
116 
120  vtkSetVector3Macro(DefaultNormal, double);
121  vtkGetVectorMacro(DefaultNormal, double, 3);
123 
125 
129  vtkSetMacro(UseDefaultNormal, vtkTypeBool);
130  vtkGetMacro(UseDefaultNormal, vtkTypeBool);
131  vtkBooleanMacro(UseDefaultNormal, vtkTypeBool);
133 
135 
139  vtkSetClampMacro(GenerateTCoords, int, VTK_TCOORDS_OFF, VTK_TCOORDS_FROM_SCALARS);
140  vtkGetMacro(GenerateTCoords, int);
141  void SetGenerateTCoordsToOff() { this->SetGenerateTCoords(VTK_TCOORDS_OFF); }
143  {
144  this->SetGenerateTCoords(VTK_TCOORDS_FROM_NORMALIZED_LENGTH);
145  }
146  void SetGenerateTCoordsToUseLength() { this->SetGenerateTCoords(VTK_TCOORDS_FROM_LENGTH); }
147  void SetGenerateTCoordsToUseScalars() { this->SetGenerateTCoords(VTK_TCOORDS_FROM_SCALARS); }
150 
152 
158  vtkSetClampMacro(TextureLength, double, 0.000001, VTK_INT_MAX);
159  vtkGetMacro(TextureLength, double);
161 
162 protected:
164  ~vtkRibbonFilter() override;
165 
167  double Width;
168  double Angle;
169  vtkTypeBool VaryWidth; // controls whether width varies with scalar data
170  double WidthFactor;
171  double DefaultNormal[3];
173  int GenerateTCoords; // control texture coordinate generation
174  double TextureLength; // this length is mapped to [0,1) texture space
175 
176  // Helper methods
178  vtkPoints* newPts, vtkPointData* pd, vtkPointData* outPD, vtkFloatArray* newNormals,
179  vtkDataArray* inScalars, double range[2], vtkDataArray* inNormals);
180  void GenerateStrip(vtkIdType offset, vtkIdType npts, const vtkIdType* pts, vtkIdType inCellId,
181  vtkCellData* cd, vtkCellData* outCD, vtkCellArray* newStrips);
183  vtkPoints* inPts, vtkDataArray* inScalars, vtkFloatArray* newTCoords);
185 
186  // Helper data members
187  double Theta;
188 
189 private:
190  vtkRibbonFilter(const vtkRibbonFilter&) = delete;
191  void operator=(const vtkRibbonFilter&) = delete;
192 };
193 
194 #endif
object to represent cell connectivity
Definition: vtkCellArray.h:196
represent and manipulate cell attribute data
Definition: vtkCellData.h:51
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:65
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:51
a simple class to control print indentation
Definition: vtkIndent.h:49
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate point attribute data
Definition: vtkPointData.h:51
represent and manipulate 3D points
Definition: vtkPoints.h:49
Superclass for algorithms that produce only polydata as output.
create oriented ribbons from lines defined in polygonal dataset
void SetGenerateTCoordsToUseLength()
Control whether and how texture coordinates are produced.
void SetGenerateTCoordsToUseScalars()
Control whether and how texture coordinates are produced.
void SetGenerateTCoordsToNormalizedLength()
Control whether and how texture coordinates are produced.
const char * GetGenerateTCoordsAsString()
Control whether and how texture coordinates are produced.
vtkIdType ComputeOffset(vtkIdType offset, vtkIdType npts)
vtkTypeBool UseDefaultNormal
void SetGenerateTCoordsToOff()
Control whether and how texture coordinates are produced.
int GeneratePoints(vtkIdType offset, vtkIdType npts, const vtkIdType *pts, vtkPoints *inPts, vtkPoints *newPts, vtkPointData *pd, vtkPointData *outPD, vtkFloatArray *newNormals, vtkDataArray *inScalars, double range[2], vtkDataArray *inNormals)
vtkTypeBool VaryWidth
~vtkRibbonFilter() override
static vtkRibbonFilter * New()
Construct ribbon so that width is 0.1, the width does not vary with scalar values,...
void GenerateTextureCoords(vtkIdType offset, vtkIdType npts, const vtkIdType *pts, vtkPoints *inPts, vtkDataArray *inScalars, vtkFloatArray *newTCoords)
void GenerateStrip(vtkIdType offset, vtkIdType npts, const vtkIdType *pts, vtkIdType inCellId, vtkCellData *cd, vtkCellData *outCD, vtkCellArray *newStrips)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
@ range
Definition: vtkX3D.h:244
@ offset
Definition: vtkX3D.h:444
int vtkTypeBool
Definition: vtkABI.h:69
#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:332
#define VTK_DOUBLE_MAX
Definition: vtkType.h:165
#define VTK_INT_MAX
Definition: vtkType.h:155