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=========================================================================*/
35
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
47class vtkCellArray;
48class vtkCellData;
49class vtkDataArray;
50class vtkFloatArray;
51class vtkPointData;
52class vtkPoints;
53
54class VTKFILTERSMODELING_EXPORT vtkRibbonFilter : public vtkPolyDataAlgorithm
55{
56public:
58 void PrintSelf(ostream& os, vtkIndent indent) override;
59
65
67
71 vtkSetClampMacro(Width, double, 0, VTK_DOUBLE_MAX);
72 vtkGetMacro(Width, double);
74
76
80 vtkSetClampMacro(Angle, double, 0, 360);
81 vtkGetMacro(Angle, double);
83
85
89 vtkSetMacro(VaryWidth, vtkTypeBool);
90 vtkGetMacro(VaryWidth, vtkTypeBool);
91 vtkBooleanMacro(VaryWidth, vtkTypeBool);
93
95
99 vtkSetMacro(WidthFactor, double);
100 vtkGetMacro(WidthFactor, double);
102
104
108 vtkSetVector3Macro(DefaultNormal, double);
109 vtkGetVectorMacro(DefaultNormal, double, 3);
111
113
119 vtkBooleanMacro(UseDefaultNormal, vtkTypeBool);
121
123
128 vtkGetMacro(GenerateTCoords, int);
138
140
146 vtkSetClampMacro(TextureLength, double, 0.000001, VTK_INT_MAX);
147 vtkGetMacro(TextureLength, double);
149
150protected:
153
155 double Width;
156 double Angle;
157 vtkTypeBool VaryWidth; // controls whether width varies with scalar data
159 double DefaultNormal[3];
161 int GenerateTCoords; // control texture coordinate generation
162 double TextureLength; // this length is mapped to [0,1) texture space
163
164 // Helper methods
165 int GeneratePoints(vtkIdType offset, vtkIdType npts, const vtkIdType* pts, vtkPoints* inPts,
166 vtkPoints* newPts, vtkPointData* pd, vtkPointData* outPD, vtkFloatArray* newNormals,
167 vtkDataArray* inScalars, double range[2], vtkDataArray* inNormals);
168 void GenerateStrip(vtkIdType offset, vtkIdType npts, const vtkIdType* pts, vtkIdType inCellId,
169 vtkCellData* cd, vtkCellData* outCD, vtkCellArray* newStrips);
170 void GenerateTextureCoords(vtkIdType offset, vtkIdType npts, const vtkIdType* pts,
171 vtkPoints* inPts, vtkDataArray* inScalars, vtkFloatArray* newTCoords);
173
174 // Helper data members
175 double Theta;
176
177private:
178 vtkRibbonFilter(const vtkRibbonFilter&) = delete;
179 void operator=(const vtkRibbonFilter&) = delete;
180};
181
182#endif
object to represent cell connectivity
represent and manipulate cell attribute data
Definition vtkCellData.h:36
dynamic, self-adjusting array of float
a simple class to control print indentation
Definition vtkIndent.h:34
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:34
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)
double DefaultNormal[3]
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)
virtual void SetGenerateTCoords(int)
Control whether and how texture coordinates are produced.
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:69
#define vtkDataArray
#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