Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkVolumeTextureMapper.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkVolumeTextureMapper.h,v $
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00037 #ifndef __vtkVolumeTextureMapper_h
00038 #define __vtkVolumeTextureMapper_h
00039 
00040 #include "vtkVolumeMapper.h"
00041 
00042 class vtkEncodedGradientEstimator;
00043 class vtkEncodedGradientShader;
00044 class vtkRenderWindow;
00045 class vtkRenderer;
00046 class vtkVolume;
00047 
00048 class VTK_RENDERING_EXPORT vtkVolumeTextureMapper : public vtkVolumeMapper
00049 {
00050 public:
00051   vtkTypeRevisionMacro(vtkVolumeTextureMapper,vtkVolumeMapper);
00052   void PrintSelf( ostream& os, vtkIndent indent );
00053 
00055   virtual void Update();
00056 
00058 
00059   virtual void SetGradientEstimator( vtkEncodedGradientEstimator *gradest );
00060   vtkGetObjectMacro( GradientEstimator, vtkEncodedGradientEstimator );
00062 
00064 
00065   vtkGetObjectMacro( GradientShader, vtkEncodedGradientShader );
00067 
00068 //BTX
00070 
00072   float *GetGradientOpacityArray(){return this->GradientOpacityArray;};
00073   unsigned char *GetRGBAArray(){return this->RGBAArray;};
00074   float *GetRedDiffuseShadingTable(){return this->RedDiffuseShadingTable;};
00075   float *GetGreenDiffuseShadingTable(){return this->GreenDiffuseShadingTable;};
00076   float *GetBlueDiffuseShadingTable(){return this->BlueDiffuseShadingTable;};
00077   float *GetRedSpecularShadingTable(){return this->RedSpecularShadingTable;};
00078   float *GetGreenSpecularShadingTable(){return this->GreenSpecularShadingTable;};
00079   float *GetBlueSpecularShadingTable(){return this->BlueSpecularShadingTable;};
00080   unsigned short *GetEncodedNormals(){return this->EncodedNormals;};
00081   unsigned char *GetGradientMagnitudes(){return this->GradientMagnitudes;};
00082   vtkGetMacro( Shade, int );
00083   vtkGetObjectMacro( RenderWindow, vtkRenderWindow );
00084   vtkGetVectorMacro( DataOrigin, float, 3 );
00085   vtkGetVectorMacro( DataSpacing, float, 3 );
00087 
00090   virtual void Render(vtkRenderer *ren, vtkVolume *vol)=0;
00091 
00093 
00095   virtual float GetGradientMagnitudeScale();
00096   virtual float GetGradientMagnitudeBias();
00097   virtual float GetGradientMagnitudeScale(int)
00098     { return this->GetGradientMagnitudeScale(); };
00099   virtual float GetGradientMagnitudeBias(int)
00100     { return this->GetGradientMagnitudeBias(); };
00102   
00103 //ETX
00104 
00105 
00106 
00107 protected:
00108   vtkVolumeTextureMapper();
00109   ~vtkVolumeTextureMapper();
00110 
00111   void InitializeRender( vtkRenderer *ren, vtkVolume *vol );
00112 
00113   virtual void ReportReferences(vtkGarbageCollector*);
00114   virtual void RemoveReferences();
00115 
00116   // Objects / variables  needed for shading / gradient magnitude opacity
00117   vtkEncodedGradientEstimator  *GradientEstimator;
00118   vtkEncodedGradientShader     *GradientShader;
00119   int                          Shade;
00120 
00121   float          *GradientOpacityArray;
00122   unsigned char  *RGBAArray;
00123   int            ArraySize;
00124 
00125   float          *RedDiffuseShadingTable;
00126   float          *GreenDiffuseShadingTable;
00127   float          *BlueDiffuseShadingTable;
00128   float          *RedSpecularShadingTable;
00129   float          *GreenSpecularShadingTable;
00130   float          *BlueSpecularShadingTable;
00131 
00132   float          DataOrigin[3];
00133   float          DataSpacing[3];
00134 
00135   unsigned short *EncodedNormals;
00136   unsigned char  *GradientMagnitudes;
00137 
00138   float          SampleDistance;
00139   
00140   vtkRenderWindow *RenderWindow;
00141 private:
00142   vtkVolumeTextureMapper(const vtkVolumeTextureMapper&);  // Not implemented.
00143   void operator=(const vtkVolumeTextureMapper&);  // Not implemented.
00144 };
00145 
00146 
00147 #endif
00148 
00149