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 =========================================================================*/
26 #ifndef vtkOpenGLRenderer_h
27 #define vtkOpenGLRenderer_h
28 
29 #include "vtkRenderingOpenGL2Module.h" // For export macro
30 #include "vtkRenderer.h"
31 #include <vector> // STL Header
32 
34 class vtkRenderPass;
35 class vtkOpenGLTexture;
36 class vtkTextureObject;
38 class vtkShadowMapPass;
39 
40 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLRenderer : public vtkRenderer
41 {
42 public:
43  static vtkOpenGLRenderer *New();
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
50  void DeviceRender(void) override;
51 
55  void DeviceRenderOpaqueGeometry() override;
56 
64 
65  void Clear(void) override;
66 
70  int UpdateLights(void) override;
71 
78  int GetDepthPeelingHigherLayer();
79 
84  bool HaveApplePrimitiveIdBug();
85 
90  static bool HaveAppleQueryAllocationBug();
91 
97  bool IsDualDepthPeelingSupported();
98 
99 protected:
101  ~vtkOpenGLRenderer() override;
102 
106  void CheckCompilation(unsigned int fragmentShader);
107 
108  // Internal method to release graphics resources in any derived renderers.
109  void ReleaseGraphicsResources(vtkWindow *w) override;
110 
116  int UpdateGeometry() override;
117 
118  // Picking functions to be implemented by sub-classes
119  void DevicePickRender() override;
120  void StartPick(unsigned int pickFromSize) override;
121  void UpdatePickId() override;
122  void DonePick() override;
123  unsigned int GetPickedId() override;
124  unsigned int GetNumPickedIds() override;
125  int GetPickedIds(unsigned int atMost, unsigned int *callerBuffer) override;
126  double GetPickedZ() override;
127 
128  // Ivars used in picking
129  class vtkGLPickInfo* PickInfo;
130 
131  double PickedZ;
132 
133  friend class vtkOpenGLProperty;
134  friend class vtkOpenGLTexture;
135  friend class vtkOpenGLImageSliceMapper;
136  friend class vtkOpenGLImageResliceMapper;
137 
142 
147 
152 
153  // Is rendering at translucent geometry stage using depth peeling and
154  // rendering a layer other than the first one? (Boolean value)
155  // If so, the uniform variables UseTexture and Texture can be set.
156  // (Used by vtkOpenGLProperty or vtkOpenGLTexture)
157  int DepthPeelingHigherLayer;
158 
159  friend class vtkRenderPass;
160 
163 
164 private:
165  vtkOpenGLRenderer(const vtkOpenGLRenderer&) = delete;
166  void operator=(const vtkOpenGLRenderer&) = delete;
167 };
168 
169 #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:873
abstract specification for renderers
Definition: vtkRenderer.h:63
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
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:37
vtkOpenGLFXAAFilter * FXAAFilter
FXAA is delegated to an instance of vtkOpenGLFXAAFilter.
virtual void DeviceRender()=0
Create an image.
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:326