00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00026 #ifndef __vtkVolumeTextureMapper_h
00027 #define __vtkVolumeTextureMapper_h
00028
00029 #include "vtkVolumeMapper.h"
00030
00031 class vtkEncodedGradientEstimator;
00032 class vtkEncodedGradientShader;
00033 class vtkRenderWindow;
00034 class vtkRenderer;
00035 class vtkVolume;
00036
00037 class VTK_VOLUMERENDERING_EXPORT vtkVolumeTextureMapper : public vtkVolumeMapper
00038 {
00039 public:
00040 vtkTypeMacro(vtkVolumeTextureMapper,vtkVolumeMapper);
00041 void PrintSelf( ostream& os, vtkIndent indent );
00042
00044 virtual void Update();
00045
00047
00048 virtual void SetGradientEstimator( vtkEncodedGradientEstimator *gradest );
00049 vtkGetObjectMacro( GradientEstimator, vtkEncodedGradientEstimator );
00051
00053
00054 vtkGetObjectMacro( GradientShader, vtkEncodedGradientShader );
00056
00057
00059
00061 float *GetGradientOpacityArray(){return this->GradientOpacityArray;};
00062 unsigned char *GetRGBAArray(){return this->RGBAArray;};
00063 float *GetRedDiffuseShadingTable(){return this->RedDiffuseShadingTable;};
00064 float *GetGreenDiffuseShadingTable(){return this->GreenDiffuseShadingTable;};
00065 float *GetBlueDiffuseShadingTable(){return this->BlueDiffuseShadingTable;};
00066 float *GetRedSpecularShadingTable(){return this->RedSpecularShadingTable;};
00067 float *GetGreenSpecularShadingTable(){return this->GreenSpecularShadingTable;};
00068 float *GetBlueSpecularShadingTable(){return this->BlueSpecularShadingTable;};
00069 unsigned short *GetEncodedNormals(){return this->EncodedNormals;};
00070 unsigned char *GetGradientMagnitudes(){return this->GradientMagnitudes;};
00071 vtkGetMacro( Shade, int );
00072 vtkGetObjectMacro( RenderWindow, vtkRenderWindow );
00073 vtkGetVectorMacro( DataOrigin, double, 3 );
00074 vtkGetVectorMacro( DataSpacing, double, 3 );
00076
00079 virtual void Render(vtkRenderer *ren, vtkVolume *vol)=0;
00080
00082
00084 virtual float GetGradientMagnitudeScale();
00085 virtual float GetGradientMagnitudeBias();
00086 virtual float GetGradientMagnitudeScale(int)
00087 { return this->GetGradientMagnitudeScale(); };
00088 virtual float GetGradientMagnitudeBias(int)
00089 { return this->GetGradientMagnitudeBias(); };
00091
00092
00093
00094
00095
00096 protected:
00097 vtkVolumeTextureMapper();
00098 ~vtkVolumeTextureMapper();
00099
00100 void InitializeRender( vtkRenderer *ren, vtkVolume *vol );
00101
00102 virtual void ReportReferences(vtkGarbageCollector*);
00103
00104
00105 vtkEncodedGradientEstimator *GradientEstimator;
00106 vtkEncodedGradientShader *GradientShader;
00107 int Shade;
00108
00109 float *GradientOpacityArray;
00110 unsigned char *RGBAArray;
00111 int ArraySize;
00112 int NumberOfComponents;
00113
00114 float *RedDiffuseShadingTable;
00115 float *GreenDiffuseShadingTable;
00116 float *BlueDiffuseShadingTable;
00117 float *RedSpecularShadingTable;
00118 float *GreenSpecularShadingTable;
00119 float *BlueSpecularShadingTable;
00120
00121 double DataOrigin[3];
00122 double DataSpacing[3];
00123
00124 unsigned short *EncodedNormals;
00125 unsigned char *GradientMagnitudes;
00126
00127 float SampleDistance;
00128
00129 vtkRenderWindow *RenderWindow;
00130 private:
00131 vtkVolumeTextureMapper(const vtkVolumeTextureMapper&);
00132 void operator=(const vtkVolumeTextureMapper&);
00133 };
00134
00135
00136 #endif
00137
00138