VTK
vtkOpenGLHAVSVolumeMapper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3 Program: Visualization Toolkit
4 Module: vtkOpenGLHAVSVolumeMapper.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 =========================================================================*/
15 
16 /* Copyright 2005, 2006 by University of Utah. */
17 
117 #ifndef vtkOpenGLHAVSVolumeMapper_h
118 #define vtkOpenGLHAVSVolumeMapper_h
119 
120 #include "vtkRenderingVolumeOpenGLModule.h" // For export macro
121 #include "vtkHAVSVolumeMapper.h"
122 
123 #include "vtkWeakPointer.h" // to cache the vtkRenderWindow
124 class vtkRenderer;
125 class vtkRenderWindow;
126 
127 
129  : public vtkHAVSVolumeMapper
130 {
131 public:
132  static vtkOpenGLHAVSVolumeMapper *New();
133  vtkTypeMacro(vtkOpenGLHAVSVolumeMapper,
135  virtual void PrintSelf(ostream& os, vtkIndent indent);
136 
138  virtual void Render(vtkRenderer *ren, vtkVolume *vol);
139 
142  virtual void ReleaseGraphicsResources(vtkWindow *);
143 
146  virtual void SetGPUDataStructures(bool);
147 
149 
153  virtual bool SupportedByHardware(vtkRenderer *r);
154 protected:
156 
160 
161 //BTX
162  virtual void Initialize(vtkRenderer *ren, vtkVolume *vol);
163  virtual void InitializeLookupTables(vtkVolume *vol);
164  void InitializeGPUDataStructures();
165  void InitializeShaders();
166  void DeleteShaders();
167  void InitializeFramebufferObject();
168 
169  void RenderHAVS(vtkRenderer *ren);
170  void SetupFBOZBuffer(int screenWidth, int screenHeight, float depthNear, float depthFar,
171  float *zbuffer);
172  void SetupFBOMRT();
173  void DrawFBOInit(int screenWidth, int screenHeight, float depthNear, float depthFar);
174  void DrawFBOGeometry();
175  void DrawFBOFlush(int screenWidth, int screenHeight, float depthNear, float depthFar);
176  void DrawBlend(int screenWidth, int screenHeight, float depthNear, float depthFar);
177 
178  void CheckOpenGLError(const char *str);
179 
180  // GPU
181  unsigned int VBOVertexName;
182  unsigned int VBOTexCoordName;
183  unsigned int VBOVertexIndexName;
184  unsigned int VertexProgram;
185  unsigned int FragmentProgramBegin;
186  unsigned int FragmentProgram;
187  unsigned int FragmentProgramEnd;
188  unsigned int FramebufferObject;
190  unsigned int FramebufferTextures[4];
191  unsigned int DepthTexture;
192 
193  // Lookup Tables
194  unsigned int PsiTableTexture;
196 
198 //ETX
199 
200 private:
201  vtkOpenGLHAVSVolumeMapper(const vtkOpenGLHAVSVolumeMapper&); // Not implemented.
202  void operator=(const vtkOpenGLHAVSVolumeMapper&); // Not implemented.
203 };
204 
205 #endif
virtual void PrintSelf(ostream &os, vtkIndent indent)
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:49
#define VTKRENDERINGVOLUMEOPENGL_EXPORT
void InitializeLookupTables(vtkVolume *vol)
virtual void Render(vtkRenderer *ren, vtkVolume *vol)=0
virtual int FillInputPortInformation(int, vtkInformation *)
Store vtkAlgorithm input/output information.
vtkWeakPointer< vtkRenderWindow > RenderWindow
virtual bool SupportedByHardware(vtkRenderer *vtkNotUsed(r))
abstract specification for renderers
Definition: vtkRenderer.h:63
static vtkHAVSVolumeMapper * New()
virtual void Initialize(vtkRenderer *ren, vtkVolume *vol)=0
virtual void SetGPUDataStructures(bool)=0
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
a simple class to control print indentation
Definition: vtkIndent.h:38
create a window for renderers to draw into
Hardware-Assisted Visibility Sorting unstructured grid mapper, OpenGL implementation.
virtual void ReleaseGraphicsResources(vtkWindow *)
Hardware-Assisted Visibility Sorting unstructured grid mapper.