VTK  9.7.1
vtkOpenGLES30PolyDataMapper2D.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
20 #ifndef vtkOpenGLES30PolyDataMapper2D_h
21 #define vtkOpenGLES30PolyDataMapper2D_h
22 
24 
25 #include "vtkOpenGLVertexBufferObjectGroup.h" // for ivar
26 #include "vtkRenderingOpenGL2Module.h" // for export macro
27 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
28 
29 VTK_ABI_NAMESPACE_BEGIN
31 
32 class VTKRENDERINGOPENGL2_EXPORT VTK_MARSHALAUTO vtkOpenGLES30PolyDataMapper2D
34 {
35 public:
40  void PrintSelf(ostream& os, vtkIndent indent) override;
41 
42  // NOLINTNEXTLINE(readability-enum-initial-value)
44  {
45  PrimitiveStart = 0,
46  PrimitivePoints = 0,
50  PrimitiveEnd
51  };
52 
56  void RenderOverlay(vtkViewport* viewport, vtkActor2D* actor) override;
57 
63  void ReleaseGraphicsResources(vtkWindow*) override;
64 
65 protected:
68 
72  void BuildShaders(std::string& VertexCode, std::string& fragmentCode, std::string& geometryCode,
73  vtkViewport* ren, vtkActor2D* act) override;
74 
78  void ReplaceShaderPointSize(std::string& VSSource, vtkViewport* ren, vtkActor2D* act);
79 
84  void ReplaceShaderWideLines(std::string& VSSource, vtkViewport* ren, vtkActor2D* act);
85 
89  void UpdateShaders(vtkOpenGLHelper& cellBO, vtkViewport* viewport, vtkActor2D* act) override;
90 
95  vtkOpenGLHelper& cellBO, vtkViewport* viewport, vtkActor2D* act) override;
96 
100  void UpdateVBO(vtkActor2D* act, vtkViewport* viewport);
101 
102  std::vector<unsigned int> PrimitiveIndexArrays[PrimitiveEnd];
103  vtkNew<vtkOpenGLVertexBufferObjectGroup> PrimitiveVBOGroup[PrimitiveEnd];
104  PrimitiveTypes CurrentDrawCallPrimtiveType = PrimitiveEnd;
105 
106 private:
108  void operator=(const vtkOpenGLES30PolyDataMapper2D&) = delete;
109 };
110 
111 #define vtkOpenGLES30PolyDataMapper2D_OVERRIDE_ATTRIBUTES \
112  vtkOpenGLES30PolyDataMapper2D::CreateOverrideAttributes()
113 VTK_ABI_NAMESPACE_END
114 #endif
Attribute for vtkObjectFactory overrides.
virtual void UpdateShaders(vtkOpenGLHelper &cellBO, vtkViewport *viewport, vtkActor2D *act)
Determine what shader to use and compile/link it.
abstract specification for Viewports
Definition: vtkViewport.h:46
void UpdateVBO(vtkActor2D *act, vtkViewport *viewport)
Update the scene when necessary.
a actor that draws 2D data
Definition: vtkActor2D.h:35
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
void RenderOverlay(vtkViewport *viewport, vtkActor2D *actor) override
Actually draw the poly data.
a simple class to control print indentation
Definition: vtkIndent.h:28
#define VTK_NEWINSTANCE
static vtkOverrideAttribute * CreateOverrideAttributes()
2D PolyData support for OpenGL ES 3.0
virtual void SetMapperShaderParameters(vtkOpenGLHelper &cellBO, vtkViewport *viewport, vtkActor2D *act)
Set the shader parameters related to the mapper/input data, called by UpdateShaders.
#define VTK_MARSHALAUTO
virtual void BuildShaders(std::string &VertexCode, std::string &fragmentCode, std::string &geometryCode, vtkViewport *ren, vtkActor2D *act)
Build the shader source code.
2D PolyData support for OpenGL
static vtkOpenGLPolyDataMapper2D * New()
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this mapper.