VTK  9.6.20260112
vtkOpenGLGlyph3DMapper.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
15
16#ifndef vtkOpenGLGlyph3DMapper_h
17#define vtkOpenGLGlyph3DMapper_h
18
19#include "vtkGlyph3DMapper.h"
20
21#include "vtkColor.h" // for ivar
22#include "vtkDataObjectTree.h" // for arg
23#include "vtkNew.h" // For vtkNew
24#include "vtkRenderingOpenGL2Module.h" // For export macro
25#include "vtkVector.h" // for ivar
26#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
27
28#include <stack> // for ivar
29
30VTK_ABI_NAMESPACE_BEGIN
32class vtkBitArray;
33
34class VTKRENDERINGOPENGL2_EXPORT VTK_MARSHALAUTO vtkOpenGLGlyph3DMapper : public vtkGlyph3DMapper
35{
36public:
39 void PrintSelf(ostream& os, vtkIndent indent) override;
40
45 void Render(vtkRenderer* ren, vtkActor* a) override;
46
52 void ReleaseGraphicsResources(vtkWindow* window) override;
53
55
60
64 void SetNumberOfLOD(vtkIdType nb) override;
65 vtkIdType GetNumberOfLOD() { return this->LODs.size(); }
66
76 vtkIdType index, float distance, float targetReduction) override;
77
78 // Set, Get, and GetNumberOf are needed to auto generate (de)serialization code.
79 void SetLODDistance(vtkIdType index, float distance);
80 void SetLODTargetReduction(vtkIdType index, float targetReduction);
83 int GetNumberOfLODDistances() { return static_cast<int>(this->LODs.size()); }
84 int GetNumberOfLODTargetReductions() { return static_cast<int>(this->LODs.size()); }
86
87protected:
90
95
101
103
110 vtkRenderer* renderer, vtkActor* actor, vtkDataObject* dobjTree, unsigned int& flatIndex);
111
113
114 class vtkOpenGLGlyph3DMapperEntry;
115 class vtkOpenGLGlyph3DMapperSubArray;
116 class vtkOpenGLGlyph3DMapperArray;
117 vtkOpenGLGlyph3DMapperArray* GlyphValues; // array of value for datasets
118
122 virtual void RebuildStructures(vtkOpenGLGlyph3DMapperSubArray* subarray, vtkIdType numPts,
123 vtkActor* actor, vtkDataSet* dataset, vtkBitArray* maskArray);
124
125 vtkMTimeType BlockMTime; // Last time BlockAttributes was modified.
126
127private:
129 void operator=(const vtkOpenGLGlyph3DMapper&) = delete;
130
131 struct RenderBlockState
132 {
133 std::stack<double> Opacity;
134 std::stack<bool> Visibility;
135 std::stack<bool> Pickability;
136 std::stack<vtkColor3d> Color;
137 };
138 RenderBlockState BlockState;
139};
140
141VTK_ABI_NAMESPACE_END
142#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:151
dynamic, self-adjusting array of bits
Definition vtkBitArray.h:31
general representation of visualization data
abstract class to specify dataset behavior
Definition vtkDataSet.h:166
std::vector< std::pair< float, float > > LODs
a simple class to control print indentation
Definition vtkIndent.h:108
PolyDataMapper using OpenGL to render.
vtkIdType GetMaxNumberOfLOD() override
Get the maximum number of LOD.
void Render(vtkRenderer *ren, vtkActor *a) override
Method initiates the mapping process.
void SetLODDistance(vtkIdType index, float distance)
Get the maximum number of LOD.
float GetLODDistance(vtkIdType index)
Get the maximum number of LOD.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetLODDistanceAndTargetReduction(vtkIdType index, float distance, float targetReduction) override
Configure LODs.
float GetLODTargetReduction(vtkIdType index)
Get the maximum number of LOD.
~vtkOpenGLGlyph3DMapper() override
int GetNumberOfLODTargetReductions()
Get the maximum number of LOD.
virtual void Render(vtkRenderer *, vtkActor *, vtkDataSet *)
Render setup.
void RenderChildren(vtkRenderer *renderer, vtkActor *actor, vtkDataObject *dobjTree, unsigned int &flatIndex)
Renders children of the given dobjTree recursively.
void CopyInformationToSubMapper(vtkOpenGLGlyph3DHelper *)
Send mapper ivars to sub-mapper.
void SetNumberOfLOD(vtkIdType nb) override
Set the number of LOD.
virtual void RebuildStructures(vtkOpenGLGlyph3DMapperSubArray *subarray, vtkIdType numPts, vtkActor *actor, vtkDataSet *dataset, vtkBitArray *maskArray)
Build data structures associated with.
static vtkOpenGLGlyph3DMapper * New()
vtkOpenGLGlyph3DMapperArray * GlyphValues
void ReleaseGraphicsResources(vtkWindow *window) override
Release any graphics resources that are being consumed by this mapper.
vtkIdType GetNumberOfLOD()
Get the maximum number of LOD.
int GetNumberOfLODDistances()
Get the maximum number of LOD.
void SetLODTargetReduction(vtkIdType index, float targetReduction)
Get the maximum number of LOD.
abstract specification for renderers
window superclass for vtkRenderWindow
Definition vtkWindow.h:48
int vtkIdType
Definition vtkType.h:368
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:323
#define VTK_MARSHALAUTO