VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/Rendering/Core/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 "vtkRenderingCoreModule.h" // For export macro
00036 #include "vtkImageMapper3D.h"
00037 
00038 class vtkCamera;
00039 class vtkPoints;
00040 
00041 class VTKRENDERINGCORE_EXPORT vtkImageSliceMapper : public vtkImageMapper3D
00042 {
00043 public:
00044   static vtkImageSliceMapper *New();
00045   vtkTypeMacro(vtkImageSliceMapper,vtkImageMapper3D);
00046   void PrintSelf(ostream& os, vtkIndent indent);
00047 
00049 
00050   virtual void SetSliceNumber(int slice);
00051   virtual int GetSliceNumber();
00053 
00055 
00058   virtual int GetSliceNumberMinValue();
00059   virtual int GetSliceNumberMaxValue();
00061 
00063 
00065   vtkSetClampMacro(Orientation, int, 0, 2);
00066   vtkGetMacro(Orientation, int);
00067   void SetOrientationToX() { this->SetOrientation(0); }
00068   void SetOrientationToY() { this->SetOrientation(1); }
00069   void SetOrientationToZ() { this->SetOrientation(2); }
00071 
00073 
00075   vtkSetMacro(Cropping, int);
00076   vtkBooleanMacro(Cropping, int);
00077   vtkGetMacro(Cropping, int);
00079 
00081 
00082   vtkSetVector6Macro(CroppingRegion, int);
00083   vtkGetVector6Macro(CroppingRegion, int);
00085 
00087 
00088   virtual void Update();
00089   virtual void Update(int port);
00091 
00093   virtual void Render(vtkRenderer *renderer, vtkImageSlice *prop);
00094 
00098   virtual void ReleaseGraphicsResources(vtkWindow *);
00099 
00101   unsigned long GetMTime();
00102 
00104 
00106   double *GetBounds();
00107   void GetBounds(double bounds[6]) {
00108     this->vtkAbstractMapper3D::GetBounds(bounds); };
00110 
00112 
00115   virtual void GetSlicePlaneInDataCoords(vtkMatrix4x4 *propMatrix,
00116                                          double plane[4]);
00118 
00120 
00121   virtual int ProcessRequest(vtkInformation* request,
00122                              vtkInformationVector** inInfo,
00123                              vtkInformationVector* outInfo);
00125 
00126 protected:
00127   vtkImageSliceMapper();
00128   ~vtkImageSliceMapper();
00129 
00131 
00133   void SetPoints(vtkPoints *points);
00134   vtkPoints *GetPoints() { return this->Points; }
00136 
00138 
00140   void SetExactPixelMatch(int v) {
00141     this->ExactPixelMatch = (v != 0); }
00143 
00145 
00147   void SetPassColorData(int v) {
00148     this->PassColorData = (v != 0); }
00150 
00152 
00154   void SetDisplayExtent(int extent[6]) {
00155     this->DisplayExtent[0] = extent[0];
00156     this->DisplayExtent[1] = extent[1];
00157     this->DisplayExtent[2] = extent[2];
00158     this->DisplayExtent[3] = extent[3];
00159     this->DisplayExtent[4] = extent[4];
00160     this->DisplayExtent[5] = extent[5]; }
00162 
00166   int GetOrientationFromCamera(vtkMatrix4x4 *propMatrix, vtkCamera *camera);
00167 
00169   int GetSliceFromCamera(vtkMatrix4x4 *propMatrix, vtkCamera *camera);
00170 
00172   static void GetDimensionIndices(int orientation, int &xdim, int &ydim);
00173 
00174   int SliceNumber;
00175   int SliceNumberMinValue;
00176   int SliceNumberMaxValue;
00177   int Orientation;
00178   int Cropping;
00179   int CroppingRegion[6];
00180   int DisplayExtent[6];
00181   int ExactPixelMatch;
00182   int PassColorData;
00183   vtkPoints *Points;
00184   vtkTimeStamp UpdateTime;
00185 
00186 private:
00187   vtkImageSliceMapper(const vtkImageSliceMapper&);  // Not implemented.
00188   void operator=(const vtkImageSliceMapper&);  // Not implemented.
00189 
00190   friend class vtkImageResliceMapper;
00191 };
00192 
00193 #endif