VTK  9.6.1
vtkTubeFilter.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
48
49#ifndef vtkTubeFilter_h
50#define vtkTubeFilter_h
51
52#include "vtkFiltersCoreModule.h" // For export macro
54#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
55
56#define VTK_VARY_RADIUS_OFF 0
57#define VTK_VARY_RADIUS_BY_SCALAR 1
58#define VTK_VARY_RADIUS_BY_VECTOR 2
59#define VTK_VARY_RADIUS_BY_ABSOLUTE_SCALAR 3
60#define VTK_VARY_RADIUS_BY_VECTOR_NORM 4
61
62#define VTK_TCOORDS_OFF 0
63#define VTK_TCOORDS_FROM_NORMALIZED_LENGTH 1
64#define VTK_TCOORDS_FROM_LENGTH 2
65#define VTK_TCOORDS_FROM_SCALARS 3
66
67VTK_ABI_NAMESPACE_BEGIN
68class vtkCellArray;
69class vtkCellData;
70class vtkDataArray;
71class vtkFloatArray;
72class vtkPointData;
73class vtkPoints;
74
75class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkTubeFilter : public vtkPolyDataAlgorithm
76{
77public:
79 void PrintSelf(ostream& os, vtkIndent indent) override;
80
85 static vtkTubeFilter* New();
86
88
91 vtkSetClampMacro(Radius, double, 0.0, VTK_DOUBLE_MAX);
92 vtkGetMacro(Radius, double);
94
96
100 vtkGetMacro(VaryRadius, int);
114
116
119 vtkSetClampMacro(NumberOfSides, int, 3, VTK_INT_MAX);
120 vtkGetMacro(NumberOfSides, int);
122
124
127 vtkSetMacro(RadiusFactor, double);
128 vtkGetMacro(RadiusFactor, double);
130
132
136 vtkSetVector3Macro(DefaultNormal, double);
137 vtkGetVectorMacro(DefaultNormal, double, 3);
139
141
147 vtkBooleanMacro(UseDefaultNormal, vtkTypeBool);
149
151
160
162
165 vtkSetMacro(Capping, vtkTypeBool);
166 vtkGetMacro(Capping, vtkTypeBool);
167 vtkBooleanMacro(Capping, vtkTypeBool);
169
171
176 vtkSetClampMacro(OnRatio, int, 1, VTK_INT_MAX);
177 vtkGetMacro(OnRatio, int);
179
181
186 vtkSetClampMacro(Offset, int, 0, VTK_INT_MAX);
187 vtkGetMacro(Offset, int);
189
191
198 vtkGetMacro(GenerateTCoords, int);
208
210
216 vtkSetClampMacro(TextureLength, double, 0.000001, VTK_INT_MAX);
217 vtkGetMacro(TextureLength, double);
219
221
226 vtkSetMacro(OutputPointsPrecision, int);
227 vtkGetMacro(OutputPointsPrecision, int);
229
230protected:
232 ~vtkTubeFilter() override = default;
233
234 // Usual data generation method
236
237 double Radius; // minimum radius of tube
238 int VaryRadius; // controls radius variation
239 int NumberOfSides; // number of sides to create tube
240 double RadiusFactor; // maximum allowable radius
241 double DefaultNormal[3];
244 vtkTypeBool Capping; // control whether tubes are capped
245 int OnRatio; // control the generation of the sides of the tube
246 int Offset; // control the generation of the sides
247 int GenerateTCoords; // control texture coordinate generation
249 double TextureLength; // this length is mapped to [0,1) texture space
250
251 // Helper methods
252 int GeneratePoints(vtkIdType offset, vtkIdType npts, const vtkIdType* pts, vtkPoints* inPts,
253 vtkPoints* newPts, vtkPointData* pd, vtkPointData* outPD, vtkFloatArray* newNormals,
254 vtkDataArray* inScalars, double range[2], vtkDataArray* inVectors, double maxSpeed,
255 vtkDataArray* inNormals);
256 void GenerateStrips(vtkIdType offset, vtkIdType npts, const vtkIdType* pts, vtkIdType inCellId,
257 vtkCellData* cd, vtkCellData* outCD, vtkCellArray* newStrips);
258 void GenerateTextureCoords(vtkIdType offset, vtkIdType npts, const vtkIdType* pts,
259 vtkPoints* inPts, vtkDataArray* inScalars, vtkFloatArray* newTCoords);
261
262 // Helper data members
263 double Theta;
264
265private:
266 vtkTubeFilter(const vtkTubeFilter&) = delete;
267 void operator=(const vtkTubeFilter&) = delete;
268};
269
270VTK_ABI_NAMESPACE_END
271#endif
object to represent cell connectivity
represent and manipulate cell attribute data
Definition vtkCellData.h:32
dynamic, self-adjusting array of float
a simple class to control print indentation
Definition vtkIndent.h:29
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:30
void SetGenerateTCoordsToNormalizedLength()
Control whether and how texture coordinates are produced.
void SetGenerateTCoordsToOff()
Control whether and how texture coordinates are produced.
void SetVaryRadiusToVaryRadiusByVectorNorm()
Turn on/off the variation of tube radius with scalar value.
void SetGenerateTCoordsToUseScalars()
Control whether and how texture coordinates are produced.
vtkTypeBool UseDefaultNormal
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
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 *inVectors, double maxSpeed, vtkDataArray *inNormals)
void SetVaryRadiusToVaryRadiusByVector()
Turn on/off the variation of tube radius with scalar value.
virtual void SetVaryRadius(int)
Turn on/off the variation of tube radius with scalar value.
vtkTypeBool SidesShareVertices
vtkTypeBool Capping
vtkIdType ComputeOffset(vtkIdType offset, vtkIdType npts)
void SetGenerateTCoordsToUseLength()
Control whether and how texture coordinates are produced.
void SetVaryRadiusToVaryRadiusByScalar()
Turn on/off the variation of tube radius with scalar value.
static vtkTubeFilter * New()
Construct object with radius 0.5, radius variation turned off, the number of sides set to 3,...
~vtkTubeFilter() override=default
double DefaultNormal[3]
void SetVaryRadiusToVaryRadiusByAbsoluteScalar()
Turn on/off the variation of tube radius with scalar value.
void SetVaryRadiusToVaryRadiusOff()
Turn on/off the variation of tube radius with scalar value.
void GenerateStrips(vtkIdType offset, vtkIdType npts, const vtkIdType *pts, vtkIdType inCellId, vtkCellData *cd, vtkCellData *outCD, vtkCellArray *newStrips)
void GenerateTextureCoords(vtkIdType offset, vtkIdType npts, const vtkIdType *pts, vtkPoints *inPts, vtkDataArray *inScalars, vtkFloatArray *newTCoords)
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
const char * GetGenerateTCoordsAsString()
Control whether and how texture coordinates are produced.
virtual void SetGenerateTCoords(int)
Control whether and how texture coordinates are produced.
const char * GetVaryRadiusAsString()
Turn on/off the variation of tube radius with scalar value.
int vtkTypeBool
Definition vtkABI.h:64
#define vtkDataArray
#define VTK_TCOORDS_FROM_SCALARS
#define VTK_VARY_RADIUS_BY_SCALAR
#define VTK_TCOORDS_FROM_LENGTH
#define VTK_VARY_RADIUS_BY_VECTOR_NORM
#define VTK_TCOORDS_FROM_NORMALIZED_LENGTH
#define VTK_VARY_RADIUS_OFF
#define VTK_VARY_RADIUS_BY_VECTOR
#define VTK_TCOORDS_OFF
#define VTK_VARY_RADIUS_BY_ABSOLUTE_SCALAR
int vtkIdType
Definition vtkType.h:368
#define VTK_DOUBLE_MAX
Definition vtkType.h:207
#define VTK_INT_MAX
Definition vtkType.h:197
#define VTK_MARSHALAUTO