VTK
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 =========================================================================*/
20 #ifndef vtkOpenGLGlyph3DHelper_h
21 #define vtkOpenGLGlyph3DHelper_h
22 
23 #include "vtkRenderingOpenGL2Module.h" // For export macro
25 
26 class vtkBitArray;
27 
29 {
30 public:
31  static vtkOpenGLGlyph3DHelper* New();
33  void PrintSelf(ostream& os, vtkIndent indent);
34 
35  void SetModelTransform(float *matrix)
36  {
37  this->ModelTransformMatrix = matrix;
38  }
39 
40  void SetModelNormalTransform(float *matrix)
41  {
42  this->ModelNormalMatrix = matrix;
43  }
44 
45  void SetModelColor(unsigned char *color)
46  {
47  this->ModelColor = color;
48  }
49 
50  void SetUseFastPath(bool fastpath)
51  {
52  this->UseFastPath = fastpath;
53  this->UsingInstancing = false;
54  }
55 
57 
59  void GlyphRender(vtkRenderer* ren, vtkActor* actor, vtkIdType numPts,
60  std::vector<unsigned char> &colors, std::vector<float> &matrices,
61  std::vector<float> &normalMatrices, std::vector<vtkIdType> &pickIds,
62  unsigned long pointMTime);
64 
68  virtual void ReleaseGraphicsResources(vtkWindow *window);
69 
70 protected:
73 
74  // special opengl 32 version that uses instances
75 #if GL_ES_VERSION_2_0 != 1 || GL_ES_VERSION_3_0 == 1
76  void GlyphRenderInstances(vtkRenderer* ren, vtkActor* actor, vtkIdType numPts,
77  std::vector<unsigned char> &colors, std::vector<float> &matrices,
78  std::vector<float> &normalMatrices,
79  unsigned long pointMTime);
80 #endif
81 
83 
84  virtual void GetShaderTemplate(
85  std::map<vtkShader::Type, vtkShader *> shaders,
86  vtkRenderer *ren, vtkActor *act);
88 
90 
91  virtual void ReplaceShaderPicking(
92  std::map<vtkShader::Type, vtkShader *> shaders,
93  vtkRenderer *ren, vtkActor *act);
94  virtual void ReplaceShaderColor(
95  std::map<vtkShader::Type, vtkShader *> shaders,
96  vtkRenderer *ren, vtkActor *act);
97  virtual void ReplaceShaderNormal(
98  std::map<vtkShader::Type, vtkShader *> shaders,
99  vtkRenderer *ren, vtkActor *act);
100  virtual void ReplaceShaderClip(
101  std::map<vtkShader::Type, vtkShader *> shaders,
102  vtkRenderer *ren, vtkActor *act);
103  virtual void ReplaceShaderPositionVC(
104  std::map<vtkShader::Type, vtkShader *> shaders,
105  vtkRenderer *ren, vtkActor *act);
107 
109 
110  virtual void SetCameraShaderParameters(
111  vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act);
113 
115 
116  virtual void SetPropertyShaderParameters(
117  vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act);
119 
121 
122  virtual void SetMapperShaderParameters(
123  vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act);
125 
128 
131  unsigned char* ModelColor;
132 
137 
138 
139 private:
140  vtkOpenGLGlyph3DHelper(const vtkOpenGLGlyph3DHelper&); // Not implemented.
141  void operator=(const vtkOpenGLGlyph3DHelper&); // Not implemented.
142 };
143 
144 #endif
a PolyDataMapper for the OpenGL library
virtual void ReplaceShaderPositionVC(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act)
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
static vtkOpenGLPolyDataMapper * New()
#define VTKRENDERINGOPENGL2_EXPORT
record modification and/or execution time
Definition: vtkTimeStamp.h:34
virtual void ReplaceShaderClip(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act)
abstract specification for renderers
Definition: vtkRenderer.h:62
virtual void SetPropertyShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act)
int vtkIdType
Definition: vtkType.h:247
vtkOpenGLBufferObject * NormalMatrixBuffer
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
void SetModelColor(unsigned char *color)
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual void ReplaceShaderNormal(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act)
virtual void ReplaceShaderPicking(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act)
void SetModelNormalTransform(float *matrix)
vtkOpenGLBufferObject * ColorBuffer
virtual void GetShaderTemplate(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act)
PolyDataMapper using OpenGL to render.
virtual void SetMapperShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act)
vtkOpenGLBufferObject * MatrixBuffer
void SetUseFastPath(bool fastpath)
virtual void ReplaceShaderColor(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act)
dynamic, self-adjusting array of bits
Definition: vtkBitArray.h:35
virtual void SetCameraShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act)
void ReleaseGraphicsResources(vtkWindow *)
OpenGL buffer object.