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 "vtkRenderingOpenGL2Module.h" // For export macro
27 #include "vtkRenderer.h"
28 #include <vector> // STL Header
29 
31 class vtkRenderPass;
32 class vtkOpenGLTexture;
33 class vtkTextureObject;
35 class vtkShadowMapPass;
36 
37 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLRenderer : public vtkRenderer
38 {
39 public:
40  static vtkOpenGLRenderer *New();
42  void PrintSelf(ostream& os, vtkIndent indent);
43 
47  void DeviceRender(void);
48 
52  virtual void DeviceRenderOpaqueGeometry();
53 
61 
62  void Clear(void);
63 
67  int UpdateLights(void);
68 
75  int GetDepthPeelingHigherLayer();
76 
81  bool HaveApplePrimitiveIdBug();
82 
83 protected:
86 
90  void CheckCompilation(unsigned int fragmentShader);
91 
92  // Internal method to release graphics resources in any derived renderers.
93  virtual void ReleaseGraphicsResources(vtkWindow *w);
94 
100  virtual int UpdateGeometry();
101 
102  // Picking functions to be implemented by sub-classes
103  virtual void DevicePickRender();
104  virtual void StartPick(unsigned int pickFromSize);
105  virtual void UpdatePickId();
106  virtual void DonePick();
107  virtual unsigned int GetPickedId();
108  virtual unsigned int GetNumPickedIds();
109  virtual int GetPickedIds(unsigned int atMost, unsigned int *callerBuffer);
110  virtual double GetPickedZ();
111 
112  // Ivars used in picking
113  class vtkGLPickInfo* PickInfo;
114 
115  double PickedZ;
116 
117  friend class vtkOpenGLProperty;
118  friend class vtkOpenGLTexture;
119  friend class vtkOpenGLImageSliceMapper;
120  friend class vtkOpenGLImageResliceMapper;
121 
126 
131 
136 
137  // Is rendering at translucent geometry stage using depth peeling and
138  // rendering a layer other than the first one? (Boolean value)
139  // If so, the uniform variables UseTexture and Texture can be set.
140  // (Used by vtkOpenGLProperty or vtkOpenGLTexture)
141  int DepthPeelingHigherLayer;
142 
143  friend class vtkRenderPass;
144 
147 
148 private:
149  vtkOpenGLRenderer(const vtkOpenGLRenderer&) VTK_DELETE_FUNCTION;
150  void operator=(const vtkOpenGLRenderer&) VTK_DELETE_FUNCTION;
151 };
152 
153 #endif
virtual double GetPickedZ()=0
Return the Z value for the last picked Prop.
Implement an Order Independent Transparency render pass.
virtual void ReleaseGraphicsResources(vtkWindow *)
vtkShadowMapPass * ShadowMapPass
Shadows are delegated to an instance of vtkShadowMapPass.
virtual int UpdateGeometry()
Ask all props to update and draw any opaque and translucent geometry.
virtual int UpdateLights(void)
Ask all lights to load themselves into rendering pipeline.
Definition: vtkRenderer.h:862
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:34
vtkOpenGLFXAAFilter * FXAAFilter
FXAA is delegated to an instance of vtkOpenGLFXAAFilter.
virtual void DeviceRender()=0
Create an image.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual void DeviceRenderTranslucentPolygonalGeometry()
Render translucent polygonal geometry.
virtual void DeviceRenderOpaqueGeometry()
Render opaque polygonal geometry.
vtkDepthPeelingPass * DepthPeelingPass
Depth peeling is delegated to an instance of vtkDepthPeelingPass.
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()
Create a vtkRenderer with a black background, a white ambient light, two-sided lighting turned on...
Implement a shadow mapping render pass.
virtual void DevicePickRender()=0
Perform FXAA antialiasing on the current framebuffer.
Perform part of the rendering of a vtkRenderer.
Definition: vtkRenderPass.h:58
OpenGL renderer.
virtual void DonePick()=0
virtual void Clear()
Clear the image to the background color.
Definition: vtkRenderer.h:324