Rendering/vtkVolumeTextureMapper.h Source File

Main Page Class Hierarchy Alphabetical List Compound List File List Compound 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   Language:  C++
    00006
    00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
    00008   All rights reserved.
    00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
    00010
    00011      This software is distributed WITHOUT ANY WARRANTY; without even
    00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
    00013      PURPOSE.  See the above copyright notice for more information.
    00014
    00015 =========================================================================*/
    00040 #ifndef __vtkVolumeTextureMapper_h
    00041 #define __vtkVolumeTextureMapper_h
    00042
    00043 #include "vtkVolumeMapper.h"
    00044
    00045 class vtkEncodedGradientEstimator;
    00046 class vtkEncodedGradientShader;
    00047 class vtkRenderWindow;
    00048 class vtkRenderer;
    00049 class vtkVolume;
    00050
    00051 class VTK_RENDERING_EXPORT vtkVolumeTextureMapper : public vtkVolumeMapper
    00052 {
    00053 public:
    00054   vtkTypeRevisionMacro(vtkVolumeTextureMapper,vtkVolumeMapper);
    00055   void PrintSelf( ostream& os, vtkIndent indent );
    00056
    00058   virtual void Update();
    00059
    00061
    00062   virtual void SetGradientEstimator( vtkEncodedGradientEstimator *gradest );
    00063   vtkGetObjectMacro( GradientEstimator, vtkEncodedGradientEstimator );
    00065
    00067
    00068   vtkGetObjectMacro( GradientShader, vtkEncodedGradientShader );
    00070
    00071 //BTX
    00073   /*! Allow access to the arrays / variables from the templated functions
    00074       in the subclasses. */
    00075   float *GetGradientOpacityArray(){return this->GradientOpacityArray;};
    00076   unsigned char *GetRGBAArray(){return this->RGBAArray;};
    00077   float *GetRedDiffuseShadingTable(){return this->RedDiffuseShadingTable;};
    00078   float *GetGreenDiffuseShadingTable(){return this->GreenDiffuseShadingTable;};
    00079   float *GetBlueDiffuseShadingTable(){return this->BlueDiffuseShadingTable;};
    00080   float *GetRedSpecularShadingTable(){return this->RedSpecularShadingTable;};
    00081   float *GetGreenSpecularShadingTable(){return this->GreenSpecularShadingTable;};
    00082   float *GetBlueSpecularShadingTable(){return this->BlueSpecularShadingTable;};
    00083   unsigned short *GetEncodedNormals(){return this->EncodedNormals;};
    00084   unsigned char *GetGradientMagnitudes(){return this->GradientMagnitudes;};
    00085   vtkGetMacro( Shade, int );
    00086   vtkGetObjectMacro( RenderWindow, vtkRenderWindow );
    00087   vtkGetVectorMacro( DataOrigin, float, 3 );
    00088   vtkGetVectorMacro( DataSpacing, float, 3 );
    00090
    00093   virtual void Render(vtkRenderer *ren, vtkVolume *vol)=0;
    00094
    00096
    00098   virtual float GetGradientMagnitudeScale();
    00099   virtual float GetGradientMagnitudeBias();
    00100   virtual float GetGradientMagnitudeScale(int)
    00101     { return this->GetGradientMagnitudeScale(); };
    00102   virtual float GetGradientMagnitudeBias(int)
    00103     { return this->GetGradientMagnitudeBias(); };
    00105
    00106 //ETX
    00107
    00108
    00109
    00110 protected:
    00111   vtkVolumeTextureMapper();
    00112   ~vtkVolumeTextureMapper();
    00113
    00114   void InitializeRender( vtkRenderer *ren, vtkVolume *vol );
    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