VTK
dox/Rendering/vtkImageSliceMapper.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkImageSliceMapper.h
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 =========================================================================*/
00032 #ifndef __vtkImageSliceMapper_h
00033 #define __vtkImageSliceMapper_h
00034 
00035 #include "vtkImageMapper3D.h"
00036 
00037 class vtkCamera;
00038 class vtkPoints;
00039 
00040 class VTK_RENDERING_EXPORT vtkImageSliceMapper : public vtkImageMapper3D
00041 {
00042 public:
00043   static vtkImageSliceMapper *New();
00044   vtkTypeMacro(vtkImageSliceMapper,vtkImageMapper3D);
00045   void PrintSelf(ostream& os, vtkIndent indent);
00046 
00048 
00049   virtual void SetSliceNumber(int slice);
00050   virtual int GetSliceNumber();
00052 
00054 
00057   virtual int GetSliceNumberMinValue();
00058   virtual int GetSliceNumberMaxValue();
00060 
00062 
00064   vtkSetClampMacro(Orientation, int, 0, 2);
00065   vtkGetMacro(Orientation, int);
00066   void SetOrientationToX() { this->SetOrientation(0); }
00067   void SetOrientationToY() { this->SetOrientation(1); }
00068   void SetOrientationToZ() { this->SetOrientation(2); }
00070 
00072 
00074   vtkSetMacro(Cropping, int);
00075   vtkBooleanMacro(Cropping, int);
00076   vtkGetMacro(Cropping, int);
00078 
00080 
00081   vtkSetVector6Macro(CroppingRegion, int);
00082   vtkGetVector6Macro(CroppingRegion, int);
00084 
00086   virtual void Update();
00087 
00089   virtual void Render(vtkRenderer *renderer, vtkImageSlice *prop);
00090 
00094   virtual void ReleaseGraphicsResources(vtkWindow *);
00095 
00097   unsigned long GetMTime();
00098 
00100 
00102   double *GetBounds();
00103   void GetBounds(double bounds[6]) {
00104     this->vtkAbstractMapper3D::GetBounds(bounds); };
00106 
00108 
00111   virtual void GetSlicePlaneInDataCoords(vtkMatrix4x4 *propMatrix,
00112                                          double plane[4]);
00114 
00116 
00117   virtual int ProcessRequest(vtkInformation* request,
00118                              vtkInformationVector** inInfo,
00119                              vtkInformationVector* outInfo);
00121 
00122 protected:
00123   vtkImageSliceMapper();
00124   ~vtkImageSliceMapper();
00125 
00127 
00129   void SetPoints(vtkPoints *points);
00130   vtkPoints *GetPoints() { return this->Points; }
00132 
00134 
00136   void SetExactPixelMatch(int v) {
00137     this->ExactPixelMatch = (v != 0); }
00139 
00141 
00143   void SetPassColorData(int v) {
00144     this->PassColorData = (v != 0); }
00146 
00148 
00150   void SetDisplayExtent(int extent[6]) {
00151     this->DisplayExtent[0] = extent[0];
00152     this->DisplayExtent[1] = extent[1];
00153     this->DisplayExtent[2] = extent[2];
00154     this->DisplayExtent[3] = extent[3];
00155     this->DisplayExtent[4] = extent[4];
00156     this->DisplayExtent[5] = extent[5]; }
00158 
00162   int GetOrientationFromCamera(vtkMatrix4x4 *propMatrix, vtkCamera *camera);
00163 
00165   int GetSliceFromCamera(vtkMatrix4x4 *propMatrix, vtkCamera *camera);
00166 
00168   static void GetDimensionIndices(int orientation, int &xdim, int &ydim);
00169 
00170   int SliceNumber;
00171   int SliceNumberMinValue;
00172   int SliceNumberMaxValue;
00173   int Orientation;
00174   int Cropping;
00175   int CroppingRegion[6];
00176   int DisplayExtent[6];
00177   int ExactPixelMatch;
00178   int PassColorData;
00179   vtkPoints *Points;
00180   vtkTimeStamp UpdateTime;
00181 
00182 private:
00183   vtkImageSliceMapper(const vtkImageSliceMapper&);  // Not implemented.
00184   void operator=(const vtkImageSliceMapper&);  // Not implemented.
00185 
00186   friend class vtkImageResliceMapper;
00187 };
00188 
00189 #endif