VTK  9.1.0
vtkOpenGLGlyph3DHelper.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4
5 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
6 All rights reserved.
7 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
8
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notice for more information.
12
13=========================================================================*/
21#ifndef vtkOpenGLGlyph3DHelper_h
22#define vtkOpenGLGlyph3DHelper_h
23
24#include "vtkNew.h" // For vtkNew
25#include "vtkOpenGLBufferObject.h" // For vtkOpenGLBufferObject
26#include "vtkOpenGLHelper.h" // For vtkOpenGLHelper
27#include "vtkOpenGLInstanceCulling.h" // For vtkOpenGLInstanceCulling
29#include "vtkRenderingOpenGL2Module.h" // For export macro
30
31class vtkBitArray;
32
33class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLGlyph3DHelper : public vtkOpenGLPolyDataMapper
34{
35public:
38 void PrintSelf(ostream& os, vtkIndent indent) override;
39
44 void GlyphRender(vtkRenderer* ren, vtkActor* actor, vtkIdType numPts,
45 std::vector<unsigned char>& colors, std::vector<float>& matrices,
46 std::vector<float>& normalMatrices, std::vector<vtkIdType>& pickIds, vtkMTimeType pointMTime,
47 bool culling);
48
49 void SetLODs(std::vector<std::pair<float, float>>& lods);
50
51 void SetLODColoring(bool val);
52
58 void ReleaseGraphicsResources(vtkWindow* window) override;
59
60protected:
62 ~vtkOpenGLGlyph3DHelper() override = default;
63
64 // special opengl 32 version that uses instances
66 std::vector<unsigned char>& colors, std::vector<float>& matrices,
67 std::vector<float>& normalMatrices, vtkMTimeType pointMTime, bool culling);
68
73 std::map<vtkShader::Type, vtkShader*> shaders, vtkRenderer* ren, vtkActor* act) override;
74
76
80 std::map<vtkShader::Type, vtkShader*> shaders, vtkRenderer* ren, vtkActor* act) override;
82 std::map<vtkShader::Type, vtkShader*> shaders, vtkRenderer* ren, vtkActor* act) override;
84 std::map<vtkShader::Type, vtkShader*> shaders, vtkRenderer* ren, vtkActor* act) override;
86 std::map<vtkShader::Type, vtkShader*> shaders, vtkRenderer* ren, vtkActor* act) override;
88 std::map<vtkShader::Type, vtkShader*> shaders, vtkRenderer* ren, vtkActor* act) override;
90
95
96 void BuildCullingShaders(vtkRenderer* ren, vtkActor* actor, vtkIdType numPts, bool withNormals);
97
99
105
106 std::vector<std::pair<float, float>> LODs;
108
109private:
111 void operator=(const vtkOpenGLGlyph3DHelper&) = delete;
112};
113
114#endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:155
dynamic, self-adjusting array of bits
Definition: vtkBitArray.h:34
a simple class to control print indentation
Definition: vtkIndent.h:113
Allocate and hold a VTK object.
Definition: vtkNew.h:165
PolyDataMapper using OpenGL to render.
void ReleaseGraphicsResources(vtkWindow *window) override
Release any graphics resources that are being consumed by this mapper.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetLODs(std::vector< std::pair< float, float > > &lods)
void ReplaceShaderPicking(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act) override
Perform string replacements on the shader templates.
void GetShaderTemplate(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act) override
Create the basic shaders before replacement.
void SetLODColoring(bool val)
void ReplaceShaderPositionVC(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act) override
Perform string replacements on the shader templates.
void GlyphRender(vtkRenderer *ren, vtkActor *actor, vtkIdType numPts, std::vector< unsigned char > &colors, std::vector< float > &matrices, std::vector< float > &normalMatrices, std::vector< vtkIdType > &pickIds, vtkMTimeType pointMTime, bool culling)
Fast path for rendering glyphs comprised of only one type of primitive Must set this->CurrentInput ex...
vtkNew< vtkOpenGLInstanceCulling > InstanceCulling
void SetMapperShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act) override
Set the shader parameteres related to the actor/mapper.
vtkNew< vtkOpenGLBufferObject > ColorBuffer
void ReplaceShaderColor(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act) override
Perform string replacements on the shader templates.
static vtkOpenGLGlyph3DHelper * New()
void ReplaceShaderNormal(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act) override
Perform string replacements on the shader templates.
void GlyphRenderInstances(vtkRenderer *ren, vtkActor *actor, vtkIdType numPts, std::vector< unsigned char > &colors, std::vector< float > &matrices, std::vector< float > &normalMatrices, vtkMTimeType pointMTime, bool culling)
void ReplaceShaderClip(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act) override
Perform string replacements on the shader templates.
vtkNew< vtkOpenGLBufferObject > MatrixBuffer
vtkNew< vtkOpenGLBufferObject > NormalMatrixBuffer
~vtkOpenGLGlyph3DHelper() override=default
std::vector< std::pair< float, float > > LODs
void BuildCullingShaders(vtkRenderer *ren, vtkActor *actor, vtkIdType numPts, bool withNormals)
PolyDataMapper using OpenGL to render.
abstract specification for renderers
Definition: vtkRenderer.h:182
record modification and/or execution time
Definition: vtkTimeStamp.h:52
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
int vtkIdType
Definition: vtkType.h:332
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287