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 =========================================================================*/
30 #ifndef vtkImageSliceMapper_h
31 #define vtkImageSliceMapper_h
32 
33 #include "vtkRenderingCoreModule.h" // For export macro
34 #include "vtkImageMapper3D.h"
35 
36 class vtkCamera;
37 class vtkPoints;
38 
39 class VTKRENDERINGCORE_EXPORT vtkImageSliceMapper : public vtkImageMapper3D
40 {
41 public:
42  static vtkImageSliceMapper *New();
44  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
45 
47 
50  virtual void SetSliceNumber(int slice);
51  virtual int GetSliceNumber();
53 
55 
60  virtual int GetSliceNumberMinValue();
61  virtual int GetSliceNumberMaxValue();
63 
65 
69  vtkSetClampMacro(Orientation, int, 0, 2);
70  vtkGetMacro(Orientation, int);
71  void SetOrientationToX() { this->SetOrientation(0); }
72  void SetOrientationToY() { this->SetOrientation(1); }
73  void SetOrientationToZ() { this->SetOrientation(2); }
75 
77 
81  vtkSetMacro(Cropping, int);
82  vtkBooleanMacro(Cropping, int);
83  vtkGetMacro(Cropping, int);
85 
87 
91  vtkSetVector6Macro(CroppingRegion, int);
92  vtkGetVector6Macro(CroppingRegion, int);
94 
98  void Render(vtkRenderer *renderer, vtkImageSlice *prop) VTK_OVERRIDE;
99 
105  void ReleaseGraphicsResources(vtkWindow *) VTK_OVERRIDE;
106 
110  vtkMTimeType GetMTime() VTK_OVERRIDE;
111 
113 
117  double *GetBounds() VTK_OVERRIDE;
118  void GetBounds(double bounds[6]) VTK_OVERRIDE {
119  this->vtkAbstractMapper3D::GetBounds(bounds); };
121 
127  void GetSlicePlaneInDataCoords(vtkMatrix4x4 *propMatrix,
128  double plane[4]) VTK_OVERRIDE;
129 
133  int ProcessRequest(vtkInformation* request,
134  vtkInformationVector** inInfo,
135  vtkInformationVector* outInfo) VTK_OVERRIDE;
136 
137 protected:
139  ~vtkImageSliceMapper() VTK_OVERRIDE;
140 
145  void SetPoints(vtkPoints *points);
146  vtkPoints *GetPoints() { return this->Points; }
147 
152  void SetExactPixelMatch(int v) {
153  this->ExactPixelMatch = (v != 0); }
154 
159  void SetPassColorData(int v) {
160  this->PassColorData = (v != 0); }
161 
163 
167  void SetDisplayExtent(int extent[6]) {
168  this->DisplayExtent[0] = extent[0];
169  this->DisplayExtent[1] = extent[1];
170  this->DisplayExtent[2] = extent[2];
171  this->DisplayExtent[3] = extent[3];
172  this->DisplayExtent[4] = extent[4];
173  this->DisplayExtent[5] = extent[5]; }
175 
181  int GetOrientationFromCamera(vtkMatrix4x4 *propMatrix, vtkCamera *camera);
182 
186  int GetSliceFromCamera(vtkMatrix4x4 *propMatrix, vtkCamera *camera);
187 
191  static void GetDimensionIndices(int orientation, int &xdim, int &ydim);
192 
197  int Cropping;
198  int CroppingRegion[6];
199  int DisplayExtent[6];
203 
204 private:
205  vtkImageSliceMapper(const vtkImageSliceMapper&) VTK_DELETE_FUNCTION;
206  void operator=(const vtkImageSliceMapper&) VTK_DELETE_FUNCTION;
207 
208  friend class vtkImageResliceMapper;
209 };
210 
211 #endif
void ReleaseGraphicsResources(vtkWindow *) override=0
Release any graphics resources that are being consumed by this mapper.
void SetExactPixelMatch(int v)
Force linear interpolation.
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:35
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
vtkMTimeType GetMTime() override
Override Modifiedtime as we have added Clipping planes.
void SetDisplayExtent(int extent[6])
Set the display extent.
abstract specification for renderers
Definition: vtkRenderer.h:57
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetPassColorData(int v)
Pass color data.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
void SetOrientationToX()
Set the orientation of the slices to display.
a simple class to control print indentation
Definition: vtkIndent.h:33
abstract class for mapping images to the screen
map a slice of a vtkImageData to the screen
a virtual camera for 3D rendering
Definition: vtkCamera.h:44
virtual void Render(vtkRenderer *renderer, vtkImageSlice *prop)=0
This should only be called by the renderer.
int ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo) override
Handle requests from the pipeline executive.
virtual double * GetBounds()=0
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax, zmin,zmax).
void SetOrientationToZ()
Set the orientation of the slices to display.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
represents an image in a 3D scene
Definition: vtkImageSlice.h:46
void SetOrientationToY()
Set the orientation of the slices to display.
Store zero or more vtkInformation instances.
map a slice of a vtkImageData to the screen
static vtkAlgorithm * New()
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
virtual void GetSlicePlaneInDataCoords(vtkMatrix4x4 *propMatrix, double plane[4])
Get the plane as a homogeneous 4-vector that gives the plane equation coefficients.
represent and manipulate 3D points
Definition: vtkPoints.h:33