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 =========================================================================*/
22 #ifndef vtkOpenGLRenderer_h
23 #define vtkOpenGLRenderer_h
24 
25 #include "vtkRenderingOpenGLModule.h" // For export macro
26 #include "vtkRenderer.h"
27 
28 class vtkOpenGLRendererLayerList; // Pimpl
29 class vtkRenderPass;
30 class vtkShaderProgram2;
31 
33 {
34 public:
35  static vtkOpenGLRenderer *New();
37  void PrintSelf(ostream& os, vtkIndent indent);
38 
40  void DeviceRender(void);
41 
46 
49  void ClearLights(void);
50 
51  virtual void Clear(void);
52 
54  int UpdateLights(void);
55 
60  int GetDepthPeelingHigherLayer();
61 
62  //BTX
64  */
65  vtkGetObjectMacro(ShaderProgram, vtkShaderProgram2);
66  virtual void SetShaderProgram(vtkShaderProgram2 *program);
67  //ETX
69 
71 
72  void SetPass(vtkRenderPass *p);
73  vtkGetObjectMacro(Pass, vtkRenderPass);
75 
76 protected:
79 
81  void CheckCompilation(unsigned int fragmentShader);
82 
83  // Internal method to release graphics resources in any derived renderers.
84  virtual void ReleaseGraphicsResources(vtkWindow *w);
85 
86  //BTX
87  // Picking functions to be implemented by sub-classes
88  virtual void DevicePickRender();
89  virtual void StartPick(unsigned int pickFromSize);
90  virtual void UpdatePickId();
91  virtual void DonePick();
92  virtual unsigned int GetPickedId();
93  virtual unsigned int GetNumPickedIds();
94  virtual int GetPickedIds(unsigned int atMost, unsigned int *callerBuffer);
95  virtual double GetPickedZ();
96 
97  // Ivars used in picking
98  class vtkGLPickInfo* PickInfo;
99  //ETX
100 
101  double PickedZ;
102 
108  int RenderPeel(int layer);
109 
110  //BTX
111  friend class vtkOpenGLProperty;
112  friend class vtkOpenGLTexture;
114  friend class vtkOpenGLImageResliceMapper;
115  //ETX
116 
119  int GetUseTextureUniformVariable();
120 
123  int GetTextureUniformVariable();
124 
128 
132 
134  vtkOpenGLRendererLayerList *LayerList;
135 
136  unsigned int OpaqueLayerZ;
137  unsigned int TransparentLayerZ;
138  unsigned int ProgramShader;
139 
141 
147 
150  unsigned int DepthFormat;
151 
152  // Is rendering at translucent geometry stage using depth peeling and
153  // rendering a layer other than the first one? (Boolean value)
154  // If so, the uniform variables UseTexture and Texture can be set.
155  // (Used by vtkOpenGLProperty or vtkOpenGLTexture)
157 
159 
160  friend class vtkRenderPass;
162 
163 private:
164  vtkOpenGLRenderer(const vtkOpenGLRenderer&); // Not implemented.
165  void operator=(const vtkOpenGLRenderer&); // Not implemented.
166 };
167 
168 #endif
virtual double GetPickedZ()=0
virtual void ReleaseGraphicsResources(vtkWindow *)
Definition: vtkRenderer.h:508
virtual int UpdateLights(void)
Definition: vtkRenderer.h:625
abstract specification for renderers
Definition: vtkRenderer.h:63
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()
#define VTKRENDERINGOPENGL_EXPORT
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:54
OpenGL renderer.
class vtkGLPickInfo * PickInfo
unsigned int DepthFormat
virtual void DonePick()=0
unsigned int TransparentLayerZ
virtual void Clear()
Definition: vtkRenderer.h:245
unsigned int ProgramShader