Rendering/vtkEncodedGradientShader.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00048 #ifndef __vtkEncodedGradientShader_h
00049 #define __vtkEncodedGradientShader_h
00050
00051 #include "vtkObject.h"
00052
00053 class vtkVolume;
00054 class vtkRenderer;
00055 class vtkEncodedGradientEstimator;
00056
00057 #define VTK_MAX_SHADING_TABLES 100
00058
00059 class VTK_RENDERING_EXPORT vtkEncodedGradientShader : public vtkObject
00060 {
00061 public:
00062 static vtkEncodedGradientShader *New();
00063 vtkTypeRevisionMacro(vtkEncodedGradientShader,vtkObject);
00064
00066 void PrintSelf( ostream& os, vtkIndent indent );
00067
00069
00071 vtkSetClampMacro( ZeroNormalDiffuseIntensity, float, 0.0, 1.0);
00072 vtkGetMacro( ZeroNormalDiffuseIntensity, float );
00073 vtkSetClampMacro( ZeroNormalSpecularIntensity, float, 0.0, 1.0);
00074 vtkGetMacro( ZeroNormalSpecularIntensity, float );
00076
00078
00079 void UpdateShadingTable( vtkRenderer *ren, vtkVolume *vol,
00080 vtkEncodedGradientEstimator *gradest);
00082
00084
00085 float *GetRedDiffuseShadingTable( vtkVolume *vol );
00086 float *GetGreenDiffuseShadingTable( vtkVolume *vol );
00087 float *GetBlueDiffuseShadingTable( vtkVolume *vol );
00088 float *GetRedSpecularShadingTable( vtkVolume *vol );
00089 float *GetGreenSpecularShadingTable( vtkVolume *vol );
00090 float *GetBlueSpecularShadingTable( vtkVolume *vol );
00092
00093 protected:
00094 vtkEncodedGradientShader();
00095 ~vtkEncodedGradientShader();
00096
00098
00110 void BuildShadingTable( int index,
00111 float lightDirection[3],
00112 float lightColor[3],
00113 float lightIntensity,
00114 float viewDirection[3],
00115 float material[4],
00116 int twoSided,
00117 vtkEncodedGradientEstimator *gradest,
00118 int updateFlag );
00120
00121
00122
00123
00124
00125
00126 float *ShadingTable[VTK_MAX_SHADING_TABLES][6];
00127 vtkVolume *ShadingTableVolume[VTK_MAX_SHADING_TABLES];
00128 int ShadingTableSize[VTK_MAX_SHADING_TABLES];
00129
00130
00131
00132 float ZeroNormalDiffuseIntensity;
00133 float ZeroNormalSpecularIntensity;
00134 private:
00135 vtkEncodedGradientShader(const vtkEncodedGradientShader&);
00136 void operator=(const vtkEncodedGradientShader&);
00137 };
00138
00139
00140 #endif