VTK  9.6.1
vtkGlyph3D.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
73
74#ifndef vtkGlyph3D_h
75#define vtkGlyph3D_h
76
77#include "vtkFiltersCoreModule.h" // For export macro
79#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
80
81#define VTK_SCALE_BY_SCALAR 0
82#define VTK_SCALE_BY_VECTOR 1
83#define VTK_SCALE_BY_VECTORCOMPONENTS 2
84#define VTK_DATA_SCALING_OFF 3
85
86#define VTK_COLOR_BY_SCALE 0
87#define VTK_COLOR_BY_SCALAR 1
88#define VTK_COLOR_BY_VECTOR 2
89
90#define VTK_USE_VECTOR 0
91#define VTK_USE_NORMAL 1
92#define VTK_VECTOR_ROTATION_OFF 2
93#define VTK_FOLLOW_CAMERA_DIRECTION 3
94
95#define VTK_INDEXING_OFF 0
96#define VTK_INDEXING_BY_SCALAR 1
97#define VTK_INDEXING_BY_VECTOR 2
98
99VTK_ABI_NAMESPACE_BEGIN
100class vtkTransform;
101
102class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkGlyph3D : public vtkPolyDataAlgorithm
103{
104public:
106 void PrintSelf(ostream& os, vtkIndent indent) override;
107
114 static vtkGlyph3D* New();
115
122 void SetSourceData(vtkPolyData* pd) { this->SetSourceData(0, pd); }
123
130 void SetSourceData(int id, vtkPolyData* pd);
131
133
138 void SetSourceConnection(int id, vtkAlgorithmOutput* algOutput);
140 {
141 this->SetSourceConnection(0, algOutput);
142 }
143
144
148 vtkPolyData* GetSource(int id = 0);
149
151
154 vtkSetMacro(Scaling, vtkTypeBool);
155 vtkBooleanMacro(Scaling, vtkTypeBool);
156 vtkGetMacro(Scaling, vtkTypeBool);
158
160
163 vtkSetMacro(ScaleMode, int);
164 vtkGetMacro(ScaleMode, int);
172 const char* GetScaleModeAsString();
174
176
179 vtkSetMacro(ColorMode, int);
180 vtkGetMacro(ColorMode, int);
184 const char* GetColorModeAsString();
186
188
191 vtkSetMacro(ScaleFactor, double);
192 vtkGetMacro(ScaleFactor, double);
194
196
199 vtkSetVector2Macro(Range, double);
200 vtkGetVectorMacro(Range, double, 2);
202
204
207 vtkSetMacro(Orient, vtkTypeBool);
208 vtkBooleanMacro(Orient, vtkTypeBool);
209 vtkGetMacro(Orient, vtkTypeBool);
211
213
217 vtkSetMacro(Clamping, vtkTypeBool);
218 vtkBooleanMacro(Clamping, vtkTypeBool);
219 vtkGetMacro(Clamping, vtkTypeBool);
221
223
226 vtkSetMacro(VectorMode, int);
227 vtkGetMacro(VectorMode, int);
232 const char* GetVectorModeAsString();
234
236
240 vtkSetVectorMacro(FollowedCameraPosition, double, 3);
241 vtkGetVectorMacro(FollowedCameraPosition, double, 3);
243
245
248 vtkSetVectorMacro(FollowedCameraViewUp, double, 3);
249 vtkGetVectorMacro(FollowedCameraViewUp, double, 3);
251
253
260 vtkSetMacro(IndexMode, int);
261 vtkGetMacro(IndexMode, int);
265 const char* GetIndexModeAsString();
267
269
277 vtkBooleanMacro(GeneratePointIds, vtkTypeBool);
279
281
285 vtkSetStringMacro(PointIdsName);
286 vtkGetStringMacro(PointIdsName);
288
290
297 vtkBooleanMacro(FillCellData, vtkTypeBool);
299
304 virtual int IsPointVisible(vtkDataSet*, vtkIdType) { return 1; }
305
307
313 vtkGetObjectMacro(SourceTransform, vtkTransform);
315
320
322
327 vtkSetMacro(OutputPointsPrecision, int);
328 vtkGetMacro(OutputPointsPrecision, int);
330
331protected:
333 ~vtkGlyph3D() override;
334
338
340
342
347 virtual bool Execute(vtkDataSet* input, vtkInformationVector* sourceVector, vtkPolyData* output);
348 virtual bool Execute(vtkDataSet* input, vtkInformationVector* sourceVector, vtkPolyData* output,
349 vtkDataArray* inSScalars, vtkDataArray* inVectors);
351
352 vtkPolyData** Source; // Geometry to copy to each point
353 vtkTypeBool Scaling; // Determine whether scaling of geometry is performed
354 int ScaleMode; // Scale by scalar value or vector magnitude
355 int ColorMode; // new scalars based on scale, scalar or vector
356 double ScaleFactor; // Scale factor to use to scale geometry
357 double Range[2]; // Range to use to perform scalar scaling
358 int Orient; // boolean controls whether to "orient" data
359 int VectorMode; // Orient/scale via normal or via vector data
360 double
361 FollowedCameraPosition[3]; // glyphs face towards this point in VTK_FOLLOW_CAMERA_DIRECTION mode
362 double FollowedCameraViewUp[3]; // glyph up direction in VTK_FOLLOW_CAMERA_DIRECTION mode
363 vtkTypeBool Clamping; // whether to clamp scale factor
364 int IndexMode; // what to use to index into glyph table
365 vtkTypeBool GeneratePointIds; // produce input points ids for each output point
366 vtkTypeBool FillCellData; // whether to fill output cell data
370
371private:
372 vtkGlyph3D(const vtkGlyph3D&) = delete;
373 void operator=(const vtkGlyph3D&) = delete;
374};
375
380{
381 if (this->ScaleMode == VTK_SCALE_BY_SCALAR)
382 {
383 return "ScaleByScalar";
384 }
385 else if (this->ScaleMode == VTK_SCALE_BY_VECTOR)
386 {
387 return "ScaleByVector";
388 }
389 else
390 {
391 return "DataScalingOff";
392 }
393}
394
399{
400 if (this->ColorMode == VTK_COLOR_BY_SCALAR)
401 {
402 return "ColorByScalar";
403 }
404 else if (this->ColorMode == VTK_COLOR_BY_VECTOR)
405 {
406 return "ColorByVector";
407 }
408 else
409 {
410 return "ColorByScale";
411 }
412}
413
418{
419 if (this->VectorMode == VTK_USE_VECTOR)
420 {
421 return "UseVector";
422 }
423 else if (this->VectorMode == VTK_USE_NORMAL)
424 {
425 return "UseNormal";
426 }
427 else if (this->VectorMode == VTK_FOLLOW_CAMERA_DIRECTION)
428 {
429 return "FollowCameraDirection";
430 }
431 else
432 {
433 return "VectorRotationOff";
434 }
435}
436
441{
442 if (this->IndexMode == VTK_INDEXING_OFF)
443 {
444 return "IndexingOff";
445 }
446 else if (this->IndexMode == VTK_INDEXING_BY_SCALAR)
447 {
448 return "IndexingByScalar";
449 }
450 else
451 {
452 return "IndexingByVector";
453 }
454}
455
456VTK_ABI_NAMESPACE_END
457#endif
Proxy object to connect input/output ports.
abstract class to specify dataset behavior
Definition vtkDataSet.h:57
void SetIndexModeToScalar()
Index into table of sources by scalar, by vector/normal magnitude, or no indexing.
Definition vtkGlyph3D.h:262
virtual void SetIndexMode(int)
Index into table of sources by scalar, by vector/normal magnitude, or no indexing.
void SetSourceData(int id, vtkPolyData *pd)
Specify a source object at a specified table location.
void SetScaleModeToScaleByVector()
Either scale by scalar or by vector/normal magnitude.
Definition vtkGlyph3D.h:166
double FollowedCameraPosition[3]
Definition vtkGlyph3D.h:361
int OutputPointsPrecision
Definition vtkGlyph3D.h:369
void SetVectorModeToUseNormal()
Specify whether to use vector or normal to perform vector operations.
Definition vtkGlyph3D.h:229
const char * GetVectorModeAsString()
Return the vector mode as a character string.
Definition vtkGlyph3D.h:417
void SetScaleModeToScaleByVectorComponents()
Either scale by scalar or by vector/normal magnitude.
Definition vtkGlyph3D.h:167
void SetIndexModeToOff()
Index into table of sources by scalar, by vector/normal magnitude, or no indexing.
Definition vtkGlyph3D.h:264
void SetScaleModeToScaleByScalar()
Either scale by scalar or by vector/normal magnitude.
Definition vtkGlyph3D.h:165
void SetColorModeToColorByScalar()
Either color by scale, scalar or by vector/normal magnitude.
Definition vtkGlyph3D.h:182
void SetSourceTransform(vtkTransform *)
When set, this is use to transform the source polydata before using it to generate the glyph.
const char * GetIndexModeAsString()
Return the index mode as a character string.
Definition vtkGlyph3D.h:440
vtkTypeBool Scaling
Definition vtkGlyph3D.h:353
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
double FollowedCameraViewUp[3]
Definition vtkGlyph3D.h:362
const char * GetScaleModeAsString()
Return the method of scaling as a descriptive character string.
Definition vtkGlyph3D.h:379
double Range[2]
Definition vtkGlyph3D.h:357
void SetVectorModeToUseVector()
Specify whether to use vector or normal to perform vector operations.
Definition vtkGlyph3D.h:228
void SetScaleModeToDataScalingOff()
Either scale by scalar or by vector/normal magnitude.
Definition vtkGlyph3D.h:171
vtkMTimeType GetMTime() override
Overridden to include SourceTransform's MTime.
virtual int IsPointVisible(vtkDataSet *, vtkIdType)
This can be overwritten by subclass to return 0 when a point is blanked.
Definition vtkGlyph3D.h:304
const char * GetColorModeAsString()
Return the method of coloring as a descriptive character string.
Definition vtkGlyph3D.h:398
void SetSourceConnection(int id, vtkAlgorithmOutput *algOutput)
Specify a source object at a specified table location.
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.
vtkTypeBool Clamping
Definition vtkGlyph3D.h:363
void SetColorModeToColorByScale()
Either color by scale, scalar or by vector/normal magnitude.
Definition vtkGlyph3D.h:181
virtual bool Execute(vtkDataSet *input, vtkInformationVector *sourceVector, vtkPolyData *output, vtkDataArray *inSScalars, vtkDataArray *inVectors)
Method called in RequestData() to do the actual data processing.
void SetColorModeToColorByVector()
Either color by scale, scalar or by vector/normal magnitude.
Definition vtkGlyph3D.h:183
vtkTypeBool FillCellData
Definition vtkGlyph3D.h:366
vtkPolyData ** Source
Definition vtkGlyph3D.h:352
virtual void SetVectorMode(int)
Specify whether to use vector or normal to perform vector operations.
void SetSourceConnection(vtkAlgorithmOutput *algOutput)
Specify a source object at a specified table location.
Definition vtkGlyph3D.h:139
virtual void SetScaleMode(int)
Either scale by scalar or by vector/normal magnitude.
~vtkGlyph3D() override
int FillInputPortInformation(int, vtkInformation *) override
vtkPolyData * GetSource(int idx, vtkInformationVector *sourceInfo)
void SetVectorModeToFollowCameraDirection()
Specify whether to use vector or normal to perform vector operations.
Definition vtkGlyph3D.h:231
char * PointIdsName
Definition vtkGlyph3D.h:367
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
double ScaleFactor
Definition vtkGlyph3D.h:356
vtkTransform * SourceTransform
Definition vtkGlyph3D.h:368
void SetIndexModeToVector()
Index into table of sources by scalar, by vector/normal magnitude, or no indexing.
Definition vtkGlyph3D.h:263
void SetSourceData(vtkPolyData *pd)
Set the source to use for the glyph.
Definition vtkGlyph3D.h:122
void SetVectorModeToVectorRotationOff()
Specify whether to use vector or normal to perform vector operations.
Definition vtkGlyph3D.h:230
vtkTypeBool GeneratePointIds
Definition vtkGlyph3D.h:365
virtual bool Execute(vtkDataSet *input, vtkInformationVector *sourceVector, vtkPolyData *output)
Method called in RequestData() to do the actual data processing.
static vtkGlyph3D * New()
Construct object with scaling on, scaling mode is by scalar value, scale factor = 1....
virtual void SetColorMode(int)
Either color by scale, scalar or by vector/normal magnitude.
a simple class to control print indentation
Definition vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:72
describes linear transformations via a 4x4 matrix
int vtkTypeBool
Definition vtkABI.h:64
#define vtkDataArray
#define VTK_COLOR_BY_VECTOR
Definition vtkGlyph3D.h:88
#define VTK_FOLLOW_CAMERA_DIRECTION
Definition vtkGlyph3D.h:93
#define VTK_SCALE_BY_SCALAR
Definition vtkGlyph3D.h:81
#define VTK_INDEXING_BY_SCALAR
Definition vtkGlyph3D.h:96
#define VTK_DATA_SCALING_OFF
Definition vtkGlyph3D.h:84
#define VTK_VECTOR_ROTATION_OFF
Definition vtkGlyph3D.h:92
#define VTK_COLOR_BY_SCALAR
Definition vtkGlyph3D.h:87
#define VTK_USE_VECTOR
Definition vtkGlyph3D.h:90
#define VTK_USE_NORMAL
Definition vtkGlyph3D.h:91
#define VTK_INDEXING_BY_VECTOR
Definition vtkGlyph3D.h:97
#define VTK_SCALE_BY_VECTOR
Definition vtkGlyph3D.h:82
#define VTK_INDEXING_OFF
Definition vtkGlyph3D.h:95
#define VTK_COLOR_BY_SCALE
Definition vtkGlyph3D.h:86
#define VTK_SCALE_BY_VECTORCOMPONENTS
Definition vtkGlyph3D.h:83
int vtkIdType
Definition vtkType.h:368
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:323
#define VTK_MARSHALAUTO