VTK  9.7.20260805
vtkGlyph3DMapper.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
21
22#ifndef vtkGlyph3DMapper_h
23#define vtkGlyph3DMapper_h
24
25#include "vtkGlyph3D.h" // for the constants (VTK_SCALE_BY_SCALAR, ...).
26#include "vtkMapper.h"
27#include "vtkRenderingCoreModule.h" // For export macro
28#include "vtkWeakPointer.h" // needed for vtkWeakPointer.
29#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
30
31VTK_ABI_NAMESPACE_BEGIN
34
35class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkGlyph3DMapper : public vtkMapper
36{
37public:
40 void PrintSelf(ostream& os, vtkIndent indent) override;
41
50
56 void SetSourceConnection(int idx, vtkAlgorithmOutput* algOutput);
58 {
59 this->SetSourceConnection(0, algOutput);
60 }
61
68
72 void SetSourceData(int idx, vtkPolyData* pd);
73
84
92
96 vtkPolyData* GetSource(int idx = 0);
97
103
105
110 vtkSetMacro(Scaling, bool);
111 vtkBooleanMacro(Scaling, bool);
112 vtkGetMacro(Scaling, bool);
114
116
122 vtkSetMacro(ScaleMode, int);
123 vtkGetMacro(ScaleMode, int);
125
127
131 vtkSetMacro(ScaleFactor, double);
132 vtkGetMacro(ScaleFactor, double);
134
141
145 const char* GetScaleModeAsString();
146
148
151 vtkSetVector2Macro(Range, double);
152 vtkGetVectorMacro(Range, double, 2);
154
156
161 vtkSetMacro(Orient, bool);
162 vtkGetMacro(Orient, bool);
163 vtkBooleanMacro(Orient, bool);
165
167
172 vtkSetClampMacro(OrientationMode, int, DIRECTION, QUATERNION);
173 vtkGetMacro(OrientationMode, int);
179
186
188
191 vtkSetMacro(Clamping, bool);
192 vtkGetMacro(Clamping, bool);
193 vtkBooleanMacro(Clamping, bool);
195
197
203 vtkSetMacro(SourceIndexing, bool);
204 vtkGetMacro(SourceIndexing, bool);
205 vtkBooleanMacro(SourceIndexing, bool);
207
209
214 vtkSetMacro(UseSourceTableTree, bool);
215 vtkGetMacro(UseSourceTableTree, bool);
216 vtkBooleanMacro(UseSourceTableTree, bool);
217
219
223 vtkSetMacro(UseSelectionIds, bool);
224 vtkBooleanMacro(UseSelectionIds, bool);
225 vtkGetMacro(UseSelectionIds, bool);
227
231 double* GetBounds() override;
232
236 void GetBounds(double bounds[6]) override;
237
241 void Render(vtkRenderer* ren, vtkActor* act) override;
242
244
252 vtkSetMacro(Masking, bool);
253 vtkGetMacro(Masking, bool);
254 vtkBooleanMacro(Masking, bool);
256
263 void SetMaskArray(const char* maskarrayname);
264
277 void SetMaskArray(int fieldAttributeType);
278
294 void SetOrientationArray(const char* orientationarrayname);
295
317 void SetOrientationArray(int fieldAttributeType);
318
324 void SetScaleArray(const char* scalarsarrayname);
325
331 void SetScaleArray(int fieldAttributeType);
332
339 void SetSourceIndexArray(const char* arrayname);
340
347 void SetSourceIndexArray(int fieldAttributeType);
348
358 void SetSelectionIdArray(const char* selectionIdArrayName);
359
369 void SetSelectionIdArray(int fieldAttributeType);
370
372
377 vtkSetMacro(SelectionColorId, unsigned int);
378 vtkGetMacro(SelectionColorId, unsigned int);
380
382
394
396
400 vtkSetMacro(CullingAndLOD, bool);
401 vtkGetMacro(CullingAndLOD, bool);
402
410
416 virtual void SetNumberOfLOD(vtkIdType vtkNotUsed(nb)) {}
417
429 vtkIdType vtkNotUsed(index), float vtkNotUsed(distance), float vtkNotUsed(targetReduction))
430 {
431 }
432
437 vtkSetMacro(LODColoring, bool);
438 vtkGetMacro(LODColoring, bool);
440
447 bool GetSupportsSelection() override { return true; }
448
449protected:
452
454 vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo);
455
456 int FillInputPortInformation(int port, vtkInformation* info) override;
457
460
462
472
474 bool Scaling; // Determine whether scaling of geometry is performed
475 double ScaleFactor; // Scale factor to use to scale geometry
476 int ScaleMode; // Scale by scalar value or vector magnitude
477
478 double Range[2]; // Range to use to perform scalar scaling
479 bool Orient; // boolean controls whether to "orient" data
480 bool Clamping; // whether to clamp scale factor
481 bool SourceIndexing; // Enable/disable indexing into the glyph table
482 bool UseSelectionIds; // Enable/disable custom pick ids
483 bool Masking; // Enable/disable masking.
485
486 bool UseSourceTableTree; // Map DataObjectTree glyph source into table
487
488 unsigned int SelectionColorId;
489
490 bool CullingAndLOD = false; // Disable culling
491 std::vector<std::pair<float, float>> LODs;
492 bool LODColoring = false;
493
494private:
495 vtkGlyph3DMapper(const vtkGlyph3DMapper&) = delete;
496 void operator=(const vtkGlyph3DMapper&) = delete;
497
501 bool GetBoundsInternal(vtkDataSet* ds, double ds_bounds[6]);
502};
503
504VTK_ABI_NAMESPACE_END
505#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:42
Proxy object to connect input/output ports.
Rendering attributes for a multi-block dataset.
provides implementation for most abstract methods in the superclass vtkCompositeDataSet
general representation of visualization data
abstract class to specify dataset behavior
Definition vtkDataSet.h:56
void SetOrientationModeToQuaternion()
Orientation mode indicates if the OrientationArray provides the direction vector for the orientation ...
virtual void SetScaleMode(int)
Either scale by individual components (SCALE_BY_COMPONENTS) or magnitude (SCALE_BY_MAGNITUDE) of the ...
vtkDataObjectTree * GetSourceTableTree()
Convenience method to get the source table tree, if it exists.
virtual vtkIdType GetMaxNumberOfLOD()
Get the maximum number of LOD.
void SetScaleModeToScaleByVectorComponents()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkGlyph3DMapper() override
virtual void SetLODDistanceAndTargetReduction(vtkIdType index, float distance, float targetReduction)
Configure LODs.
void SetSourceData(int idx, vtkPolyData *pd)
Specify a source object at a specified table location.
void SetMaskArray(const char *maskarrayname)
Set the name of the point array to use as a mask for generating the glyphs.
vtkPolyData * GetSource(int idx, vtkInformationVector *sourceInfo)
vtkDataArray * GetScaleArray(vtkDataSet *input)
Convenience methods to get each of the arrays.
void SetSourceConnection(int idx, vtkAlgorithmOutput *algOutput)
Specify a source object at a specified table location.
double * GetBounds() override
Redefined to take into account the bounds of the scaled glyphs.
void SetScaleModeToScaleByMagnitude()
virtual int RequestUpdateExtent(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
void SetScaleArray(int fieldAttributeType)
Convenience method to set the array to scale with.
vtkDataArray * GetSelectionIdArray(vtkDataSet *input)
Convenience methods to get each of the arrays.
void SetSourceIndexArray(const char *arrayname)
Convenience method to set the array to use as index within the sources.
vtkCompositeDataDisplayAttributes * BlockAttributes
virtual void SetOrientationMode(int)
Orientation mode indicates if the OrientationArray provides the direction vector for the orientation ...
vtkDataArray * GetOrientationArray(vtkDataSet *input)
Convenience methods to get each of the arrays.
void SetInputData(vtkDataObject *)
Assign a data object as input.
void SetScaleModeToNoDataScaling()
const char * GetScaleModeAsString()
void SetOrientationArray(int fieldAttributeType)
Tells the mapper to use an orientation array if Orient is true.
void SetOrientationArray(const char *orientationarrayname)
Tells the mapper to use an orientation array if Orient is true.
void SetSelectionIdArray(int fieldAttributeType)
Convenience method to set the array used for selection IDs.
unsigned int SelectionColorId
void SetSourceConnection(vtkAlgorithmOutput *algOutput)
void SetOrientationModeToDirection()
Orientation mode indicates if the OrientationArray provides the direction vector for the orientation ...
vtkPolyData * GetSourceTable(int idx, vtkInformationVector *sourceInfo)
vtkUnsignedCharArray * GetColors(vtkDataSet *input)
Convenience methods to get each of the arrays.
const char * GetOrientationModeAsString()
Orientation mode indicates if the OrientationArray provides the direction vector for the orientation ...
virtual void SetBlockAttributes(vtkCompositeDataDisplayAttributes *attr)
When the input data object (not the source) is composite data, it is possible to control visibility a...
vtkDataArray * GetSourceIndexArray(vtkDataSet *input)
Convenience methods to get each of the arrays.
std::vector< std::pair< float, float > > LODs
void Render(vtkRenderer *ren, vtkActor *act) override
All the work is done is derived classes.
void SetMaskArray(int fieldAttributeType)
Set the point attribute to use as a mask for generating the glyphs.
vtkPolyData * GetSource(int idx=0)
Get a pointer to a source object at a specified table location.
bool GetSupportsSelection() override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
void SetOrientationModeToRotation()
Orientation mode indicates if the OrientationArray provides the direction vector for the orientation ...
vtkDataArray * GetMaskArray(vtkDataSet *input)
Convenience methods to get each of the arrays.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
void GetBounds(double bounds[6]) override
Same as superclass.
void SetSelectionIdArray(const char *selectionIdArrayName)
Convenience method to set the array used for selection IDs.
virtual void SetNumberOfLOD(vtkIdType nb)
Set the number of LOD.
void SetSourceTableTree(vtkDataObjectTree *tree)
Specify a data object tree that will be used for the source table.
void SetScaleArray(const char *scalarsarrayname)
Convenience method to set the array to scale with.
void SetSourceIndexArray(int fieldAttributeType)
Convenience method to set the array to use as index within the sources.
static vtkGlyph3DMapper * New()
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
abstract specification for renderers
Definition vtkRenderer.h:64
dynamic, self-adjusting array of unsigned char
#define vtkDataArray
int vtkIdType
Definition vtkType.h:363
#define VTK_MARSHAL_EXCLUDE_REASON_IS_REDUNDANT
#define VTK_MARSHALAUTO
#define VTK_MARSHALEXCLUDE(reason)