VTK  9.6.20260204
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;
34
35class VTKRENDERINGOPENGL2_EXPORT VTK_MARSHALAUTO vtkOpenGLGlyph3DMapper : public vtkGlyph3DMapper
36{
37public:
42 void PrintSelf(ostream& os, vtkIndent indent) override;
43
48 void Render(vtkRenderer* ren, vtkActor* a) override;
49
55 void ReleaseGraphicsResources(vtkWindow* window) override;
56
58
63
67 void SetNumberOfLOD(vtkIdType nb) override;
68 vtkIdType GetNumberOfLOD() { return this->LODs.size(); }
69
79 vtkIdType index, float distance, float targetReduction) override;
80
81 // Set, Get, and GetNumberOf are needed to auto generate (de)serialization code.
82 void SetLODDistance(vtkIdType index, float distance);
83 void SetLODTargetReduction(vtkIdType index, float targetReduction);
86 int GetNumberOfLODDistances() { return static_cast<int>(this->LODs.size()); }
87 int GetNumberOfLODTargetReductions() { return static_cast<int>(this->LODs.size()); }
89
90protected:
93
98
104
106
113 vtkRenderer* renderer, vtkActor* actor, vtkDataObject* dobjTree, unsigned int& flatIndex);
114
116
117 class vtkOpenGLGlyph3DMapperEntry;
118 class vtkOpenGLGlyph3DMapperSubArray;
119 class vtkOpenGLGlyph3DMapperArray;
120 vtkOpenGLGlyph3DMapperArray* GlyphValues; // array of value for datasets
121
125 virtual void RebuildStructures(vtkOpenGLGlyph3DMapperSubArray* subarray, vtkIdType numPts,
126 vtkActor* actor, vtkDataSet* dataset, vtkBitArray* maskArray);
127
128 vtkMTimeType BlockMTime; // Last time BlockAttributes was modified.
129
130private:
132 void operator=(const vtkOpenGLGlyph3DMapper&) = delete;
133
134 struct RenderBlockState
135 {
136 std::stack<double> Opacity;
137 std::stack<bool> Visibility;
138 std::stack<bool> Pickability;
139 std::stack<vtkColor3d> Color;
140 };
141 RenderBlockState BlockState;
142};
143
144#define vtkOpenGLGlyph3DMapper_OVERRIDE_ATTRIBUTES \
145 vtkOpenGLGlyph3DMapper::CreateOverrideAttributes()
146VTK_ABI_NAMESPACE_END
147#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.
static vtkOverrideAttribute * CreateOverrideAttributes()
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.
Attribute for vtkObjectFactory overrides.
abstract specification for renderers
window superclass for vtkRenderWindow
Definition vtkWindow.h:61
int vtkIdType
Definition vtkType.h:354
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:309
#define VTK_MARSHALAUTO
#define VTK_NEWINSTANCE