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 "vtkRenderingOpenGL2Module.h" // For export macro
26 #include "vtkRenderer.h"
27 #include <vector> // STL Header
28 
29 class vtkRenderPass;
30 class vtkOpenGLTexture;
31 class vtkTextureObject;
33 class vtkShadowMapPass;
34 
36 {
37 public:
38  static vtkOpenGLRenderer *New();
40  void PrintSelf(ostream& os, vtkIndent indent);
41 
43  void DeviceRender(void);
44 
49 
50  void Clear(void);
51 
53  int UpdateLights(void);
54 
59  int GetDepthPeelingHigherLayer();
60 
62 
63  void SetPass(vtkRenderPass *p);
64  vtkGetObjectMacro(Pass, vtkRenderPass);
66 
67 protected:
70 
72  void CheckCompilation(unsigned int fragmentShader);
73 
74  // Internal method to release graphics resources in any derived renderers.
75  virtual void ReleaseGraphicsResources(vtkWindow *w);
76 
80  virtual int UpdateGeometry();
81 
82  // Picking functions to be implemented by sub-classes
83  virtual void DevicePickRender();
84  virtual void StartPick(unsigned int pickFromSize);
85  virtual void UpdatePickId();
86  virtual void DonePick();
87  virtual unsigned int GetPickedId();
88  virtual unsigned int GetNumPickedIds();
89  virtual int GetPickedIds(unsigned int atMost, unsigned int *callerBuffer);
90  virtual double GetPickedZ();
91 
92  // Ivars used in picking
93  class vtkGLPickInfo* PickInfo;
94 
95  double PickedZ;
96 
97  friend class vtkOpenGLProperty;
98  friend class vtkOpenGLTexture;
99  friend class vtkOpenGLImageSliceMapper;
100  friend class vtkOpenGLImageResliceMapper;
101 
104 
107 
108  // Is rendering at translucent geometry stage using depth peeling and
109  // rendering a layer other than the first one? (Boolean value)
110  // If so, the uniform variables UseTexture and Texture can be set.
111  // (Used by vtkOpenGLProperty or vtkOpenGLTexture)
112  int DepthPeelingHigherLayer;
113 
114  friend class vtkRenderPass;
115  vtkRenderPass *Pass;
116 
117 private:
118  vtkOpenGLRenderer(const vtkOpenGLRenderer&); // Not implemented.
119  void operator=(const vtkOpenGLRenderer&); // Not implemented.
120 };
121 
122 #endif
virtual double GetPickedZ()=0
Implement an Order Independent Transparency render pass.
virtual void ReleaseGraphicsResources(vtkWindow *)
vtkShadowMapPass * ShadowMapPass
virtual int UpdateGeometry()
#define VTKRENDERINGOPENGL2_EXPORT
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
virtual void DeviceRender()=0
void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual void DeviceRenderTranslucentPolygonalGeometry()
vtkDepthPeelingPass * DepthPeelingPass
virtual unsigned int GetPickedId()=0
abstracts an OpenGL texture object.
virtual void StartPick(unsigned int pickFromSize)=0
virtual unsigned int GetNumPickedIds()=0
static vtkRenderer * New()
Implement a shadow mapping render pass.
virtual void DevicePickRender()=0
Perform part of the rendering of a vtkRenderer.
Definition: vtkRenderPass.h:57
OpenGL renderer.
virtual void DonePick()=0
virtual void Clear()
Definition: vtkRenderer.h:244