VTK  9.1.0
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=========================================================================*/
45#ifndef vtkRibbonFilter_h
46#define vtkRibbonFilter_h
47
48#include "vtkFiltersModelingModule.h" // For export macro
50
51#define VTK_TCOORDS_OFF 0
52#define VTK_TCOORDS_FROM_NORMALIZED_LENGTH 1
53#define VTK_TCOORDS_FROM_LENGTH 2
54#define VTK_TCOORDS_FROM_SCALARS 3
55
56class vtkCellArray;
57class vtkCellData;
58class vtkDataArray;
59class vtkFloatArray;
60class vtkPointData;
61class vtkPoints;
62
63class VTKFILTERSMODELING_EXPORT vtkRibbonFilter : public vtkPolyDataAlgorithm
64{
65public:
67 void PrintSelf(ostream& os, vtkIndent indent) override;
68
74
76
80 vtkSetClampMacro(Width, double, 0, VTK_DOUBLE_MAX);
81 vtkGetMacro(Width, double);
83
85
89 vtkSetClampMacro(Angle, double, 0, 360);
90 vtkGetMacro(Angle, double);
92
94
98 vtkSetMacro(VaryWidth, vtkTypeBool);
99 vtkGetMacro(VaryWidth, vtkTypeBool);
100 vtkBooleanMacro(VaryWidth, vtkTypeBool);
102
104
108 vtkSetMacro(WidthFactor, double);
109 vtkGetMacro(WidthFactor, double);
111
113
117 vtkSetVector3Macro(DefaultNormal, double);
118 vtkGetVectorMacro(DefaultNormal, double, 3);
120
122
126 vtkSetMacro(UseDefaultNormal, vtkTypeBool);
127 vtkGetMacro(UseDefaultNormal, vtkTypeBool);
128 vtkBooleanMacro(UseDefaultNormal, vtkTypeBool);
130
132
136 vtkSetClampMacro(GenerateTCoords, int, VTK_TCOORDS_OFF, VTK_TCOORDS_FROM_SCALARS);
137 vtkGetMacro(GenerateTCoords, int);
138 void SetGenerateTCoordsToOff() { this->SetGenerateTCoords(VTK_TCOORDS_OFF); }
140 {
141 this->SetGenerateTCoords(VTK_TCOORDS_FROM_NORMALIZED_LENGTH);
142 }
143 void SetGenerateTCoordsToUseLength() { this->SetGenerateTCoords(VTK_TCOORDS_FROM_LENGTH); }
144 void SetGenerateTCoordsToUseScalars() { this->SetGenerateTCoords(VTK_TCOORDS_FROM_SCALARS); }
147
149
155 vtkSetClampMacro(TextureLength, double, 0.000001, VTK_INT_MAX);
156 vtkGetMacro(TextureLength, double);
158
159protected:
162
164 double Width;
165 double Angle;
166 vtkTypeBool VaryWidth; // controls whether width varies with scalar data
168 double DefaultNormal[3];
170 int GenerateTCoords; // control texture coordinate generation
171 double TextureLength; // this length is mapped to [0,1) texture space
172
173 // Helper methods
175 vtkPoints* newPts, vtkPointData* pd, vtkPointData* outPD, vtkFloatArray* newNormals,
176 vtkDataArray* inScalars, double range[2], vtkDataArray* inNormals);
177 void GenerateStrip(vtkIdType offset, vtkIdType npts, const vtkIdType* pts, vtkIdType inCellId,
178 vtkCellData* cd, vtkCellData* outCD, vtkCellArray* newStrips);
180 vtkPoints* inPts, vtkDataArray* inScalars, vtkFloatArray* newTCoords);
182
183 // Helper data members
184 double Theta;
185
186private:
187 vtkRibbonFilter(const vtkRibbonFilter&) = delete;
188 void operator=(const vtkRibbonFilter&) = delete;
189};
190
191#endif
object to represent cell connectivity
Definition: vtkCellArray.h:190
represent and manipulate cell attribute data
Definition: vtkCellData.h:42
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:59
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:45
a simple class to control print indentation
Definition: vtkIndent.h:43
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate point attribute data
Definition: vtkPointData.h:42
represent and manipulate 3D points
Definition: vtkPoints.h:43
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.
vtkIdType ComputeOffset(vtkIdType offset, vtkIdType npts)
vtkTypeBool UseDefaultNormal
void SetGenerateTCoordsToOff()
Control whether and how texture coordinates are produced.
static vtkRibbonFilter * New()
Construct ribbon so that width is 0.1, the width does not vary with scalar values,...
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
void GenerateTextureCoords(vtkIdType offset, vtkIdType npts, const vtkIdType *pts, vtkPoints *inPts, vtkDataArray *inScalars, vtkFloatArray *newTCoords)
const char * GetGenerateTCoordsAsString()
Control whether and how texture coordinates are produced.
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