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

Rendering/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 =========================================================================*/
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_RENDERING_EXPORT vtkVolumeTextureMapper : public vtkVolumeMapper
00038 {
00039 public:
00040   vtkTypeRevisionMacro(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 //BTX
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, float, 3 );
00074   vtkGetVectorMacro( DataSpacing, float, 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 //ETX
00093 
00094 
00095 
00096 protected:
00097   vtkVolumeTextureMapper();
00098   ~vtkVolumeTextureMapper();
00099 
00100   void InitializeRender( vtkRenderer *ren, vtkVolume *vol );
00101 
00102   // Objects / variables  needed for shading / gradient magnitude opacity
00103   vtkEncodedGradientEstimator  *GradientEstimator;
00104   vtkEncodedGradientShader     *GradientShader;
00105   int                          Shade;
00106 
00107   float          *GradientOpacityArray;
00108   unsigned char  *RGBAArray;
00109   int            ArraySize;
00110 
00111   float          *RedDiffuseShadingTable;
00112   float          *GreenDiffuseShadingTable;
00113   float          *BlueDiffuseShadingTable;
00114   float          *RedSpecularShadingTable;
00115   float          *GreenSpecularShadingTable;
00116   float          *BlueSpecularShadingTable;
00117 
00118   float          DataOrigin[3];
00119   float          DataSpacing[3];
00120 
00121   unsigned short *EncodedNormals;
00122   unsigned char  *GradientMagnitudes;
00123 
00124   float          SampleDistance;
00125   
00126   vtkRenderWindow *RenderWindow;
00127 private:
00128   vtkVolumeTextureMapper(const vtkVolumeTextureMapper&);  // Not implemented.
00129   void operator=(const vtkVolumeTextureMapper&);  // Not implemented.
00130 };
00131 
00132 
00133 #endif
00134 
00135