VTK  9.2.6
vtkGenericGlyph3DFilter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkGenericGlyph3DFilter.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=========================================================================*/
81
82#ifndef vtkGenericGlyph3DFilter_h
83#define vtkGenericGlyph3DFilter_h
84
85#include "vtkFiltersGenericModule.h" // For export macro
87
88#define VTK_SCALE_BY_SCALAR 0
89#define VTK_SCALE_BY_VECTOR 1
90#define VTK_SCALE_BY_VECTORCOMPONENTS 2
91#define VTK_DATA_SCALING_OFF 3
92
93#define VTK_COLOR_BY_SCALE 0
94#define VTK_COLOR_BY_SCALAR 1
95#define VTK_COLOR_BY_VECTOR 2
96
97#define VTK_USE_VECTOR 0
98#define VTK_USE_NORMAL 1
99#define VTK_VECTOR_ROTATION_OFF 2
100
101#define VTK_INDEXING_OFF 0
102#define VTK_INDEXING_BY_SCALAR 1
103#define VTK_INDEXING_BY_VECTOR 2
104
105class VTKFILTERSGENERIC_EXPORT vtkGenericGlyph3DFilter : public vtkPolyDataAlgorithm
106{
107public:
109 void PrintSelf(ostream& os, vtkIndent indent) override;
110
118
122 void SetSourceData(vtkPolyData* pd) { this->SetSourceData(0, pd); }
123
127 void SetSourceData(int id, vtkPolyData* pd);
128
132 vtkPolyData* GetSource(int id = 0);
133
135
138 vtkSetMacro(Scaling, vtkTypeBool);
139 vtkBooleanMacro(Scaling, vtkTypeBool);
140 vtkGetMacro(Scaling, vtkTypeBool);
142
144
147 vtkSetMacro(ScaleMode, int);
148 vtkGetMacro(ScaleMode, int);
156 const char* GetScaleModeAsString();
158
160
163 vtkSetMacro(ColorMode, int);
164 vtkGetMacro(ColorMode, int);
168 const char* GetColorModeAsString();
170
172
175 vtkSetMacro(ScaleFactor, double);
176 vtkGetMacro(ScaleFactor, double);
178
180
183 vtkSetVector2Macro(Range, double);
184 vtkGetVectorMacro(Range, double, 2);
186
188
191 vtkSetMacro(Orient, vtkTypeBool);
192 vtkBooleanMacro(Orient, vtkTypeBool);
193 vtkGetMacro(Orient, vtkTypeBool);
195
197
201 vtkSetMacro(Clamping, vtkTypeBool);
202 vtkBooleanMacro(Clamping, vtkTypeBool);
203 vtkGetMacro(Clamping, vtkTypeBool);
205
207
210 vtkSetMacro(VectorMode, int);
211 vtkGetMacro(VectorMode, int);
215 const char* GetVectorModeAsString();
217
219
224 vtkSetMacro(IndexMode, int);
225 vtkGetMacro(IndexMode, int);
229 const char* GetIndexModeAsString();
231
233
241 vtkBooleanMacro(GeneratePointIds, vtkTypeBool);
243
245
249 vtkSetStringMacro(PointIdsName);
250 vtkGetStringMacro(PointIdsName);
252
254
258 vtkGetStringMacro(InputScalarsSelection);
259 void SelectInputScalars(const char* fieldName) { this->SetInputScalarsSelection(fieldName); }
261
263
267 vtkGetStringMacro(InputVectorsSelection);
268 void SelectInputVectors(const char* fieldName) { this->SetInputVectorsSelection(fieldName); }
270
272
276 vtkGetStringMacro(InputNormalsSelection);
277 void SelectInputNormals(const char* fieldName) { this->SetInputNormalsSelection(fieldName); }
279
280protected:
283
285
289 vtkPolyData** Source; // Geometry to copy to each point
290 vtkTypeBool Scaling; // Determine whether scaling of geometry is performed
291 int ScaleMode; // Scale by scalar value or vector magnitude
292 int ColorMode; // new scalars based on scale, scalar or vector
293 double ScaleFactor; // Scale factor to use to scale geometry
294 double Range[2]; // Range to use to perform scalar scaling
295 vtkTypeBool Orient; // boolean controls whether to "orient" data
296 int VectorMode; // Orient/scale via normal or via vector data
297 vtkTypeBool Clamping; // whether to clamp scale factor
298 int IndexMode; // what to use to index into glyph table
299 vtkTypeBool GeneratePointIds; // produce input points ids for each output point
301
305 vtkSetStringMacro(InputScalarsSelection);
306 vtkSetStringMacro(InputVectorsSelection);
307 vtkSetStringMacro(InputNormalsSelection);
308
309private:
311 void operator=(const vtkGenericGlyph3DFilter&) = delete;
312};
313
318{
319 if (this->ScaleMode == VTK_SCALE_BY_SCALAR)
320 {
321 return "ScaleByScalar";
322 }
323 else if (this->ScaleMode == VTK_SCALE_BY_VECTOR)
324 {
325 return "ScaleByVector";
326 }
327 else
328 {
329 return "DataScalingOff";
330 }
331}
332
337{
338 if (this->ColorMode == VTK_COLOR_BY_SCALAR)
339 {
340 return "ColorByScalar";
341 }
342 else if (this->ColorMode == VTK_COLOR_BY_VECTOR)
343 {
344 return "ColorByVector";
345 }
346 else
347 {
348 return "ColorByScale";
349 }
350}
351
356{
357 if (this->VectorMode == VTK_USE_VECTOR)
358 {
359 return "UseVector";
360 }
361 else if (this->VectorMode == VTK_USE_NORMAL)
362 {
363 return "UseNormal";
364 }
365 else
366 {
367 return "VectorRotationOff";
368 }
369}
370
375{
376 if (this->IndexMode == VTK_INDEXING_OFF)
377 {
378 return "IndexingOff";
379 }
380 else if (this->IndexMode == VTK_INDEXING_BY_SCALAR)
381 {
382 return "IndexingByScalar";
383 }
384 else
385 {
386 return "IndexingByVector";
387 }
388}
389
390#endif
void SelectInputVectors(const char *fieldName)
If you want to use an arbitrary vectors array, then set its name here.
void SelectInputNormals(const char *fieldName)
If you want to use an arbitrary normals array, then set its name here.
~vtkGenericGlyph3DFilter() override
void SetScaleModeToScaleByScalar()
Either scale by scalar or by vector/normal magnitude.
virtual void SetInputVectorsSelection(const char *)
virtual void SetVectorMode(int)
Specify whether to use vector or normal to perform vector operations.
void SetScaleModeToScaleByVector()
Either scale by scalar or by vector/normal magnitude.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkPolyData * GetSource(int id=0)
Get a pointer to a source object at a specified table location.
void SetVectorModeToUseVector()
Specify whether to use vector or normal to perform vector operations.
const char * GetScaleModeAsString()
Return the method of scaling as a descriptive character string.
void SetIndexModeToVector()
Index into table of sources by scalar, by vector/normal magnitude, or no indexing.
void SetColorModeToColorByVector()
Either color by scale, scalar or by vector/normal magnitude.
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
void SetSourceData(vtkPolyData *pd)
Set the source to use for the glyph.
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
virtual void SetIndexMode(int)
Index into table of sources by scalar, by vector/normal magnitude, or no indexing.
const char * GetColorModeAsString()
Return the method of coloring as a descriptive character string.
virtual void SetScaleMode(int)
Either scale by scalar or by vector/normal magnitude.
void SetColorModeToColorByScalar()
Either color by scale, scalar or by vector/normal magnitude.
void SetColorModeToColorByScale()
Either color by scale, scalar or by vector/normal magnitude.
void SetIndexModeToScalar()
Index into table of sources by scalar, by vector/normal magnitude, or no indexing.
int FillInputPortInformation(int, vtkInformation *) override
Fill the input port information objects for this algorithm.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void SetInputScalarsSelection(const char *)
void SetIndexModeToOff()
Index into table of sources by scalar, by vector/normal magnitude, or no indexing.
virtual void SetColorMode(int)
Either color by scale, scalar or by vector/normal magnitude.
static vtkGenericGlyph3DFilter * New()
Construct object with scaling on, scaling mode is by scalar value, scale factor = 1....
const char * GetVectorModeAsString()
Return the vector mode as a character string.
void SetSourceData(int id, vtkPolyData *pd)
Specify a source object at a specified table location.
virtual void SetInputNormalsSelection(const char *)
void SetVectorModeToUseNormal()
Specify whether to use vector or normal to perform vector operations.
void SelectInputScalars(const char *fieldName)
If you want to use an arbitrary scalars array, then set its name here.
const char * GetIndexModeAsString()
Return the index mode as a character string.
void SetVectorModeToVectorRotationOff()
Specify whether to use vector or normal to perform vector operations.
void SetScaleModeToScaleByVectorComponents()
Either scale by scalar or by vector/normal magnitude.
void SetScaleModeToDataScalingOff()
Either scale by scalar or by vector/normal magnitude.
a simple class to control print indentation
Definition vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:91
int vtkTypeBool
Definition vtkABI.h:69
#define VTK_COLOR_BY_VECTOR
#define VTK_SCALE_BY_SCALAR
#define VTK_INDEXING_BY_SCALAR
#define VTK_DATA_SCALING_OFF
#define VTK_VECTOR_ROTATION_OFF
#define VTK_COLOR_BY_SCALAR
#define VTK_USE_VECTOR
#define VTK_USE_NORMAL
#define VTK_INDEXING_BY_VECTOR
#define VTK_SCALE_BY_VECTOR
#define VTK_INDEXING_OFF
#define VTK_COLOR_BY_SCALE
#define VTK_SCALE_BY_VECTORCOMPONENTS