00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00117 #ifndef __vtkOpenGLHAVSVolumeMapper_h
00118 #define __vtkOpenGLHAVSVolumeMapper_h
00119
00120 #include "vtkHAVSVolumeMapper.h"
00121
00122 #include <vtkWeakPointer.h>
00123 class vtkRenderer;
00124 class vtkRenderWindow;
00125
00126
00127 class VTK_VOLUMERENDERING_EXPORT vtkOpenGLHAVSVolumeMapper : public vtkHAVSVolumeMapper
00128 {
00129 public:
00130 static vtkOpenGLHAVSVolumeMapper *New();
00131 vtkTypeMacro(vtkOpenGLHAVSVolumeMapper,
00132 vtkHAVSVolumeMapper);
00133 virtual void PrintSelf(ostream& os, vtkIndent indent);
00134
00136 virtual void Render(vtkRenderer *ren, vtkVolume *vol);
00137
00140 virtual void ReleaseGraphicsResources(vtkWindow *);
00141
00144 virtual void SetGPUDataStructures(bool);
00145
00150 virtual bool SupportedByHardware(vtkRenderer *r);
00151 protected:
00152
00153 vtkOpenGLHAVSVolumeMapper();
00154 ~vtkOpenGLHAVSVolumeMapper();
00155 virtual int FillInputPortInformation(int port, vtkInformation* info);
00156
00157
00158 virtual void Initialize(vtkRenderer *ren, vtkVolume *vol);
00159 virtual void InitializeLookupTables(vtkVolume *vol);
00160 void InitializeGPUDataStructures();
00161 void InitializeShaders();
00162 void DeleteShaders();
00163 void InitializeFramebufferObject();
00164
00165 void RenderHAVS(vtkRenderer *ren);
00166 void SetupFBOZBuffer(int screenWidth, int screenHeight, float depthNear, float depthFar,
00167 float *zbuffer);
00168 void SetupFBOMRT();
00169 void DrawFBOInit(int screenWidth, int screenHeight, float depthNear, float depthFar);
00170 void DrawFBOGeometry();
00171 void DrawFBOFlush(int screenWidth, int screenHeight, float depthNear, float depthFar);
00172 void DrawBlend(int screenWidth, int screenHeight, float depthNear, float depthFar);
00173
00174 void CheckOpenGLError(const char *str);
00175
00176
00177 unsigned int VBOVertexName;
00178 unsigned int VBOTexCoordName;
00179 unsigned int VBOVertexIndexName;
00180 unsigned int VertexProgram;
00181 unsigned int FragmentProgramBegin;
00182 unsigned int FragmentProgram;
00183 unsigned int FragmentProgramEnd;
00184 unsigned int FramebufferObject;
00185 int FramebufferObjectSize;
00186 unsigned int FramebufferTextures[4];
00187 unsigned int DepthTexture;
00188
00189
00190 unsigned int PsiTableTexture;
00191 unsigned int TransferFunctionTexture;
00192
00193 vtkWeakPointer<vtkRenderWindow> RenderWindow;
00194
00195
00196 private:
00197 vtkOpenGLHAVSVolumeMapper(const vtkOpenGLHAVSVolumeMapper&);
00198 void operator=(const vtkOpenGLHAVSVolumeMapper&);
00199 };
00200
00201 #endif