Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef __vtkMitkOpenGLVolumeTextureMapper3D_h
00028 #define __vtkMitkOpenGLVolumeTextureMapper3D_h
00029
00030 #include "vtkMitkVolumeTextureMapper3D.h"
00031 #include "MitkExtExports.h"
00032
00033 #ifndef VTK_IMPLEMENT_MESA_CXX
00034 # include "vtkOpenGL.h"
00035 #endif
00036
00037
00038 class vtkRenderWindow;
00039 class vtkVolumeProperty;
00040
00041 #include "mitkCommon.h"
00042
00043 class MitkExt_EXPORT vtkMitkOpenGLVolumeTextureMapper3D : public vtkMitkVolumeTextureMapper3D
00044 {
00045 public:
00046 vtkTypeRevisionMacro(vtkMitkOpenGLVolumeTextureMapper3D,vtkMitkVolumeTextureMapper3D);
00047 void PrintSelf(ostream& os, vtkIndent indent);
00048
00049 static vtkMitkOpenGLVolumeTextureMapper3D *New();
00050
00051
00052
00053
00054
00055
00056 int IsRenderSupported(vtkRenderer *ren,vtkVolumeProperty *);
00057
00058
00059
00060
00061
00062
00063
00064 virtual void Render(vtkRenderer *ren, vtkVolume *vol);
00065
00066
00067
00068
00069
00070
00071
00072 vtkGetMacro( Initialized, int );
00073
00074
00075
00076
00077
00078 void ReleaseGraphicsResources(vtkWindow *);
00079
00080 protected:
00081 vtkMitkOpenGLVolumeTextureMapper3D();
00082 ~vtkMitkOpenGLVolumeTextureMapper3D();
00083
00084 bool RenderPossible;
00085
00086
00087
00088 void GetLightInformation(vtkRenderer *ren,
00089 vtkVolume *vol,
00090 GLfloat lightDirection[2][4],
00091 GLfloat lightDiffuseColor[2][4],
00092 GLfloat lightSpecularColor[2][4],
00093 GLfloat halfwayVector[2][4],
00094 GLfloat *ambient );
00095
00096
00097 int Initialized;
00098 GLuint Volume1Index;
00099 GLuint Volume2Index;
00100 GLuint Volume3Index;
00101 GLuint ColorLookupIndex;
00102 GLuint AlphaLookupIndex;
00103
00104 GLuint prgOneComponentShade;
00105 GLuint prgRGBAShade;
00106
00107 vtkRenderWindow *RenderWindow;
00108
00109 bool SupportsCompressedTexture;
00110
00111
00112 void Initialize(vtkRenderer *r);
00113
00114 virtual void RenderFP(vtkRenderer *ren, vtkVolume *vol);
00115
00116 void SetupOneIndependentTextures( vtkRenderer *ren, vtkVolume *vol );
00117 void RenderOneIndependentShadeFP( vtkRenderer *ren, vtkVolume *vol );
00118
00119 void SetupRGBATextures( vtkRenderer *ren, vtkVolume *vol );
00120 void RenderRGBAShadeFP( vtkRenderer *ren, vtkVolume *vol );
00121
00122 void DeleteTextureIndex( GLuint *index );
00123 void CreateTextureIndex( GLuint *index );
00124
00125 void RenderPolygons( vtkRenderer *ren, vtkVolume *vol, int stages[4] );
00126
00127 void SetupProgramLocalsForShadingFP( vtkRenderer *ren, vtkVolume *vol );
00128
00129 void Setup3DTextureParameters( bool linear );
00130
00131 void ComputeVolumeDimensions();
00132
00133 bool UpdateVolumes( vtkVolume * );
00134
00135 bool UpdateVolumesRGBA( vtkVolume * );
00136
00137 private:
00138 vtkMitkOpenGLVolumeTextureMapper3D(const vtkMitkOpenGLVolumeTextureMapper3D&);
00139 void operator=(const vtkMitkOpenGLVolumeTextureMapper3D&);
00140 };
00141
00142
00143 #endif
00144
00145
00146