VTK  9.7.1
vtkOpenGLBatchedLabeledDataMapper.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
14 #ifndef vtkOpenGLBatchedLabeledDataMapper_h
15 #define vtkOpenGLBatchedLabeledDataMapper_h
16 
18 #include "vtkNew.h" // For vtkNew
19 #include "vtkRenderingOpenGL2Module.h" // For export macro
20 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
21 
22 VTK_ABI_NAMESPACE_BEGIN
23 class vtkActor;
27 class vtkTextureObject;
28 
29 class VTKRENDERINGOPENGL2_EXPORT VTK_MARSHALAUTO vtkOpenGLBatchedLabeledDataMapper
31 {
32 public:
35  void PrintSelf(ostream& os, vtkIndent indent) override;
36 
38  static vtkOverrideAttribute* CreateOverrideAttributes();
39 
43  void SetLabelTextProperty(vtkTextProperty* p, int type) override;
44 
47  void RenderOpaqueGeometry(vtkViewport* viewport, vtkActor2D* actor) override;
49  void ReleaseGraphicsResources(vtkWindow*) override;
50 
51 protected:
54 
55  void UploadGlyphAtlas(vtkImageData* atlas) override;
56  void ActivateGlyphTexture() override;
57  void DeactivateGlyphTexture() override;
58 
59 private:
61  void operator=(const vtkOpenGLBatchedLabeledDataMapper&) = delete;
62 
63  vtkNew<vtkTextureObject> GlyphsTO;
65  vtkNew<vtkActor> DummyActor;
66 
68 
69  void SetupHelper();
70  bool HelperSetup = false;
71 };
72 
73 #define vtkOpenGLBatchedLabeledDataMapper_OVERRIDE_ATTRIBUTES \
74  vtkOpenGLBatchedLabeledDataMapper::CreateOverrideAttributes()
75 VTK_ABI_NAMESPACE_END
76 
77 #endif
OpenGL rendering window.
Attribute for vtkObjectFactory overrides.
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:41
virtual void UploadGlyphAtlas(vtkImageData *atlas)
Called by BuildLabels when the glyph atlas image has been rebuilt or updated.
draw text labels at dataset points using batch rendering
void SetLabelTextProperty(vtkTextProperty *p) override
Set/Get the text property.
abstract specification for Viewports
Definition: vtkViewport.h:46
a actor that draws 2D data
Definition: vtkActor2D.h:35
void RenderOpaqueGeometry(vtkViewport *, vtkActor2D *) override
No-op: backend subclasses override this to drive the render pipeline.
static vtkBatchedLabeledDataMapper * New()
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 void ActivateGlyphTexture()
Called before and after the helper renders to bind/unbind the atlas texture.
a simple class to control print indentation
Definition: vtkIndent.h:28
OpenGL backend for vtkBatchedLabeledDataMapper.
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
represent text properties.
abstracts an OpenGL texture object.
void ReleaseGraphicsResources(vtkWindow *) override
Releases any GPU resources held by backend subclasses.
#define VTK_MARSHALAUTO
virtual void DeactivateGlyphTexture()