VTK  9.7.1
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
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 
30 VTK_ABI_NAMESPACE_BEGIN
32 class vtkBitArray;
34 
35 class VTKRENDERINGOPENGL2_EXPORT VTK_MARSHALAUTO vtkOpenGLGlyph3DMapper : public vtkGlyph3DMapper
36 {
37 public:
38  static vtkOpenGLGlyph3DMapper* New();
40  static vtkOverrideAttribute* CreateOverrideAttributes();
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 
62  vtkIdType GetMaxNumberOfLOD() override;
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);
84  float GetLODDistance(vtkIdType index);
85  float GetLODTargetReduction(vtkIdType index);
86  int GetNumberOfLODDistances() { return static_cast<int>(this->LODs.size()); }
87  int GetNumberOfLODTargetReductions() { return static_cast<int>(this->LODs.size()); }
89 
90 protected:
92  ~vtkOpenGLGlyph3DMapper() override;
93 
97  virtual void Render(vtkRenderer*, vtkActor*, vtkDataSet*);
98 
103  void CopyInformationToSubMapper(vtkOpenGLGlyph3DHelper*);
104 
105  void SetupColorMapper();
106 
112  void RenderChildren(
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 
130 private:
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 
149  void ClearUnusedCachedEntries(vtkDataObject* inputDO);
150 };
151 
152 #define vtkOpenGLGlyph3DMapper_OVERRIDE_ATTRIBUTES \
153  vtkOpenGLGlyph3DMapper::CreateOverrideAttributes()
154 VTK_ABI_NAMESPACE_END
155 #endif
vtkOpenGLGlyph3D on the GPU.
Attribute for vtkObjectFactory overrides.
static vtkGlyph3DMapper * New()
void Render(vtkRenderer *ren, vtkActor *act) override
All the work is done is derived classes.
int GetNumberOfLODDistances()
Get the maximum number of LOD.
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:41
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:318
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
virtual void SetLODDistanceAndTargetReduction(vtkIdType index, float distance, float targetReduction)
Configure LODs.
abstract specification for renderers
Definition: vtkRenderer.h:63
int vtkIdType
Definition: vtkType.h:363
vtkGlyph3D on the GPU.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:41
virtual vtkIdType GetMaxNumberOfLOD()
Get the maximum number of LOD.
a simple class to control print indentation
Definition: vtkIndent.h:28
vtkOpenGLGlyph3DMapperArray * GlyphValues
virtual void SetNumberOfLOD(vtkIdType nb)
Set the number of LOD.
int GetNumberOfLODTargetReductions()
Get the maximum number of LOD.
PolyDataMapper using OpenGL to render.
#define VTK_NEWINSTANCE
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:77
dynamic, self-adjusting array of bits
Definition: vtkBitArray.h:32
#define VTK_MARSHALAUTO
vtkIdType GetNumberOfLOD()
Get the maximum number of LOD.
general representation of visualization data
Definition: vtkDataObject.h:55
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this mapper.
Definition: vtkMapper.h:105