VTK  9.2.6
vtkOpenGLPolyDataMapper2D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOpenGLPolyDataMapper2D.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
27 #ifndef vtkOpenGLPolyDataMapper2D_h
28 #define vtkOpenGLPolyDataMapper2D_h
29 
30 #include "vtkNew.h" // used for ivars
31 #include "vtkOpenGLHelper.h" // used for ivars
32 #include "vtkPolyDataMapper2D.h"
33 #include "vtkRenderingOpenGL2Module.h" // For export macro
34 #include <map> //for used data arrays & vbos
35 #include <string> // For API.
36 #include <vector> //for ivars
37 
38 class vtkActor2D;
40 class vtkMatrix4x4;
43 class vtkOpenGLHelper;
45 class vtkPoints;
46 class vtkRenderer;
47 class vtkTextureObject;
48 class vtkTransform;
49 
50 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLPolyDataMapper2D : public vtkPolyDataMapper2D
51 {
52 public:
55  void PrintSelf(ostream& os, vtkIndent indent) override;
56 
60  void RenderOverlay(vtkViewport* viewport, vtkActor2D* actor) override;
61 
67  void ReleaseGraphicsResources(vtkWindow*) override;
68 
69 protected:
71  ~vtkOpenGLPolyDataMapper2D() override;
72 
74 
78  virtual bool GetNeedToRebuildShaders(vtkOpenGLHelper& cellBO, vtkViewport* ren, vtkActor2D* act);
79 
83  virtual void BuildShaders(std::string& VertexCode, std::string& fragmentCode,
84  std::string& geometryCode, vtkViewport* ren, vtkActor2D* act);
85 
89  virtual void UpdateShaders(vtkOpenGLHelper& cellBO, vtkViewport* viewport, vtkActor2D* act);
90 
94  virtual void SetMapperShaderParameters(
95  vtkOpenGLHelper& cellBO, vtkViewport* viewport, vtkActor2D* act);
96 
100  void SetCameraShaderParameters(vtkOpenGLHelper& cellBO, vtkViewport* viewport, vtkActor2D* act);
101 
105  void SetPropertyShaderParameters(vtkOpenGLHelper& cellBO, vtkViewport* viewport, vtkActor2D* act);
106 
111  virtual void ReplaceShaderPicking(std::string& fssource, vtkRenderer* ren, vtkActor2D* act);
112 
116  void UpdateVBO(vtkActor2D* act, vtkViewport* viewport);
117 
118  // The VBO and its layout.
120 
121  // Structures for the various cell types we render.
127 
132 
133  vtkTimeStamp VBOUpdateTime; // When was the VBO updated?
137 
140 
141  // do we have wide lines that require special handling
142  virtual bool HaveWideLines(vtkViewport*, vtkActor2D*);
143 
144  // stores the mapping from vtk cells to gl_PrimitiveId
146 
147 private:
149  void operator=(const vtkOpenGLPolyDataMapper2D&) = delete;
150 };
151 
152 #endif
static vtkPolyDataMapper2D * New()
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:41
vtkNew< vtkOpenGLCellToVTKCellMap > CellCellMap
virtual void RenderOverlay(vtkViewport *, vtkActor2D *)
Definition: vtkMapper2D.h:41
abstract specification for Viewports
Definition: vtkViewport.h:55
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:45
record modification and/or execution time
Definition: vtkTimeStamp.h:35
OpenGL rendering utility functions.
abstract specification for renderers
Definition: vtkRenderer.h:72
vtkNew< vtkTransform > VBOTransformInverse
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:60
vtkNew< vtkMatrix4x4 > VBOShiftScale
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
a simple class to control print indentation
Definition: vtkIndent.h:39
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:39
vtkOpenGLBufferObject * CellScalarBuffer