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 "vtkRenderingOpenGL2Module.h" // For export macro
29 #include "vtkRenderer.h"
30 #include <vector> // STL Header
31 
32 class vtkRenderPass;
33 class vtkOpenGLTexture;
34 class vtkTextureObject;
36 
37 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLRenderer : public vtkRenderer
38 {
39 public:
40  static vtkOpenGLRenderer *New();
42  void PrintSelf(ostream& os, vtkIndent indent);
43 
45  void DeviceRender(void);
46 
51 
52  void Clear(void);
53 
55  int UpdateLights(void);
56 
61  int GetDepthPeelingHigherLayer();
62 
64 
65  void SetPass(vtkRenderPass *p);
66  vtkGetObjectMacro(Pass, vtkRenderPass);
68 
69 protected:
72 
74  void CheckCompilation(unsigned int fragmentShader);
75 
76  // Internal method to release graphics resources in any derived renderers.
77  virtual void ReleaseGraphicsResources(vtkWindow *w);
78 
79  // Picking functions to be implemented by sub-classes
80  virtual void DevicePickRender();
81  virtual void StartPick(unsigned int pickFromSize);
82  virtual void UpdatePickId();
83  virtual void DonePick();
84  virtual unsigned int GetPickedId();
85  virtual unsigned int GetNumPickedIds();
86  virtual int GetPickedIds(unsigned int atMost, unsigned int *callerBuffer);
87  virtual double GetPickedZ();
88 
89  // Ivars used in picking
90  class vtkGLPickInfo* PickInfo;
91 
92  double PickedZ;
93 
94  friend class vtkOpenGLProperty;
95  friend class vtkOpenGLTexture;
96  friend class vtkOpenGLImageSliceMapper;
97  friend class vtkOpenGLImageResliceMapper;
98 
101 
102  // Is rendering at translucent geometry stage using depth peeling and
103  // rendering a layer other than the first one? (Boolean value)
104  // If so, the uniform variables UseTexture and Texture can be set.
105  // (Used by vtkOpenGLProperty or vtkOpenGLTexture)
106  int DepthPeelingHigherLayer;
107 
108  friend class vtkRenderPass;
109  vtkRenderPass *Pass;
110 
111 private:
112  vtkOpenGLRenderer(const vtkOpenGLRenderer&); // Not implemented.
113  void operator=(const vtkOpenGLRenderer&); // Not implemented.
114 };
115 
116 #endif
virtual double GetPickedZ()=0
Implement an Order Independent Transparency render pass.
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
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()
virtual void DevicePickRender()=0
Perform part of the rendering of a vtkRenderer.
Definition: vtkRenderPass.h:54
OpenGL renderer.
virtual void DonePick()=0
virtual void Clear()
Definition: vtkRenderer.h:245