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 =========================================================================*/
78 #ifndef vtkRibbonFilter_h
79 #define vtkRibbonFilter_h
80 
81 #include "vtkFiltersModelingModule.h" // For export macro
82 #include "vtkPolyDataAlgorithm.h"
83 
84 #define VTK_TCOORDS_OFF 0
85 #define VTK_TCOORDS_FROM_NORMALIZED_LENGTH 1
86 #define VTK_TCOORDS_FROM_LENGTH 2
87 #define VTK_TCOORDS_FROM_SCALARS 3
88 
89 class vtkCellArray;
90 class vtkCellData;
91 class vtkDataArray;
92 class vtkFloatArray;
93 class vtkPointData;
94 class vtkPoints;
95 
96 class VTKFILTERSMODELING_EXPORT vtkRibbonFilter : public vtkPolyDataAlgorithm
97 {
98 public:
100  void PrintSelf(ostream& os, vtkIndent indent) override;
101 
106  static vtkRibbonFilter* New();
107 
109 
113  vtkSetClampMacro(Width, double, 0, VTK_DOUBLE_MAX);
114  vtkGetMacro(Width, double);
116 
118 
122  vtkSetClampMacro(Angle, double, 0, 360);
123  vtkGetMacro(Angle, double);
125 
127 
131  vtkSetMacro(VaryWidth, vtkTypeBool);
132  vtkGetMacro(VaryWidth, vtkTypeBool);
133  vtkBooleanMacro(VaryWidth, vtkTypeBool);
135 
137 
141  vtkSetMacro(WidthFactor, double);
142  vtkGetMacro(WidthFactor, double);
144 
146 
150  vtkSetVector3Macro(DefaultNormal, double);
151  vtkGetVectorMacro(DefaultNormal, double, 3);
153 
155 
159  vtkSetMacro(UseDefaultNormal, vtkTypeBool);
160  vtkGetMacro(UseDefaultNormal, vtkTypeBool);
161  vtkBooleanMacro(UseDefaultNormal, vtkTypeBool);
163 
165 
169  vtkSetClampMacro(GenerateTCoords, int, VTK_TCOORDS_OFF, VTK_TCOORDS_FROM_SCALARS);
170  vtkGetMacro(GenerateTCoords, int);
171  void SetGenerateTCoordsToOff() { this->SetGenerateTCoords(VTK_TCOORDS_OFF); }
173  {
174  this->SetGenerateTCoords(VTK_TCOORDS_FROM_NORMALIZED_LENGTH);
175  }
176  void SetGenerateTCoordsToUseLength() { this->SetGenerateTCoords(VTK_TCOORDS_FROM_LENGTH); }
177  void SetGenerateTCoordsToUseScalars() { this->SetGenerateTCoords(VTK_TCOORDS_FROM_SCALARS); }
180 
182 
188  vtkSetClampMacro(TextureLength, double, 0.000001, VTK_INT_MAX);
189  vtkGetMacro(TextureLength, double);
191 
192 protected:
194  ~vtkRibbonFilter() override;
195 
197  double Width;
198  double Angle;
199  vtkTypeBool VaryWidth; // controls whether width varies with scalar data
200  double WidthFactor;
201  double DefaultNormal[3];
203  int GenerateTCoords; // control texture coordinate generation
204  double TextureLength; // this length is mapped to [0,1) texture space
205 
206  // Helper methods
208  vtkPoints* newPts, vtkPointData* pd, vtkPointData* outPD, vtkFloatArray* newNormals,
209  vtkDataArray* inScalars, double range[2], vtkDataArray* inNormals);
210  void GenerateStrip(vtkIdType offset, vtkIdType npts, const vtkIdType* pts, vtkIdType inCellId,
211  vtkCellData* cd, vtkCellData* outCD, vtkCellArray* newStrips);
213  vtkPoints* inPts, vtkDataArray* inScalars, vtkFloatArray* newTCoords);
215 
216  // Helper data members
217  double Theta;
218 
219 private:
220  vtkRibbonFilter(const vtkRibbonFilter&) = delete;
221  void operator=(const vtkRibbonFilter&) = delete;
222 };
223 
224 #endif
object to represent cell connectivity
Definition: vtkCellArray.h:296
represent and manipulate cell attribute data
Definition: vtkCellData.h:151
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:165
dynamic, self-adjusting array of float
a simple class to control print indentation
Definition: vtkIndent.h:119
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate point attribute data
Definition: vtkPointData.h:151
represent and manipulate 3D points
Definition: vtkPoints.h:149
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