VTK: Rendering/OpenGL2/vtkOpenGLES30PolyDataMapper.h Source File

| VTK 9.3.1

vtkOpenGLES30PolyDataMapper.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
13 #ifndef vtkOpenGLES30PolyDataMapper_h
14 #define vtkOpenGLES30PolyDataMapper_h
15
16 #include "vtkOpenGLPolyDataMapper.h"
17
18 #include "vtkNew.h" // for ivar
19 #include "vtkRenderingOpenGL2Module.h" // For export macro
20
21 #include <vector> // for ivar
22
23 VTK_ABI_NAMESPACE_BEGIN
24 class vtkOpenGLCellToVTKCellMap;
25 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLES30PolyDataMapper : public vtkOpenGLPolyDataMapper
26 {
27 public:
28 static vtkOpenGLES30PolyDataMapper* New();
29 vtkTypeMacro(vtkOpenGLES30PolyDataMapper, vtkOpenGLPolyDataMapper);
30 void PrintSelf(ostream& os, vtkIndent indent) override;
31
32 void RenderPieceStart(vtkRenderer* ren, vtkActor* act) override;
33 void RenderPieceDraw(vtkRenderer* ren, vtkActor* act) override;
34 void RenderPieceFinish(vtkRenderer* ren, vtkActor* act) override;
35
41 void ReleaseGraphicsResources(vtkWindow*) override;
42
43 protected:
44 vtkOpenGLES30PolyDataMapper();
45 ~vtkOpenGLES30PolyDataMapper() override;
46
50 void GetShaderTemplate(
51 std::map<vtkShader::Type, vtkShader*> shaders, vtkRenderer* ren, vtkActor* act) override;
52
54
58 void ReplaceShaderValues(
59 std::map<vtkShader::Type, vtkShader*> shaders, vtkRenderer* ren, vtkActor* act) override;
60 void ReplaceShaderColor(
61 std::map<vtkShader::Type, vtkShader*> shaders, vtkRenderer* ren, vtkActor* act) override;
62 void ReplaceShaderNormal(
63 std::map<vtkShader::Type, vtkShader*> shaders, vtkRenderer* ren, vtkActor* act) override;
64 void ReplaceShaderCoincidentOffset(
65 std::map<vtkShader::Type, vtkShader*> shaders, vtkRenderer* ren, vtkActor* act) override;
66 void ReplaceShaderEdges(
67 std::map<vtkShader::Type, vtkShader*> shaders, vtkRenderer* ren, vtkActor* act) override;
68 void ReplaceShaderPicking(
69 std::map<vtkShader::Type, vtkShader*> shaders, vtkRenderer* ren, vtkActor* act) override;
73 void ReplaceShaderPointSize(
74 std::map<vtkShader::Type, vtkShader*> shaders, vtkRenderer* ren, vtkActor* act);
79 void ReplaceShaderWideLines(
80 std::map<vtkShader::Type, vtkShader*> shaders, vtkRenderer* ren, vtkActor* act);
82
86 void SetMapperShaderParameters(vtkOpenGLHelper& cellBO, vtkRenderer* ren, vtkActor* act) override;
87
91 void SetPropertyShaderParameters(
92 vtkOpenGLHelper& cellBO, vtkRenderer* ren, vtkActor* act) override;
93
97 void BuildBufferObjects(vtkRenderer* ren, vtkActor* act) override;
98 void AppendOneBufferObject(vtkRenderer* ren, vtkActor* act, vtkPolyData* polydata,
99 vtkOpenGLCellToVTKCellMap* prim2cellMap, vtkIdType& voffset);
100
104 void UpdateMaximumPointCellIds(vtkRenderer* ren, vtkActor* actor) override;
105
110 static void BuildIndexArrays(std::vector<unsigned int> (&indexArrays)[PrimitiveEnd],
111 std::vector<unsigned char>& edgeArray, vtkCellArray* prims[4], vtkPoints* points,
112 int representation, bool draw_surf_with_edges = false, bool vertex_visibility = false,
113 vtkDataArray* ef = nullptr);
114
115 bool DrawingPoints(vtkActor* actor);
116 bool DrawingLines(vtkActor* actor);
117
118 vtkNew<vtkOpenGLVertexBufferObjectGroup> PrimitiveVBOGroup[PrimitiveEnd];
119 std::vector<unsigned int> PrimitiveIndexArrays[PrimitiveEnd];
120
121 private:
122 vtkOpenGLES30PolyDataMapper(const vtkOpenGLES30PolyDataMapper&) = delete;
123 void operator=(const vtkOpenGLES30PolyDataMapper&) = delete;
124 };
125
126 VTK_ABI_NAMESPACE_END
127 #endif // vtkOpenGLES30PolyDataMapper_h
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:185
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkNew< vtkOpenGLVertexBufferObjectGroup >
vtkOpenGLCellToVTKCellMap
OpenGL rendering utility functions.
Definition: vtkOpenGLCellToVTKCellMap.h:25
vtkOpenGLES30PolyDataMapper
PolyDataMapper using OpenGLES30 to render surface meshes.
Definition: vtkOpenGLES30PolyDataMapper.h:26
vtkOpenGLES30PolyDataMapper::ReplaceShaderNormal
void ReplaceShaderNormal(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act) override
Perform string replacements on the shader templates, called from ReplaceShaderValues.
vtkOpenGLES30PolyDataMapper::ReplaceShaderWideLines
void ReplaceShaderWideLines(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act)
GLES 3.0 does not support wide lines (width > 1).
vtkOpenGLES30PolyDataMapper::RenderPieceDraw
void RenderPieceDraw(vtkRenderer *ren, vtkActor *act) override
Implemented by sub classes.
vtkOpenGLES30PolyDataMapper::SetPropertyShaderParameters
void SetPropertyShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act) override
Set the shader parameters related to the property, called by UpdateShader.
vtkOpenGLES30PolyDataMapper::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this mapper.
vtkOpenGLES30PolyDataMapper::~vtkOpenGLES30PolyDataMapper
~vtkOpenGLES30PolyDataMapper() override
vtkOpenGLES30PolyDataMapper::vtkOpenGLES30PolyDataMapper
vtkOpenGLES30PolyDataMapper()
vtkOpenGLES30PolyDataMapper::UpdateMaximumPointCellIds
void UpdateMaximumPointCellIds(vtkRenderer *ren, vtkActor *actor) override
Compute and set the maximum point and cell ID used in selection.
vtkOpenGLES30PolyDataMapper::BuildBufferObjects
void BuildBufferObjects(vtkRenderer *ren, vtkActor *act) override
Build the VBO, called by UpdateBufferObjects.
vtkOpenGLES30PolyDataMapper::New
static vtkOpenGLES30PolyDataMapper * New()
vtkOpenGLES30PolyDataMapper::DrawingPoints
bool DrawingPoints(vtkActor *actor)
vtkOpenGLES30PolyDataMapper::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkOpenGLES30PolyDataMapper::ReplaceShaderColor
void ReplaceShaderColor(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act) override
Perform string replacements on the shader templates, called from ReplaceShaderValues.
vtkOpenGLES30PolyDataMapper::ReplaceShaderPicking
void ReplaceShaderPicking(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act) override
Perform string replacements on the shader templates, called from ReplaceShaderValues.
vtkOpenGLES30PolyDataMapper::BuildIndexArrays
static void BuildIndexArrays(std::vector< unsigned int >(&indexArrays)[PrimitiveEnd], std::vector< unsigned char > &edgeArray, vtkCellArray *prims[4], vtkPoints *points, int representation, bool draw_surf_with_edges=false, bool vertex_visibility=false, vtkDataArray *ef=nullptr)
Get flat 0-based indices that form GL primitives for given vtk-cell connectivity and actor representa...
vtkOpenGLES30PolyDataMapper::SetMapperShaderParameters
void SetMapperShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act) override
Set the shader parameters related to the mapper/input data, called by UpdateShader.
vtkOpenGLES30PolyDataMapper::ReplaceShaderCoincidentOffset
void ReplaceShaderCoincidentOffset(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act) override
Perform string replacements on the shader templates, called from ReplaceShaderValues.
vtkOpenGLES30PolyDataMapper::ReplaceShaderPointSize
void ReplaceShaderPointSize(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act)
In GLES 3.0, point size is set from the vertex shader.
vtkOpenGLES30PolyDataMapper::ReplaceShaderValues
void ReplaceShaderValues(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act) override
Perform string replacements on the shader templates, called from ReplaceShaderValues.
vtkOpenGLES30PolyDataMapper::RenderPieceFinish
void RenderPieceFinish(vtkRenderer *ren, vtkActor *act) override
Implemented by sub classes.
vtkOpenGLES30PolyDataMapper::ReplaceShaderEdges
void ReplaceShaderEdges(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act) override
Perform string replacements on the shader templates, called from ReplaceShaderValues.
vtkOpenGLES30PolyDataMapper::GetShaderTemplate
void GetShaderTemplate(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act) override
Create the basic shaders before replacement.
vtkOpenGLES30PolyDataMapper::DrawingLines
bool DrawingLines(vtkActor *actor)
vtkOpenGLES30PolyDataMapper::RenderPieceStart
void RenderPieceStart(vtkRenderer *ren, vtkActor *act) override
Implemented by sub classes.
vtkOpenGLES30PolyDataMapper::AppendOneBufferObject
void AppendOneBufferObject(vtkRenderer *ren, vtkActor *act, vtkPolyData *polydata, vtkOpenGLCellToVTKCellMap *prim2cellMap, vtkIdType &voffset)
vtkOpenGLHelper
Definition: vtkOpenGLHelper.h:21
vtkOpenGLPolyDataMapper
PolyDataMapper using OpenGL to render.
Definition: vtkOpenGLPolyDataMapper.h:58
vtkOpenGLPolyDataMapper::PrimitiveEnd
@ PrimitiveEnd
Definition: vtkOpenGLPolyDataMapper.h:178
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:38
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:89
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:71
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkX3D::points
@ points
Definition: vtkX3D.h:446
vtkNew.h
vtkOpenGLPolyDataMapper.h
vtkIdType
int vtkIdType
Definition: vtkType.h:315