00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00036
#ifndef __vtkEncodedGradientShader_h
00037
#define __vtkEncodedGradientShader_h
00038
00039
#include "vtkObject.h"
00040
00041
class vtkVolume;
00042
class vtkRenderer;
00043
class vtkEncodedGradientEstimator;
00044
00045 #define VTK_MAX_SHADING_TABLES 100
00046
00047 class VTK_RENDERING_EXPORT vtkEncodedGradientShader :
public vtkObject
00048 {
00049
public:
00050
static vtkEncodedGradientShader *
New();
00051 vtkTypeRevisionMacro(vtkEncodedGradientShader,
vtkObject);
00052
00054
void PrintSelf( ostream& os,
vtkIndent indent );
00055
00057
00059 vtkSetClampMacro( ZeroNormalDiffuseIntensity,
float, 0.0, 1.0);
00060 vtkGetMacro( ZeroNormalDiffuseIntensity,
float );
00061 vtkSetClampMacro( ZeroNormalSpecularIntensity,
float, 0.0, 1.0);
00062 vtkGetMacro( ZeroNormalSpecularIntensity,
float );
00064
00066
00067
void UpdateShadingTable(
vtkRenderer *ren,
vtkVolume *vol,
00068
vtkEncodedGradientEstimator *gradest);
00070
00072
00073
float *GetRedDiffuseShadingTable(
vtkVolume *vol );
00074
float *GetGreenDiffuseShadingTable(
vtkVolume *vol );
00075
float *GetBlueDiffuseShadingTable(
vtkVolume *vol );
00076
float *GetRedSpecularShadingTable(
vtkVolume *vol );
00077
float *GetGreenSpecularShadingTable(
vtkVolume *vol );
00078
float *GetBlueSpecularShadingTable(
vtkVolume *vol );
00080
00081
protected:
00082 vtkEncodedGradientShader();
00083 ~vtkEncodedGradientShader();
00084
00086
00098
void BuildShadingTable(
int index,
00099
float lightDirection[3],
00100
float lightColor[3],
00101
float lightIntensity,
00102
float viewDirection[3],
00103
float material[4],
00104
int twoSided,
00105
vtkEncodedGradientEstimator *gradest,
00106
int updateFlag );
00108
00109
00110
00111
00112
00113
00114 float *ShadingTable[
VTK_MAX_SHADING_TABLES][6];
00115 vtkVolume *ShadingTableVolume[
VTK_MAX_SHADING_TABLES];
00116 int ShadingTableSize[
VTK_MAX_SHADING_TABLES];
00117
00118
00119
00120 float ZeroNormalDiffuseIntensity;
00121 float ZeroNormalSpecularIntensity;
00122
private:
00123 vtkEncodedGradientShader(
const vtkEncodedGradientShader&);
00124
void operator=(
const vtkEncodedGradientShader&);
00125 };
00126
00127
00128
#endif