VTK
vtkOpenGLRenderer.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOpenGLRenderer.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 =========================================================================*/
25 #ifndef vtkOpenGLRenderer_h
26 #define vtkOpenGLRenderer_h
27 
28 #include "vtkRenderingOpenGLModule.h" // For export macro
29 #include "vtkRenderer.h"
30 
31 class vtkOpenGLRendererLayerList; // Pimpl
32 class vtkRenderPass;
33 class vtkShaderProgram2;
34 
35 class VTKRENDERINGOPENGL_EXPORT vtkOpenGLRenderer : public vtkRenderer
36 {
37 public:
38  static vtkOpenGLRenderer *New();
40  void PrintSelf(ostream& os, vtkIndent indent);
41 
43  void DeviceRender(void);
44 
49 
52  void ClearLights(void);
53 
54  virtual void Clear(void);
55 
57  int UpdateLights(void);
58 
63  int GetDepthPeelingHigherLayer();
64 
65  //BTX
67  */
68  vtkGetObjectMacro(ShaderProgram, vtkShaderProgram2);
69  virtual void SetShaderProgram(vtkShaderProgram2 *program);
70  //ETX
72 
74 
75  void SetPass(vtkRenderPass *p);
76  vtkGetObjectMacro(Pass, vtkRenderPass);
78 
79 protected:
82 
84  void CheckCompilation(unsigned int fragmentShader);
85 
86  // Internal method to release graphics resources in any derived renderers.
87  virtual void ReleaseGraphicsResources(vtkWindow *w);
88 
89  //BTX
90  // Picking functions to be implemented by sub-classes
91  virtual void DevicePickRender();
92  virtual void StartPick(unsigned int pickFromSize);
93  virtual void UpdatePickId();
94  virtual void DonePick();
95  virtual unsigned int GetPickedId();
96  virtual unsigned int GetNumPickedIds();
97  virtual int GetPickedIds(unsigned int atMost, unsigned int *callerBuffer);
98  virtual double GetPickedZ();
99 
100  // Ivars used in picking
101  class vtkGLPickInfo* PickInfo;
102  //ETX
103 
104  double PickedZ;
105 
111  int RenderPeel(int layer);
112 
113  //BTX
114  friend class vtkOpenGLProperty;
115  friend class vtkOpenGLTexture;
117  friend class vtkOpenGLImageResliceMapper;
118  //ETX
119 
122  int GetUseTextureUniformVariable();
123 
126  int GetTextureUniformVariable();
127 
131 
135 
137  vtkOpenGLRendererLayerList *LayerList;
138 
139  unsigned int OpaqueLayerZ;
140  unsigned int TransparentLayerZ;
141  unsigned int ProgramShader;
142 
144 
150 
153  unsigned int DepthFormat;
154 
155  // Is rendering at translucent geometry stage using depth peeling and
156  // rendering a layer other than the first one? (Boolean value)
157  // If so, the uniform variables UseTexture and Texture can be set.
158  // (Used by vtkOpenGLProperty or vtkOpenGLTexture)
160 
162 
163  friend class vtkRenderPass;
165 
166 private:
167  vtkOpenGLRenderer(const vtkOpenGLRenderer&); // Not implemented.
168  void operator=(const vtkOpenGLRenderer&); // Not implemented.
169 };
170 
171 #endif
virtual double GetPickedZ()=0
virtual void ReleaseGraphicsResources(vtkWindow *)
virtual int UpdateLights(void)
Definition: vtkRenderer.h:631
abstract specification for renderers
Definition: vtkRenderer.h:62
virtual int GetPickedIds(unsigned int atMost, unsigned int *callerBuffer)=0
OpenGL property.
OpenGL mapper for image slice display.
OpenGL texture map.
virtual void UpdatePickId()=0
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
GLSL Program.
vtkRenderPass * Pass
virtual void DeviceRender()=0
void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual void DeviceRenderTranslucentPolygonalGeometry()
vtkOpenGLRendererLayerList * LayerList
vtkShaderProgram2 * ShaderProgram
virtual unsigned int GetPickedId()=0
virtual void StartPick(unsigned int pickFromSize)=0
virtual unsigned int GetNumPickedIds()=0
unsigned int OpaqueLayerZ
static vtkRenderer * New()
virtual void DevicePickRender()=0
Perform part of the rendering of a vtkRenderer.
Definition: vtkRenderPass.h:57
OpenGL renderer.
class vtkGLPickInfo * PickInfo
unsigned int DepthFormat
virtual void DonePick()=0
unsigned int TransparentLayerZ
virtual void Clear()
Definition: vtkRenderer.h:244
unsigned int ProgramShader