VTK  9.3.20240425
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
66#ifndef vtkRibbonFilter_h
67#define vtkRibbonFilter_h
68
69#include "vtkFiltersModelingModule.h" // For export macro
71
72#define VTK_TCOORDS_OFF 0
73#define VTK_TCOORDS_FROM_NORMALIZED_LENGTH 1
74#define VTK_TCOORDS_FROM_LENGTH 2
75#define VTK_TCOORDS_FROM_SCALARS 3
76
77VTK_ABI_NAMESPACE_BEGIN
78class vtkCellArray;
79class vtkCellData;
80class vtkDataArray;
81class vtkFloatArray;
82class vtkPointData;
83class vtkPoints;
84
85class VTKFILTERSMODELING_EXPORT vtkRibbonFilter : public vtkPolyDataAlgorithm
86{
87public:
89 void PrintSelf(ostream& os, vtkIndent indent) override;
90
96
98
102 vtkSetClampMacro(Width, double, 0, VTK_DOUBLE_MAX);
103 vtkGetMacro(Width, double);
105
107
111 vtkSetClampMacro(Angle, double, 0, 360);
112 vtkGetMacro(Angle, double);
114
116
120 vtkSetMacro(VaryWidth, vtkTypeBool);
121 vtkGetMacro(VaryWidth, vtkTypeBool);
122 vtkBooleanMacro(VaryWidth, vtkTypeBool);
124
126
130 vtkSetMacro(WidthFactor, double);
131 vtkGetMacro(WidthFactor, double);
133
135
139 vtkSetVector3Macro(DefaultNormal, double);
140 vtkGetVectorMacro(DefaultNormal, double, 3);
142
144
148 vtkSetMacro(UseDefaultNormal, vtkTypeBool);
149 vtkGetMacro(UseDefaultNormal, vtkTypeBool);
150 vtkBooleanMacro(UseDefaultNormal, vtkTypeBool);
152
154
158 vtkSetClampMacro(GenerateTCoords, int, VTK_TCOORDS_OFF, VTK_TCOORDS_FROM_SCALARS);
159 vtkGetMacro(GenerateTCoords, int);
160 void SetGenerateTCoordsToOff() { this->SetGenerateTCoords(VTK_TCOORDS_OFF); }
162 {
163 this->SetGenerateTCoords(VTK_TCOORDS_FROM_NORMALIZED_LENGTH);
164 }
165 void SetGenerateTCoordsToUseLength() { this->SetGenerateTCoords(VTK_TCOORDS_FROM_LENGTH); }
166 void SetGenerateTCoordsToUseScalars() { this->SetGenerateTCoords(VTK_TCOORDS_FROM_SCALARS); }
169
171
177 vtkSetClampMacro(TextureLength, double, 0.000001, VTK_INT_MAX);
178 vtkGetMacro(TextureLength, double);
180
181protected:
184
186 double Width;
187 double Angle;
188 vtkTypeBool VaryWidth; // controls whether width varies with scalar data
190 double DefaultNormal[3];
192 int GenerateTCoords; // control texture coordinate generation
193 double TextureLength; // this length is mapped to [0,1) texture space
194
195 // Helper methods
196 int GeneratePoints(vtkIdType offset, vtkIdType npts, const vtkIdType* pts, vtkPoints* inPts,
197 vtkPoints* newPts, vtkPointData* pd, vtkPointData* outPD, vtkFloatArray* newNormals,
198 vtkDataArray* inScalars, double range[2], vtkDataArray* inNormals);
199 void GenerateStrip(vtkIdType offset, vtkIdType npts, const vtkIdType* pts, vtkIdType inCellId,
200 vtkCellData* cd, vtkCellData* outCD, vtkCellArray* newStrips);
201 void GenerateTextureCoords(vtkIdType offset, vtkIdType npts, const vtkIdType* pts,
202 vtkPoints* inPts, vtkDataArray* inScalars, vtkFloatArray* newTCoords);
204
205 // Helper data members
206 double Theta;
207
208private:
209 vtkRibbonFilter(const vtkRibbonFilter&) = delete;
210 void operator=(const vtkRibbonFilter&) = delete;
211};
212
213VTK_ABI_NAMESPACE_END
214#endif
object to represent cell connectivity
represent and manipulate cell attribute data
abstract superclass for arrays of numeric data
dynamic, self-adjusting array of float
a simple class to control print indentation
Definition vtkIndent.h:108
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:139
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