VTK  9.6.20260201
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
130
131#ifndef vtkGlyph3DMapper_h
132#define vtkGlyph3DMapper_h
133
134#include "vtkGlyph3D.h" // for the constants (VTK_SCALE_BY_SCALAR, ...).
135#include "vtkMapper.h"
136#include "vtkRenderingCoreModule.h" // For export macro
137#include "vtkWeakPointer.h" // needed for vtkWeakPointer.
138#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
139
140VTK_ABI_NAMESPACE_BEGIN
143
144class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkGlyph3DMapper : public vtkMapper
145{
146public:
149 void PrintSelf(ostream& os, vtkIndent indent) override;
150
159
165 void SetSourceConnection(int idx, vtkAlgorithmOutput* algOutput);
167 {
168 this->SetSourceConnection(0, algOutput);
169 }
170
177
181 void SetSourceData(int idx, vtkPolyData* pd);
182
193
201
205 vtkPolyData* GetSource(int idx = 0);
206
212
214
219 vtkSetMacro(Scaling, bool);
220 vtkBooleanMacro(Scaling, bool);
221 vtkGetMacro(Scaling, bool);
223
225
231 vtkSetMacro(ScaleMode, int);
232 vtkGetMacro(ScaleMode, int);
234
236
240 vtkSetMacro(ScaleFactor, double);
241 vtkGetMacro(ScaleFactor, double);
243
250
254 const char* GetScaleModeAsString();
255
257
260 vtkSetVector2Macro(Range, double);
261 vtkGetVectorMacro(Range, double, 2);
263
265
270 vtkSetMacro(Orient, bool);
271 vtkGetMacro(Orient, bool);
272 vtkBooleanMacro(Orient, bool);
274
276
281 vtkSetClampMacro(OrientationMode, int, DIRECTION, QUATERNION);
282 vtkGetMacro(OrientationMode, int);
288
295
297
300 vtkSetMacro(Clamping, bool);
301 vtkGetMacro(Clamping, bool);
302 vtkBooleanMacro(Clamping, bool);
304
306
312 vtkSetMacro(SourceIndexing, bool);
313 vtkGetMacro(SourceIndexing, bool);
314 vtkBooleanMacro(SourceIndexing, bool);
316
318
323 vtkSetMacro(UseSourceTableTree, bool);
324 vtkGetMacro(UseSourceTableTree, bool);
325 vtkBooleanMacro(UseSourceTableTree, bool);
326
328
332 vtkSetMacro(UseSelectionIds, bool);
333 vtkBooleanMacro(UseSelectionIds, bool);
334 vtkGetMacro(UseSelectionIds, bool);
336
340 double* GetBounds() override;
341
345 void GetBounds(double bounds[6]) override;
346
350 void Render(vtkRenderer* ren, vtkActor* act) override;
351
353
361 vtkSetMacro(Masking, bool);
362 vtkGetMacro(Masking, bool);
363 vtkBooleanMacro(Masking, bool);
365
372 void SetMaskArray(const char* maskarrayname);
373
386 void SetMaskArray(int fieldAttributeType);
387
403 void SetOrientationArray(const char* orientationarrayname);
404
426 void SetOrientationArray(int fieldAttributeType);
427
433 void SetScaleArray(const char* scalarsarrayname);
434
440 void SetScaleArray(int fieldAttributeType);
441
448 void SetSourceIndexArray(const char* arrayname);
449
456 void SetSourceIndexArray(int fieldAttributeType);
457
467 void SetSelectionIdArray(const char* selectionIdArrayName);
468
478 void SetSelectionIdArray(int fieldAttributeType);
479
481
486 vtkSetMacro(SelectionColorId, unsigned int);
487 vtkGetMacro(SelectionColorId, unsigned int);
489
491
503
505
509 vtkSetMacro(CullingAndLOD, bool);
510 vtkGetMacro(CullingAndLOD, bool);
511
519
525 virtual void SetNumberOfLOD(vtkIdType vtkNotUsed(nb)) {}
526
538 vtkIdType vtkNotUsed(index), float vtkNotUsed(distance), float vtkNotUsed(targetReduction))
539 {
540 }
541
546 vtkSetMacro(LODColoring, bool);
547 vtkGetMacro(LODColoring, bool);
549
556 bool GetSupportsSelection() override { return true; }
557
558protected:
561
563 vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo);
564
565 int FillInputPortInformation(int port, vtkInformation* info) override;
566
569
571
581
583 bool Scaling; // Determine whether scaling of geometry is performed
584 double ScaleFactor; // Scale factor to use to scale geometry
585 int ScaleMode; // Scale by scalar value or vector magnitude
586
587 double Range[2]; // Range to use to perform scalar scaling
588 bool Orient; // boolean controls whether to "orient" data
589 bool Clamping; // whether to clamp scale factor
590 bool SourceIndexing; // Enable/disable indexing into the glyph table
591 bool UseSelectionIds; // Enable/disable custom pick ids
592 bool Masking; // Enable/disable masking.
594
595 bool UseSourceTableTree; // Map DataObjectTree glyph source into table
596
597 unsigned int SelectionColorId;
598
599 bool CullingAndLOD = false; // Disable culling
600 std::vector<std::pair<float, float>> LODs;
601 bool LODColoring = false;
602
603private:
604 vtkGlyph3DMapper(const vtkGlyph3DMapper&) = delete;
605 void operator=(const vtkGlyph3DMapper&) = delete;
606
610 bool GetBoundsInternal(vtkDataSet* ds, double ds_bounds[6]);
611};
612
613VTK_ABI_NAMESPACE_END
614#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:151
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:166
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:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
concrete dataset represents vertices, lines, polygons, and triangle strips
abstract specification for renderers
dynamic, self-adjusting array of unsigned char
#define vtkDataArray
int vtkIdType
Definition vtkType.h:354
#define VTK_MARSHAL_EXCLUDE_REASON_IS_REDUNDANT
#define VTK_MARSHALAUTO
#define VTK_MARSHALEXCLUDE(reason)