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 =========================================================================*/
33 #ifndef vtkImageSliceMapper_h
34 #define vtkImageSliceMapper_h
35 
36 #include "vtkRenderingCoreModule.h" // For export macro
37 #include "vtkImageMapper3D.h"
38 
39 class vtkCamera;
40 class vtkPoints;
41 
42 class VTKRENDERINGCORE_EXPORT vtkImageSliceMapper : public vtkImageMapper3D
43 {
44 public:
45  static vtkImageSliceMapper *New();
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
50 
53  virtual void SetSliceNumber(int slice);
54  virtual int GetSliceNumber();
56 
58 
63  virtual int GetSliceNumberMinValue();
64  virtual int GetSliceNumberMaxValue();
66 
68 
72  vtkSetClampMacro(Orientation, int, 0, 2);
73  vtkGetMacro(Orientation, int);
74  void SetOrientationToX() { this->SetOrientation(0); }
75  void SetOrientationToY() { this->SetOrientation(1); }
76  void SetOrientationToZ() { this->SetOrientation(2); }
78 
80 
84  vtkSetMacro(Cropping, vtkTypeBool);
85  vtkBooleanMacro(Cropping, vtkTypeBool);
86  vtkGetMacro(Cropping, vtkTypeBool);
88 
90 
94  vtkSetVector6Macro(CroppingRegion, int);
95  vtkGetVector6Macro(CroppingRegion, int);
97 
101  void Render(vtkRenderer *renderer, vtkImageSlice *prop) override;
102 
108  void ReleaseGraphicsResources(vtkWindow *) override;
109 
113  vtkMTimeType GetMTime() override;
114 
116 
120  double *GetBounds() override;
121  void GetBounds(double bounds[6]) override {
122  this->vtkAbstractMapper3D::GetBounds(bounds); };
124 
130  void GetSlicePlaneInDataCoords(vtkMatrix4x4 *propMatrix,
131  double plane[4]) override;
132 
136  int ProcessRequest(vtkInformation* request,
137  vtkInformationVector** inInfo,
138  vtkInformationVector* outInfo) override;
139 
140 protected:
142  ~vtkImageSliceMapper() override;
143 
148  void SetPoints(vtkPoints *points);
149  vtkPoints *GetPoints() { return this->Points; }
150 
155  void SetExactPixelMatch(int v) {
156  this->ExactPixelMatch = (v != 0); }
157 
162  void SetPassColorData(int v) {
163  this->PassColorData = (v != 0); }
164 
166 
170  void SetDisplayExtent(const int extent[6]) {
171  this->DisplayExtent[0] = extent[0];
172  this->DisplayExtent[1] = extent[1];
173  this->DisplayExtent[2] = extent[2];
174  this->DisplayExtent[3] = extent[3];
175  this->DisplayExtent[4] = extent[4];
176  this->DisplayExtent[5] = extent[5]; }
178 
184  int GetOrientationFromCamera(vtkMatrix4x4 *propMatrix, vtkCamera *camera);
185 
189  int GetSliceFromCamera(vtkMatrix4x4 *propMatrix, vtkCamera *camera);
190 
194  static void GetDimensionIndices(int orientation, int &xdim, int &ydim);
195 
201  int CroppingRegion[6];
202  int DisplayExtent[6];
206 
207 private:
208  vtkImageSliceMapper(const vtkImageSliceMapper&) = delete;
209  void operator=(const vtkImageSliceMapper&) = delete;
210 
211  friend class vtkImageResliceMapper;
212 };
213 
214 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkImageSliceMapper::GetBounds
void GetBounds(double bounds[6]) override
Get the bounds for this mapper as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition: vtkImageSliceMapper.h:121
vtkImageSliceMapper::SetOrientationToY
void SetOrientationToY()
Definition: vtkImageSliceMapper.h:75
vtkAbstractMapper3D::GetBounds
virtual double * GetBounds()=0
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax,...
vtkImageSliceMapper::ExactPixelMatch
int ExactPixelMatch
Definition: vtkImageSliceMapper.h:203
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkImageMapper3D::Render
virtual void Render(vtkRenderer *renderer, vtkImageSlice *prop)=0
This should only be called by the renderer.
vtkAbstractMapper::GetMTime
vtkMTimeType GetMTime() override
Override Modifiedtime as we have added Clipping planes.
vtkImageMapper3D::ProcessRequest
int ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo) override
Handle requests from the pipeline executive.
vtkImageSliceMapper::SetOrientationToZ
void SetOrientationToZ()
Definition: vtkImageSliceMapper.h:76
vtkImageSliceMapper
map a slice of a vtkImageData to the screen
Definition: vtkImageSliceMapper.h:42
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkImageMapper3D::GetSlicePlaneInDataCoords
virtual void GetSlicePlaneInDataCoords(vtkMatrix4x4 *propMatrix, double plane[4])
Get the plane as a homogeneous 4-vector that gives the plane equation coefficients.
vtkX3D::points
Definition: vtkX3D.h:446
vtkImageSlice
represents an image in a 3D scene
Definition: vtkImageSlice.h:52
vtkImageSliceMapper::SetExactPixelMatch
void SetExactPixelMatch(int v)
Force linear interpolation.
Definition: vtkImageSliceMapper.h:155
vtkImageSliceMapper::SliceNumberMaxValue
int SliceNumberMaxValue
Definition: vtkImageSliceMapper.h:198
vtkImageSliceMapper::Cropping
vtkTypeBool Cropping
Definition: vtkImageSliceMapper.h:200
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:41
vtkImageResliceMapper
map a slice of a vtkImageData to the screen
Definition: vtkImageResliceMapper.h:52
vtkCamera
a virtual camera for 3D rendering
Definition: vtkCamera.h:50
vtkImageMapper3D::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override=0
Release any graphics resources that are being consumed by this mapper.
vtkImageSliceMapper::SliceNumberMinValue
int SliceNumberMinValue
Definition: vtkImageSliceMapper.h:197
vtkImageSliceMapper::Points
vtkPoints * Points
Definition: vtkImageSliceMapper.h:205
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkImageMapper3D
abstract class for mapping images to the screen
Definition: vtkImageMapper3D.h:50
vtkAlgorithm::New
static vtkAlgorithm * New()
vtkX3D::orientation
Definition: vtkX3D.h:262
vtkImageSliceMapper::SetOrientationToX
void SetOrientationToX()
Definition: vtkImageSliceMapper.h:74
vtkImageSliceMapper::Orientation
int Orientation
Definition: vtkImageSliceMapper.h:199
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:63
vtkImageMapper3D.h
vtkImageSliceMapper::SetPassColorData
void SetPassColorData(int v)
Pass color data.
Definition: vtkImageSliceMapper.h:162
vtkX3D::extent
Definition: vtkX3D.h:345
vtkImageMapper3D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkImageSliceMapper::PassColorData
int PassColorData
Definition: vtkImageSliceMapper.h:204
vtkImageSliceMapper::GetPoints
vtkPoints * GetPoints()
Definition: vtkImageSliceMapper.h:149
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
vtkImageSliceMapper::SliceNumber
int SliceNumber
Definition: vtkImageSliceMapper.h:196
vtkImageSliceMapper::SetDisplayExtent
void SetDisplayExtent(const int extent[6])
Set the display extent.
Definition: vtkImageSliceMapper.h:170