VTK  9.3.0
vtkRibbonFilter.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
36#ifndef vtkRibbonFilter_h
37#define vtkRibbonFilter_h
38
39#include "vtkFiltersModelingModule.h" // For export macro
41
42#define VTK_TCOORDS_OFF 0
43#define VTK_TCOORDS_FROM_NORMALIZED_LENGTH 1
44#define VTK_TCOORDS_FROM_LENGTH 2
45#define VTK_TCOORDS_FROM_SCALARS 3
46
47VTK_ABI_NAMESPACE_BEGIN
48class vtkCellArray;
49class vtkCellData;
50class vtkDataArray;
51class vtkFloatArray;
52class vtkPointData;
53class vtkPoints;
54
55class VTKFILTERSMODELING_EXPORT vtkRibbonFilter : public vtkPolyDataAlgorithm
56{
57public:
59 void PrintSelf(ostream& os, vtkIndent indent) override;
60
66
68
72 vtkSetClampMacro(Width, double, 0, VTK_DOUBLE_MAX);
73 vtkGetMacro(Width, double);
75
77
81 vtkSetClampMacro(Angle, double, 0, 360);
82 vtkGetMacro(Angle, double);
84
86
90 vtkSetMacro(VaryWidth, vtkTypeBool);
91 vtkGetMacro(VaryWidth, vtkTypeBool);
92 vtkBooleanMacro(VaryWidth, vtkTypeBool);
94
96
100 vtkSetMacro(WidthFactor, double);
101 vtkGetMacro(WidthFactor, double);
103
105
109 vtkSetVector3Macro(DefaultNormal, double);
110 vtkGetVectorMacro(DefaultNormal, double, 3);
112
114
118 vtkSetMacro(UseDefaultNormal, vtkTypeBool);
119 vtkGetMacro(UseDefaultNormal, vtkTypeBool);
120 vtkBooleanMacro(UseDefaultNormal, vtkTypeBool);
122
124
128 vtkSetClampMacro(GenerateTCoords, int, VTK_TCOORDS_OFF, VTK_TCOORDS_FROM_SCALARS);
129 vtkGetMacro(GenerateTCoords, int);
130 void SetGenerateTCoordsToOff() { this->SetGenerateTCoords(VTK_TCOORDS_OFF); }
132 {
133 this->SetGenerateTCoords(VTK_TCOORDS_FROM_NORMALIZED_LENGTH);
134 }
135 void SetGenerateTCoordsToUseLength() { this->SetGenerateTCoords(VTK_TCOORDS_FROM_LENGTH); }
136 void SetGenerateTCoordsToUseScalars() { this->SetGenerateTCoords(VTK_TCOORDS_FROM_SCALARS); }
139
141
147 vtkSetClampMacro(TextureLength, double, 0.000001, VTK_INT_MAX);
148 vtkGetMacro(TextureLength, double);
150
151protected:
154
156 double Width;
157 double Angle;
158 vtkTypeBool VaryWidth; // controls whether width varies with scalar data
160 double DefaultNormal[3];
162 int GenerateTCoords; // control texture coordinate generation
163 double TextureLength; // this length is mapped to [0,1) texture space
164
165 // Helper methods
166 int GeneratePoints(vtkIdType offset, vtkIdType npts, const vtkIdType* pts, vtkPoints* inPts,
167 vtkPoints* newPts, vtkPointData* pd, vtkPointData* outPD, vtkFloatArray* newNormals,
168 vtkDataArray* inScalars, double range[2], vtkDataArray* inNormals);
169 void GenerateStrip(vtkIdType offset, vtkIdType npts, const vtkIdType* pts, vtkIdType inCellId,
170 vtkCellData* cd, vtkCellData* outCD, vtkCellArray* newStrips);
171 void GenerateTextureCoords(vtkIdType offset, vtkIdType npts, const vtkIdType* pts,
172 vtkPoints* inPts, vtkDataArray* inScalars, vtkFloatArray* newTCoords);
174
175 // Helper data members
176 double Theta;
177
178private:
179 vtkRibbonFilter(const vtkRibbonFilter&) = delete;
180 void operator=(const vtkRibbonFilter&) = delete;
181};
182
183VTK_ABI_NAMESPACE_END
184#endif
object to represent cell connectivity
represent and manipulate cell attribute data
Definition vtkCellData.h:40
abstract superclass for arrays of numeric data
dynamic, self-adjusting array of float
a simple class to control print indentation
Definition vtkIndent.h:38
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate point attribute data
represent and manipulate 3D points
Definition vtkPoints.h:38
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.
int vtkTypeBool
Definition vtkABI.h:64
#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:315
#define VTK_DOUBLE_MAX
Definition vtkType.h:154
#define VTK_INT_MAX
Definition vtkType.h:144