VTK  9.1.0
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 =========================================================================*/
139 #ifndef vtkImageSliceMapper_h
140 #define vtkImageSliceMapper_h
141 
142 #include "vtkImageMapper3D.h"
143 #include "vtkRenderingCoreModule.h" // For export macro
144 
145 class vtkCamera;
146 class vtkPoints;
147 
148 class VTKRENDERINGCORE_EXPORT vtkImageSliceMapper : public vtkImageMapper3D
149 {
150 public:
153  void PrintSelf(ostream& os, vtkIndent indent) override;
154 
156 
159  virtual void SetSliceNumber(int slice);
160  virtual int GetSliceNumber();
162 
164 
169  virtual int GetSliceNumberMinValue();
170  virtual int GetSliceNumberMaxValue();
172 
174 
179  vtkSetClampMacro(Orientation, int, 0, 2);
180  vtkGetMacro(Orientation, int);
181  void SetOrientationToI() { this->SetOrientation(0); }
182  void SetOrientationToJ() { this->SetOrientation(1); }
183  void SetOrientationToK() { this->SetOrientation(2); }
184  // old methods
185  void SetOrientationToX() { this->SetOrientation(0); }
186  void SetOrientationToY() { this->SetOrientation(1); }
187  void SetOrientationToZ() { this->SetOrientation(2); }
189 
191 
195  vtkSetMacro(Cropping, vtkTypeBool);
196  vtkBooleanMacro(Cropping, vtkTypeBool);
197  vtkGetMacro(Cropping, vtkTypeBool);
199 
201 
205  vtkSetVector6Macro(CroppingRegion, int);
206  vtkGetVector6Macro(CroppingRegion, int);
208 
212  void Render(vtkRenderer* renderer, vtkImageSlice* prop) override;
213 
220 
224  vtkMTimeType GetMTime() override;
225 
227 
231  double* GetBounds() override;
232  void GetBounds(double bounds[6]) override { this->vtkAbstractMapper3D::GetBounds(bounds); }
234 
235  // return the bounds in index space
236  void GetIndexBounds(double extent[6]) override;
237 
243  void GetSlicePlaneInDataCoords(vtkMatrix4x4* propMatrix, double plane[4]) override;
244 
249  vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
250 
252 
256  void SetDisplayExtent(const int extent[6])
257  {
258  this->DisplayExtent[0] = extent[0];
259  this->DisplayExtent[1] = extent[1];
260  this->DisplayExtent[2] = extent[2];
261  this->DisplayExtent[3] = extent[3];
262  this->DisplayExtent[4] = extent[4];
263  this->DisplayExtent[5] = extent[5];
264  }
266 
267 protected:
270 
276  vtkPoints* GetPoints() { return this->Points; }
277 
282  void SetExactPixelMatch(int v) { this->ExactPixelMatch = (v != 0); }
283 
288  void SetPassColorData(int v) { this->PassColorData = (v != 0); }
289 
295  int GetOrientationFromCamera(double const* propMatrix, vtkCamera* camera);
296 
300  int GetSliceFromCamera(double const* propMatrix, vtkCamera* camera);
301 
305  static void GetDimensionIndices(int orientation, int& xdim, int& ydim);
306 
312  int CroppingRegion[6];
313  int DisplayExtent[6];
317 
318 private:
319  vtkImageSliceMapper(const vtkImageSliceMapper&) = delete;
320  void operator=(const vtkImageSliceMapper&) = delete;
321 
322  friend class vtkImageResliceMapper;
323 };
324 
325 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:143
vtkImageSliceMapper::GetBounds
void GetBounds(double bounds[6]) override
The bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax,...
Definition: vtkImageSliceMapper.h:232
vtkImageSliceMapper::SetOrientationToY
void SetOrientationToY()
Set the orientation of the slices to display.
Definition: vtkImageSliceMapper.h:186
vtkImageSliceMapper::GetOrientationFromCamera
int GetOrientationFromCamera(double const *propMatrix, vtkCamera *camera)
Get the camera orientation as a simple integer [0,1,2,3,4,5] that indicates one of the six major dire...
vtkAbstractMapper3D::GetBounds
virtual double * GetBounds()=0
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax,...
vtkImageSliceMapper::~vtkImageSliceMapper
~vtkImageSliceMapper() override
vtkImageSliceMapper::ExactPixelMatch
int ExactPixelMatch
Definition: vtkImageSliceMapper.h:314
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
vtkImageSliceMapper::SetOrientationToI
void SetOrientationToI()
Set the orientation of the slices to display.
Definition: vtkImageSliceMapper.h:181
vtkImageSliceMapper::SetPoints
void SetPoints(vtkPoints *points)
Set points that describe a polygon on which the slice will be rendered.
vtkImageSliceMapper::GetMTime
vtkMTimeType GetMTime() override
Get the mtime for the mapper.
vtkImageSliceMapper::SetOrientationToZ
void SetOrientationToZ()
Set the orientation of the slices to display.
Definition: vtkImageSliceMapper.h:187
vtkImageSliceMapper::GetBounds
double * GetBounds() override
The bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax,...
vtkImageSliceMapper::ProcessRequest
vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo) override
Handle requests from the pipeline executive.
vtkImageSliceMapper
map a slice of a vtkImageData to the screen
Definition: vtkImageSliceMapper.h:149
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
vtkImageSliceMapper::SetOrientationToK
void SetOrientationToK()
Set the orientation of the slices to display.
Definition: vtkImageSliceMapper.h:183
vtkImageSliceMapper::GetSliceFromCamera
int GetSliceFromCamera(double const *propMatrix, vtkCamera *camera)
Get the current slice as the one closest to the focal point.
vtkImageSliceMapper::GetSlicePlaneInDataCoords
void GetSlicePlaneInDataCoords(vtkMatrix4x4 *propMatrix, double plane[4]) override
Get the plane as a homogeneous 4-vector that gives the plane equation coefficients.
vtkX3D::points
@ points
Definition: vtkX3D.h:452
vtkImageSliceMapper::Render
void Render(vtkRenderer *renderer, vtkImageSlice *prop) override
This should only be called by the renderer.
vtkImageSlice
represents an image in a 3D scene
Definition: vtkImageSlice.h:156
vtkImageSliceMapper::SetExactPixelMatch
void SetExactPixelMatch(int v)
Force linear interpolation.
Definition: vtkImageSliceMapper.h:282
vtkImageSliceMapper::SliceNumberMaxValue
int SliceNumberMaxValue
Definition: vtkImageSliceMapper.h:309
vtkImageSliceMapper::SetSliceNumber
virtual void SetSliceNumber(int slice)
The slice to display, if there are multiple slices.
vtkImageSliceMapper::Cropping
vtkTypeBool Cropping
Definition: vtkImageSliceMapper.h:311
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:145
vtkImageSliceMapper::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this mapper.
vtkImageResliceMapper
map a slice of a vtkImageData to the screen
Definition: vtkImageResliceMapper.h:76
vtkCamera
a virtual camera for 3D rendering
Definition: vtkCamera.h:155
vtkImageSliceMapper::vtkImageSliceMapper
vtkImageSliceMapper()
vtkImageSliceMapper::SliceNumberMinValue
int SliceNumberMinValue
Definition: vtkImageSliceMapper.h:308
vtkImageSliceMapper::Points
vtkPoints * Points
Definition: vtkImageSliceMapper.h:316
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkImageMapper3D
abstract class for mapping images to the screen
Definition: vtkImageMapper3D.h:158
vtkImageSliceMapper::SetOrientationToJ
void SetOrientationToJ()
Set the orientation of the slices to display.
Definition: vtkImageSliceMapper.h:182
vtkX3D::orientation
@ orientation
Definition: vtkX3D.h:268
vtkImageSliceMapper::GetSliceNumber
virtual int GetSliceNumber()
The slice to display, if there are multiple slices.
vtkImageSliceMapper::SetOrientationToX
void SetOrientationToX()
Set the orientation of the slices to display.
Definition: vtkImageSliceMapper.h:185
vtkImageSliceMapper::GetDimensionIndices
static void GetDimensionIndices(int orientation, int &xdim, int &ydim)
Get the dimension indices according to the orientation.
vtkImageSliceMapper::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkImageSliceMapper::New
static vtkImageSliceMapper * New()
vtkImageSliceMapper::Orientation
int Orientation
Definition: vtkImageSliceMapper.h:310
vtkImageSliceMapper::GetSliceNumberMaxValue
virtual int GetSliceNumberMaxValue()
Use GetSliceNumberMinValue() and GetSliceNumberMaxValue() to get the range of allowed slices.
vtkImageSliceMapper::GetSliceNumberMinValue
virtual int GetSliceNumberMinValue()
Use GetSliceNumberMinValue() and GetSliceNumberMaxValue() to get the range of allowed slices.
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:182
vtkImageMapper3D.h
vtkImageSliceMapper::SetPassColorData
void SetPassColorData(int v)
Pass color data.
Definition: vtkImageSliceMapper.h:288
vtkImageSliceMapper::GetIndexBounds
void GetIndexBounds(double extent[6]) override
vtkX3D::extent
@ extent
Definition: vtkX3D.h:351
vtkImageSliceMapper::PassColorData
int PassColorData
Definition: vtkImageSliceMapper.h:315
vtkImageSliceMapper::GetPoints
vtkPoints * GetPoints()
Definition: vtkImageSliceMapper.h:276
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
vtkImageSliceMapper::SliceNumber
int SliceNumber
Definition: vtkImageSliceMapper.h:307
vtkImageSliceMapper::SetDisplayExtent
void SetDisplayExtent(const int extent[6])
Set the display extent.
Definition: vtkImageSliceMapper.h:256