VTK  9.3.0
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
26VTK_ABI_NAMESPACE_BEGIN
27class vtkActor2D;
29class vtkMatrix4x4;
32class vtkOpenGLHelper;
34class vtkPoints;
35class vtkRenderer;
37class vtkTransform;
38
39class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLPolyDataMapper2D : public vtkPolyDataMapper2D
40{
41public:
44 void PrintSelf(ostream& os, vtkIndent indent) override;
45
49 void RenderOverlay(vtkViewport* viewport, vtkActor2D* actor) override;
50
57
58protected:
61
63
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
84 vtkOpenGLHelper& cellBO, vtkViewport* viewport, vtkActor2D* act);
85
90
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
132
133 // stores the mapping from vtk cells to gl_PrimitiveId
135
136private:
138 void operator=(const vtkOpenGLPolyDataMapper2D&) = delete;
139};
140
141VTK_ABI_NAMESPACE_END
142#endif
a actor that draws 2D data
Definition vtkActor2D.h:35
a simple class to control print indentation
Definition vtkIndent.h:29
represent and manipulate 4x4 transformation matrices
Allocate and hold a VTK object.
Definition vtkNew.h:51
OpenGL buffer object.
OpenGL rendering utility functions.
2D PolyData support for OpenGL
~vtkOpenGLPolyDataMapper2D() override
virtual void BuildShaders(std::string &VertexCode, std::string &fragmentCode, std::string &geometryCode, vtkViewport *ren, vtkActor2D *act)
Build the shader source code.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetPropertyShaderParameters(vtkOpenGLHelper &cellBO, vtkViewport *viewport, vtkActor2D *act)
Set the shader parameters related to the property.
void UpdateVBO(vtkActor2D *act, vtkViewport *viewport)
Update the scene when necessary.
static vtkOpenGLPolyDataMapper2D * New()
virtual void ReplaceShaderPicking(std::string &fssource, vtkRenderer *ren, vtkActor2D *act)
Perform string replacements on the shader templates, called from ReplaceShaderValues.
virtual void UpdateShaders(vtkOpenGLHelper &cellBO, vtkViewport *viewport, vtkActor2D *act)
Determine what shader to use and compile/link it.
vtkGenericOpenGLResourceFreeCallback * ResourceCallback
void RenderOverlay(vtkViewport *viewport, vtkActor2D *actor) override
Actually draw the poly data.
vtkNew< vtkTransform > VBOTransformInverse
virtual void SetMapperShaderParameters(vtkOpenGLHelper &cellBO, vtkViewport *viewport, vtkActor2D *act)
Set the shader parameters related to the mapper/input data, called by UpdateShader.
vtkOpenGLBufferObject * CellScalarBuffer
void SetCameraShaderParameters(vtkOpenGLHelper &cellBO, vtkViewport *viewport, vtkActor2D *act)
Set the shader parameters related to the Camera.
vtkNew< vtkOpenGLCellToVTKCellMap > CellCellMap
vtkOpenGLVertexBufferObjectGroup * VBOs
virtual bool HaveWideLines(vtkViewport *, vtkActor2D *)
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this mapper.
virtual bool GetNeedToRebuildShaders(vtkOpenGLHelper &cellBO, vtkViewport *ren, vtkActor2D *act)
Does the shader source need to be recomputed.
manage vertex buffer objects shared within a mapper
represent and manipulate 3D points
Definition vtkPoints.h:29
draw vtkPolyData onto the image plane
abstract specification for renderers
Definition vtkRenderer.h:59
abstracts an OpenGL texture object.
record modification and/or execution time
describes linear transformations via a 4x4 matrix
abstract specification for Viewports
Definition vtkViewport.h:45
window superclass for vtkRenderWindow
Definition vtkWindow.h:25