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 
00032 #ifndef __vtkEncodedGradientShader_h
00033 #define __vtkEncodedGradientShader_h
00034 
00035 #include "vtkObject.h"
00036 
00037 class vtkVolume;
00038 class vtkRenderer;
00039 class vtkEncodedGradientEstimator;
00040 
00041 #define VTK_MAX_SHADING_TABLES   100
00042 
00043 class VTK_RENDERING_EXPORT vtkEncodedGradientShader : public vtkObject
00044 {
00045 public:
00046   static vtkEncodedGradientShader *New();
00047   vtkTypeRevisionMacro(vtkEncodedGradientShader,vtkObject);
00048 
00050   void PrintSelf( ostream& os, vtkIndent indent );
00051 
00053 
00055   vtkSetClampMacro( ZeroNormalDiffuseIntensity,  float, 0.0, 1.0);
00056   vtkGetMacro( ZeroNormalDiffuseIntensity, float );
00057   vtkSetClampMacro( ZeroNormalSpecularIntensity, float, 0.0, 1.0);
00058   vtkGetMacro( ZeroNormalSpecularIntensity, float );
00060 
00062 
00063   void UpdateShadingTable( vtkRenderer *ren, vtkVolume *vol,
00064                            vtkEncodedGradientEstimator *gradest);
00066 
00068 
00069   float *GetRedDiffuseShadingTable(    vtkVolume *vol );
00070   float *GetGreenDiffuseShadingTable(  vtkVolume *vol );
00071   float *GetBlueDiffuseShadingTable(   vtkVolume *vol );
00072   float *GetRedSpecularShadingTable(   vtkVolume *vol );
00073   float *GetGreenSpecularShadingTable( vtkVolume *vol );
00074   float *GetBlueSpecularShadingTable(  vtkVolume *vol );
00076 
00078 
00081   vtkSetClampMacro( ActiveComponent, int, 0, 3 );
00082   vtkGetMacro( ActiveComponent, int );
00084   
00085 protected:
00086   vtkEncodedGradientShader();
00087   ~vtkEncodedGradientShader();
00088 
00090 
00102   void  BuildShadingTable( int index,
00103                            double lightDirection[3],
00104                            double lightColor[3],
00105                            double lightIntensity,
00106                            double viewDirection[3],
00107                            double material[4],
00108                            int twoSided,
00109                            vtkEncodedGradientEstimator *gradest,
00110                            int updateFlag );
00112   
00113   
00114   
00115   
00116   
00117   
00118   float                        *ShadingTable[VTK_MAX_SHADING_TABLES][6];
00119   vtkVolume                    *ShadingTableVolume[VTK_MAX_SHADING_TABLES];
00120   int                          ShadingTableSize[VTK_MAX_SHADING_TABLES];
00121 
00122   int                          ActiveComponent;
00123   
00124   
00125   
00126   float    ZeroNormalDiffuseIntensity;
00127   float    ZeroNormalSpecularIntensity;
00128 private:
00129   vtkEncodedGradientShader(const vtkEncodedGradientShader&);  
00130   void operator=(const vtkEncodedGradientShader&);  
00131 }; 
00132 
00133 
00134 #endif