VTK  9.3.1
vtkOpenGLPolyDataMapper2D.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 #ifndef vtkOpenGLPolyDataMapper2D_h
16 #define vtkOpenGLPolyDataMapper2D_h
17 
18 #include "vtkNew.h" // used for ivars
19 #include "vtkOpenGLHelper.h" // used for ivars
20 #include "vtkPolyDataMapper2D.h"
21 #include "vtkRenderingOpenGL2Module.h" // For export macro
22 #include <map> //for used data arrays & vbos
23 #include <string> // For API.
24 #include <vector> //for ivars
25 
26 VTK_ABI_NAMESPACE_BEGIN
27 class vtkActor2D;
29 class vtkMatrix4x4;
32 class vtkOpenGLHelper;
34 class vtkPoints;
35 class vtkRenderer;
36 class vtkTextureObject;
37 class vtkTransform;
38 
39 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLPolyDataMapper2D : public vtkPolyDataMapper2D
40 {
41 public:
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
49  void RenderOverlay(vtkViewport* viewport, vtkActor2D* actor) override;
50 
56  void ReleaseGraphicsResources(vtkWindow*) override;
57 
58 protected:
60  ~vtkOpenGLPolyDataMapper2D() override;
61 
63 
67  virtual bool GetNeedToRebuildShaders(vtkOpenGLHelper& cellBO, vtkViewport* ren, vtkActor2D* act);
68 
72  virtual void BuildShaders(std::string& VertexCode, std::string& fragmentCode,
73  std::string& geometryCode, vtkViewport* ren, vtkActor2D* act);
74 
78  virtual void UpdateShaders(vtkOpenGLHelper& cellBO, vtkViewport* viewport, vtkActor2D* act);
79 
83  virtual void SetMapperShaderParameters(
84  vtkOpenGLHelper& cellBO, vtkViewport* viewport, vtkActor2D* act);
85 
89  void SetCameraShaderParameters(vtkOpenGLHelper& cellBO, vtkViewport* viewport, vtkActor2D* act);
90 
94  void SetPropertyShaderParameters(vtkOpenGLHelper& cellBO, vtkViewport* viewport, vtkActor2D* act);
95 
100  virtual void ReplaceShaderPicking(std::string& fssource, vtkRenderer* ren, vtkActor2D* act);
101 
105  void UpdateVBO(vtkActor2D* act, vtkViewport* viewport);
106 
107  // The VBO and its layout.
109 
110  // Structures for the various cell types we render.
116 
121 
122  vtkTimeStamp VBOUpdateTime; // When was the VBO updated?
126 
129 
130  // do we have wide lines that require special handling
131  virtual bool HaveWideLines(vtkViewport*, vtkActor2D*);
132 
133  // stores the mapping from vtk cells to gl_PrimitiveId
135 
136 private:
138  void operator=(const vtkOpenGLPolyDataMapper2D&) = delete;
139 };
140 
141 VTK_ABI_NAMESPACE_END
142 #endif
static vtkPolyDataMapper2D * New()
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:30
vtkNew< vtkOpenGLCellToVTKCellMap > CellCellMap
virtual void RenderOverlay(vtkViewport *, vtkActor2D *)
Definition: vtkMapper2D.h:30
abstract specification for Viewports
Definition: vtkViewport.h:44
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a actor that draws 2D data
Definition: vtkActor2D.h:34
record modification and/or execution time
Definition: vtkTimeStamp.h:24
OpenGL rendering utility functions.
abstract specification for renderers
Definition: vtkRenderer.h:61
vtkNew< vtkTransform > VBOTransformInverse
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:49
vtkNew< vtkMatrix4x4 > VBOShiftScale
window superclass for vtkRenderWindow
Definition: vtkWindow.h:27
a simple class to control print indentation
Definition: vtkIndent.h:28
abstracts an OpenGL texture object.
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this mapper.
vtkOpenGLVertexBufferObjectGroup * VBOs
OpenGL buffer object.
manage vertex buffer objects shared within a mapper
2D PolyData support for OpenGL
vtkGenericOpenGLResourceFreeCallback * ResourceCallback
draw vtkPolyData onto the image plane
represent and manipulate 3D points
Definition: vtkPoints.h:28
vtkOpenGLBufferObject * CellScalarBuffer