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

Rendering/vtkVolumeMapper.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkVolumeMapper.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 =========================================================================*/
00046 #ifndef __vtkVolumeMapper_h
00047 #define __vtkVolumeMapper_h
00048 
00049 #include "vtkAbstractMapper3D.h"
00050 
00051 class vtkRenderer;
00052 class vtkVolume;
00053 class vtkImageData;
00054 
00055 #define VTK_CROP_SUBVOLUME              0x0002000
00056 #define VTK_CROP_FENCE                  0x2ebfeba
00057 #define VTK_CROP_INVERTED_FENCE         0x5140145
00058 #define VTK_CROP_CROSS                  0x0417410
00059 #define VTK_CROP_INVERTED_CROSS         0x7be8bef
00060 
00061 class vtkWindow;
00062 class vtkImageClip;
00063 
00064 class VTK_RENDERING_EXPORT vtkVolumeMapper : public vtkAbstractMapper3D
00065 {
00066 public:
00067   vtkTypeRevisionMacro(vtkVolumeMapper,vtkAbstractMapper3D);
00068   void PrintSelf( ostream& os, vtkIndent indent );
00069 
00071   virtual void Update();
00072 
00074 
00075   virtual void SetInput( vtkImageData * );
00076   vtkImageData *GetInput();
00078 
00080 
00095   vtkSetClampMacro( IndependentComponents, int, 0, 1 );
00096   vtkGetMacro( IndependentComponents, int );
00097   vtkBooleanMacro( IndependentComponents, int );
00099 
00101 
00105   vtkSetClampMacro( ComponentBlendMode, int, 
00106                     vtkVolumeMapper::ComponentBlendAdd,
00107                     vtkVolumeMapper::ComponentBlendMaxOpacity );
00108   vtkGetMacro( ComponentBlendMode, int );
00109   void SetComponentBlendModeToAdd() 
00110     {this->SetComponentBlendMode(vtkVolumeMapper::ComponentBlendAdd);};
00111   void SetComponentBlendModeToMaxOpacity() 
00112     {this->SetComponentBlendMode(vtkVolumeMapper::ComponentBlendMaxOpacity);};
00114   
00115       
00116   
00118 
00120   vtkSetClampMacro(Cropping,int,0,1);
00121   vtkGetMacro(Cropping,int);
00122   vtkBooleanMacro(Cropping,int);
00124 
00126 
00129   vtkSetVector6Macro( CroppingRegionPlanes, float );
00130   vtkGetVectorMacro(  CroppingRegionPlanes, float, 6 );
00132 
00134 
00136   vtkGetVectorMacro( VoxelCroppingRegionPlanes, float, 6 );
00138   
00140 
00149   vtkSetClampMacro( CroppingRegionFlags, int, 0x0, 0x7ffffff );
00150   vtkGetMacro( CroppingRegionFlags, int );
00151   void SetCroppingRegionFlagsToSubVolume() 
00152     {this->SetCroppingRegionFlags( VTK_CROP_SUBVOLUME );};
00153   void SetCroppingRegionFlagsToFence() 
00154     {this->SetCroppingRegionFlags( VTK_CROP_FENCE );};
00155   void SetCroppingRegionFlagsToInvertedFence() 
00156     {this->SetCroppingRegionFlags( VTK_CROP_INVERTED_FENCE );};
00157   void SetCroppingRegionFlagsToCross() 
00158     {this->SetCroppingRegionFlags( VTK_CROP_CROSS );};
00159   void SetCroppingRegionFlagsToInvertedCross() 
00160     {this->SetCroppingRegionFlags( VTK_CROP_INVERTED_CROSS );};
00162 
00164 
00166   virtual float *GetBounds();
00167   virtual void GetBounds(float bounds[6])
00168     { this->vtkAbstractMapper3D::GetBounds(bounds); };
00170 
00171 
00172 //BTX
00174   /*! WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE */
00175   virtual float GetGradientMagnitudeScale() {return 1.0;};
00176   virtual float GetGradientMagnitudeBias()  {return 0.0;};
00177   virtual float GetGradientMagnitudeScale(int) {return 1.0;};
00178   virtual float GetGradientMagnitudeBias(int)  {return 0.0;};
00180   
00181 
00184   virtual void Render(vtkRenderer *ren, vtkVolume *vol)=0;
00185 
00190   virtual void ReleaseGraphicsResources(vtkWindow *) {};
00191   
00192   enum ComponentBlendModes {
00193     ComponentBlendAdd = 0,
00194     ComponentBlendMaxOpacity
00195   };
00196   
00197 //ETX
00198 
00200 
00202   virtual void SetUseImageClipper(int);
00203   vtkGetMacro(UseImageClipper, int );
00204   vtkBooleanMacro(UseImageClipper, int );
00206   
00207 protected:
00208   vtkVolumeMapper();
00209   ~vtkVolumeMapper();
00210 
00211   // Cropping variables, and a method for converting the world
00212   // coordinate cropping region planes to voxel coordinates
00213   int                  Cropping;
00214   float                CroppingRegionPlanes[6];
00215   float                VoxelCroppingRegionPlanes[6];
00216   int                  CroppingRegionFlags;
00217   void ConvertCroppingRegionPlanesToVoxels();
00218   
00219   // Flag for independent or dependent components
00220   int                  IndependentComponents;
00221   
00222   // How should we combine the components
00223   int                  ComponentBlendMode;
00224   
00225   vtkTimeStamp         BuildTime;
00226 
00227   // Clipper used on input to ensure it is the right size
00228   int UseImageClipper;
00229   vtkImageClip        *ImageClipper;
00230   
00231   
00232 private:
00233   vtkVolumeMapper(const vtkVolumeMapper&);  // Not implemented.
00234   void operator=(const vtkVolumeMapper&);  // Not implemented.
00235 };
00236 
00237 
00238 #endif
00239 
00240