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) VTK_OVERRIDE;
43 
47  void DeviceRender(void) VTK_OVERRIDE;
48 
52  void DeviceRenderOpaqueGeometry() VTK_OVERRIDE;
53 
60  void DeviceRenderTranslucentPolygonalGeometry() VTK_OVERRIDE;
61 
62  void Clear(void) VTK_OVERRIDE;
63 
67  int UpdateLights(void) VTK_OVERRIDE;
68 
75  int GetDepthPeelingHigherLayer();
76 
81  bool HaveApplePrimitiveIdBug();
82 
88  bool IsDualDepthPeelingSupported();
89 
90 protected:
92  ~vtkOpenGLRenderer() VTK_OVERRIDE;
93 
97  void CheckCompilation(unsigned int fragmentShader);
98 
99  // Internal method to release graphics resources in any derived renderers.
100  void ReleaseGraphicsResources(vtkWindow *w) VTK_OVERRIDE;
101 
107  int UpdateGeometry() VTK_OVERRIDE;
108 
109  // Picking functions to be implemented by sub-classes
110  void DevicePickRender() VTK_OVERRIDE;
111  void StartPick(unsigned int pickFromSize) VTK_OVERRIDE;
112  void UpdatePickId() VTK_OVERRIDE;
113  void DonePick() VTK_OVERRIDE;
114  unsigned int GetPickedId() VTK_OVERRIDE;
115  unsigned int GetNumPickedIds() VTK_OVERRIDE;
116  int GetPickedIds(unsigned int atMost, unsigned int *callerBuffer) VTK_OVERRIDE;
117  double GetPickedZ() VTK_OVERRIDE;
118 
119  // Ivars used in picking
120  class vtkGLPickInfo* PickInfo;
121 
122  double PickedZ;
123 
124  friend class vtkOpenGLProperty;
125  friend class vtkOpenGLTexture;
126  friend class vtkOpenGLImageSliceMapper;
127  friend class vtkOpenGLImageResliceMapper;
128 
132  vtkOpenGLFXAAFilter *FXAAFilter;
133 
137  vtkDepthPeelingPass *DepthPeelingPass;
138 
142  vtkShadowMapPass *ShadowMapPass;
143 
144  // Is rendering at translucent geometry stage using depth peeling and
145  // rendering a layer other than the first one? (Boolean value)
146  // If so, the uniform variables UseTexture and Texture can be set.
147  // (Used by vtkOpenGLProperty or vtkOpenGLTexture)
148  int DepthPeelingHigherLayer;
149 
150  friend class vtkRenderPass;
151 
152  bool HaveApplePrimitiveIdBugValue;
153  bool HaveApplePrimitiveIdBugChecked;
154 
155 private:
156  vtkOpenGLRenderer(const vtkOpenGLRenderer&) VTK_DELETE_FUNCTION;
157  void operator=(const vtkOpenGLRenderer&) VTK_DELETE_FUNCTION;
158 };
159 
160 #endif
Implement an Order Independent Transparency render pass.
abstract specification for renderers
Definition: vtkRenderer.h:57
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
OpenGL property.
OpenGL mapper for image slice display.
OpenGL texture map.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
virtual void DeviceRender()=0
Create an image.
a simple class to control print indentation
Definition: vtkIndent.h:33
virtual void DeviceRenderOpaqueGeometry()
Render opaque polygonal geometry.
abstracts an OpenGL texture object.
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.
Perform FXAA antialiasing on the current framebuffer.
Perform part of the rendering of a vtkRenderer.
Definition: vtkRenderPass.h:55
OpenGL renderer.