VTK
vtkImageSliceMapper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageSliceMapper.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
32 #ifndef __vtkImageSliceMapper_h
33 #define __vtkImageSliceMapper_h
34 
35 #include "vtkImageMapper3D.h"
36 
37 class vtkCamera;
38 class vtkPoints;
39 
41 {
42 public:
43  static vtkImageSliceMapper *New();
45  void PrintSelf(ostream& os, vtkIndent indent);
46 
48 
49  virtual void SetSliceNumber(int slice);
50  virtual int GetSliceNumber();
52 
54 
57  virtual int GetSliceNumberMinValue();
58  virtual int GetSliceNumberMaxValue();
60 
62 
64  vtkSetClampMacro(Orientation, int, 0, 2);
65  vtkGetMacro(Orientation, int);
66  void SetOrientationToX() { this->SetOrientation(0); }
67  void SetOrientationToY() { this->SetOrientation(1); }
68  void SetOrientationToZ() { this->SetOrientation(2); }
70 
72 
74  vtkSetMacro(Cropping, int);
75  vtkBooleanMacro(Cropping, int);
76  vtkGetMacro(Cropping, int);
78 
80 
81  vtkSetVector6Macro(CroppingRegion, int);
82  vtkGetVector6Macro(CroppingRegion, int);
84 
86  virtual void Update();
87 
89  virtual void Render(vtkRenderer *renderer, vtkImageSlice *prop);
90 
94  virtual void ReleaseGraphicsResources(vtkWindow *);
95 
97  unsigned long GetMTime();
98 
100 
102  double *GetBounds();
103  void GetBounds(double bounds[6]) {
104  this->vtkAbstractMapper3D::GetBounds(bounds); };
106 
108 
111  virtual void GetSlicePlaneInDataCoords(vtkMatrix4x4 *propMatrix,
112  double plane[4]);
114 
116 
117  virtual int ProcessRequest(vtkInformation* request,
118  vtkInformationVector** inInfo,
119  vtkInformationVector* outInfo);
121 
122 protected:
125 
127 
129  void SetPoints(vtkPoints *points);
130  vtkPoints *GetPoints() { return this->Points; }
132 
134 
136  void SetExactPixelMatch(int v) {
137  this->ExactPixelMatch = (v != 0); }
139 
141 
143  void SetPassColorData(int v) {
144  this->PassColorData = (v != 0); }
146 
148 
150  void SetDisplayExtent(int extent[6]) {
151  this->DisplayExtent[0] = extent[0];
152  this->DisplayExtent[1] = extent[1];
153  this->DisplayExtent[2] = extent[2];
154  this->DisplayExtent[3] = extent[3];
155  this->DisplayExtent[4] = extent[4];
156  this->DisplayExtent[5] = extent[5]; }
158 
162  int GetOrientationFromCamera(vtkMatrix4x4 *propMatrix, vtkCamera *camera);
163 
165  int GetSliceFromCamera(vtkMatrix4x4 *propMatrix, vtkCamera *camera);
166 
168  static void GetDimensionIndices(int orientation, int &xdim, int &ydim);
169 
174  int Cropping;
175  int CroppingRegion[6];
176  int DisplayExtent[6];
181 
182 private:
183  vtkImageSliceMapper(const vtkImageSliceMapper&); // Not implemented.
184  void operator=(const vtkImageSliceMapper&); // Not implemented.
185 
186  friend class vtkImageResliceMapper;
187 };
188 
189 #endif