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 class vtkRenderer;
00123
00124
00125 class VTK_VOLUMERENDERING_EXPORT vtkOpenGLHAVSVolumeMapper : public vtkHAVSVolumeMapper
00126 {
00127 public:
00128 static vtkOpenGLHAVSVolumeMapper *New();
00129 vtkTypeRevisionMacro(vtkOpenGLHAVSVolumeMapper,
00130 vtkHAVSVolumeMapper);
00131 virtual void PrintSelf(ostream& os, vtkIndent indent);
00132
00134 virtual void Render(vtkRenderer *ren, vtkVolume *vol);
00135
00138 virtual void ReleaseGraphicsResources(vtkWindow *);
00139
00142 virtual void SetGPUDataStructures(bool);
00143
00148 virtual bool SupportedByHardware();
00149 protected:
00150
00151 vtkOpenGLHAVSVolumeMapper();
00152 ~vtkOpenGLHAVSVolumeMapper();
00153 virtual int FillInputPortInformation(int port, vtkInformation* info);
00154
00155
00156 virtual void Initialize(vtkRenderer *ren, vtkVolume *vol);
00157 virtual void InitializeLookupTables(vtkVolume *vol);
00158 void InitializeGPUDataStructures();
00159 void InitializeShaders();
00160 void DeleteShaders();
00161 void InitializeFramebufferObject();
00162
00163 void RenderHAVS(vtkRenderer *ren);
00164 void SetupFBOZBuffer(int screenWidth, int screenHeight, float depthNear, float depthFar,
00165 float *zbuffer);
00166 void SetupFBOMRT();
00167 void DrawFBOInit(int screenWidth, int screenHeight, float depthNear, float depthFar);
00168 void DrawFBOGeometry();
00169 void DrawFBOFlush(int screenWidth, int screenHeight, float depthNear, float depthFar);
00170 void DrawBlend(int screenWidth, int screenHeight, float depthNear, float depthFar);
00171
00172 void CheckOpenGLError(const char *str);
00173
00174
00175 unsigned int VBOVertexName;
00176 unsigned int VBOTexCoordName;
00177 unsigned int VBOVertexIndexName;
00178 unsigned int VertexProgram;
00179 unsigned int FragmentProgramBegin;
00180 unsigned int FragmentProgram;
00181 unsigned int FragmentProgramEnd;
00182 unsigned int FramebufferObject;
00183 int FramebufferObjectSize;
00184 unsigned int FramebufferTextures[4];
00185 unsigned int DepthTexture;
00186
00187
00188 unsigned int PsiTableTexture;
00189 unsigned int TransferFunctionTexture;
00190
00191
00192 private:
00193 vtkOpenGLHAVSVolumeMapper(const vtkOpenGLHAVSVolumeMapper&);
00194 void operator=(const vtkOpenGLHAVSVolumeMapper&);
00195 };
00196
00197 #endif