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 =========================================================================*/
23 #ifndef vtkOpenGLRenderer_h
24 #define vtkOpenGLRenderer_h
25 
26 #include "vtkRenderingOpenGLModule.h" // For export macro
27 #include "vtkRenderer.h"
28 
29 class vtkOpenGLRendererLayerList; // Pimpl
30 class vtkRenderPass;
31 class vtkShaderProgram2;
32 
33 class VTKRENDERINGOPENGL_EXPORT vtkOpenGLRenderer : public vtkRenderer
34 {
35 public:
38  void PrintSelf(ostream& os, vtkIndent indent);
39 
43  void DeviceRender(void);
44 
49 
57 
62  virtual void ClearLights(void);
63 
64  virtual void Clear(void);
65 
69  int UpdateLights(void);
70 
78 
80 
83  vtkGetObjectMacro(ShaderProgram, vtkShaderProgram2);
84  virtual void SetShaderProgram(vtkShaderProgram2 *program);
86 
87 protected:
90 
94  void CheckCompilation(unsigned int fragmentShader);
95 
96  // Internal method to release graphics resources in any derived renderers.
98 
99  // Picking functions to be implemented by sub-classes
100  virtual void DevicePickRender();
101  virtual void StartPick(unsigned int pickFromSize);
102  virtual void UpdatePickId();
103  virtual void DonePick();
104  virtual unsigned int GetPickedId();
105  virtual unsigned int GetNumPickedIds();
106  virtual int GetPickedIds(unsigned int atMost, unsigned int *callerBuffer);
107  virtual double GetPickedZ();
108 
109  // Ivars used in picking
110  class vtkGLPickInfo* PickInfo;
111 
112  double PickedZ;
113 
121  int RenderPeel(int layer);
122 
123  friend class vtkOpenGLProperty;
124  friend class vtkOpenGLTexture;
126  friend class vtkOpenGLImageResliceMapper;
127 
133 
139 
145 
151 
155  vtkOpenGLRendererLayerList *LayerList;
156 
157  unsigned int OpaqueLayerZ;
158  unsigned int TransparentLayerZ;
159  unsigned int ProgramShader;
160 
162 
170 
175  unsigned int DepthFormat;
176 
177  // Is rendering at translucent geometry stage using depth peeling and
178  // rendering a layer other than the first one? (Boolean value)
179  // If so, the uniform variables UseTexture and Texture can be set.
180  // (Used by vtkOpenGLProperty or vtkOpenGLTexture)
182 
184 
185  friend class vtkRenderPass;
186 
187 private:
188  vtkOpenGLRenderer(const vtkOpenGLRenderer&) VTK_DELETE_FUNCTION;
189  void operator=(const vtkOpenGLRenderer&) VTK_DELETE_FUNCTION;
190 };
191 
192 #endif
a simple class to control print indentation
Definition: vtkIndent.h:40
OpenGL mapper for image slice display.
OpenGL property.
OpenGL renderer.
unsigned int ProgramShader
virtual void ReleaseGraphicsResources(vtkWindow *w)
virtual void DeviceRenderOpaqueGeometry()
Overridden to support hidden line removal.
int GetTextureUniformVariable()
Access to the OpenGL program shader uniform variable "texture" from the vtkOpenGLProperty or vtkOpenG...
unsigned int OpaqueLayerZ
virtual void ClearLights(void)
Internal method temporarily removes lights before reloading them into graphics pipeline.
void DeviceRender(void)
Concrete open gl render method.
virtual void DevicePickRender()
virtual void UpdatePickId()
virtual int GetPickedIds(unsigned int atMost, unsigned int *callerBuffer)
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual double GetPickedZ()
Return the Z value for the last picked Prop.
class vtkGLPickInfo * PickInfo
virtual void DonePick()
int RenderPeel(int layer)
Render a peel layer.
int GetUseTextureUniformVariable()
Access to the OpenGL program shader uniform variable "useTexture" from the vtkOpenGLProperty or vtkOp...
int DepthPeelingIsSupported
This flag is on if the current OpenGL context supports extensions required by the depth peeling techn...
unsigned int TransparentLayerZ
static vtkOpenGLRenderer * New()
virtual void SetShaderProgram(vtkShaderProgram2 *program)
vtkOpenGLRendererLayerList * LayerList
Used by the depth peeling technique to store the transparency layers.
virtual unsigned int GetNumPickedIds()
virtual void Clear(void)
Clear the image to the background color.
unsigned int DepthFormat
Actual depth format: vtkgl::DEPTH_COMPONENT16_ARB or vtkgl::DEPTH_COMPONENT24_ARB.
int ViewportX
Cache viewport values for depth peeling.
int UpdateLights(void)
Ask lights to load themselves into graphics pipeline.
virtual unsigned int GetPickedId()
virtual void StartPick(unsigned int pickFromSize)
virtual void DeviceRenderTranslucentPolygonalGeometry()
Render translucent polygonal geometry.
vtkShaderProgram2 * ShaderProgram
int DepthPeelingIsSupportedChecked
This flag is on once the OpenGL extensions required by the depth peeling technique have been checked.
void CheckCompilation(unsigned int fragmentShader)
Check the compilation status of some fragment shader source.
int GetDepthPeelingHigherLayer()
Is rendering at translucent geometry stage using depth peeling and rendering a layer other than the f...
OpenGL texture map.
Perform part of the rendering of a vtkRenderer.
Definition: vtkRenderPass.h:59
abstract specification for renderers
Definition: vtkRenderer.h:64
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
@ ShaderProgram
Definition: vtkX3D.h:202