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 "vtkRenderer.h"
26 
27 class vtkOpenGLRendererLayerList; // Pimpl
28 class vtkShaderProgram2;
29 
31 {
32 protected:
34 
35 public:
36  static vtkOpenGLRenderer *New();
38  void PrintSelf(ostream& os, vtkIndent indent);
39 
41  void DeviceRender(void);
42 
47 
50  void ClearLights(void);
51 
52  void Clear(void);
53 
55  int UpdateLights(void);
56 
61  int GetDepthPeelingHigherLayer();
62 
63  //BTX
65  */
66  vtkGetObjectMacro(ShaderProgram,vtkShaderProgram2);
67  virtual void SetShaderProgram(vtkShaderProgram2 *program);
68  //ETX
70 
71 protected:
74 
76  void CheckCompilation(unsigned int fragmentShader);
77 
78  //BTX
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  // Ivars used in picking
89  class vtkGLPickInfo* PickInfo;
90  //ETX
91  double PickedZ;
92 
97  int RenderPeel(int layer);
98 
99  //BTX
100  friend class vtkOpenGLProperty;
101  friend class vtkOpenGLTexture;
103  friend class vtkOpenGLImageResliceMapper;
104  //ETX
105 
108  int GetUseTextureUniformVariable();
109 
112  int GetTextureUniformVariable();
113 
117 
121 
123  vtkOpenGLRendererLayerList *LayerList;
124 
125  unsigned int OpaqueLayerZ;
126  unsigned int TransparentLayerZ;
127  unsigned int ProgramShader;
128 
130 
136 
139  unsigned int DepthFormat;
140 
141  // Is rendering at translucent geometry stage using depth peeling and
142  // rendering a layer other than the first one? (Boolean value)
143  // If so, the uniform variables UseTexture and Texture can be set.
144  // (Used by vtkOpenGLProperty or vtkOpenGLTexture)
146 
148 
149 private:
150  vtkOpenGLRenderer(const vtkOpenGLRenderer&); // Not implemented.
151  void operator=(const vtkOpenGLRenderer&); // Not implemented.
152 };
153 
154 #endif