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;
102  friend class vtkOpenGLImageActor;
103  //ETX
104 
107  int GetUseTextureUniformVariable();
108 
111  int GetTextureUniformVariable();
112 
116 
120 
122  vtkOpenGLRendererLayerList *LayerList;
123 
124  unsigned int OpaqueLayerZ;
125  unsigned int TransparentLayerZ;
126  unsigned int ProgramShader;
127 
129 
135 
138  unsigned int DepthFormat;
139 
140  // Is rendering at translucent geometry stage using depth peeling and
141  // rendering a layer other than the first one? (Boolean value)
142  // If so, the uniform variables UseTexture and Texture can be set.
143  // (Used by vtkOpenGLProperty or vtkOpenGLTexture)
145 
147 
148 private:
149  vtkOpenGLRenderer(const vtkOpenGLRenderer&); // Not implemented.
150  void operator=(const vtkOpenGLRenderer&); // Not implemented.
151 };
152 
153 #endif