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
39class vtkCamera;
40class vtkPoints;
41
42class VTKRENDERINGCORE_EXPORT vtkImageSliceMapper : public vtkImageMapper3D
43{
44public:
47 void PrintSelf(ostream& os, vtkIndent indent);
48
50
53 virtual void SetSliceNumber(int slice);
54 virtual int GetSliceNumber();
56
58
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, int);
85 vtkBooleanMacro(Cropping, int);
86 vtkGetMacro(Cropping, int);
88
90
94 vtkSetVector6Macro(CroppingRegion, int);
95 vtkGetVector6Macro(CroppingRegion, int);
97
101 virtual void Render(vtkRenderer *renderer, vtkImageSlice *prop);
102
109
114
116
120 double *GetBounds();
121 void GetBounds(double bounds[6]) {
122 this->vtkAbstractMapper3D::GetBounds(bounds); };
124
130 virtual void GetSlicePlaneInDataCoords(vtkMatrix4x4 *propMatrix,
131 double plane[4]);
132
136 virtual int ProcessRequest(vtkInformation* request,
137 vtkInformationVector** inInfo,
138 vtkInformationVector* outInfo);
139
140protected:
143
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
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
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
207private:
208 vtkImageSliceMapper(const vtkImageSliceMapper&) VTK_DELETE_FUNCTION;
209 void operator=(const vtkImageSliceMapper&) VTK_DELETE_FUNCTION;
210
212};
213
214#endif
virtual double * GetBounds()=0
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax,...
a virtual camera for 3D rendering
Definition: vtkCamera.h:51
abstract class for mapping images to the screen
map a slice of a vtkImageData to the screen
map a slice of a vtkImageData to the screen
vtkMTimeType GetMTime()
Get the mtime for the mapper.
void SetDisplayExtent(int extent[6])
Set the display extent.
virtual int GetSliceNumberMaxValue()
double * GetBounds()
The bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax,...
void GetBounds(double bounds[6])
Get the bounds for this mapper as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual int GetSliceNumberMinValue()
Use GetSliceNumberMinValue() and GetSliceNumberMaxValue() to get the range of allowed slices.
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this mapper.
virtual void GetSlicePlaneInDataCoords(vtkMatrix4x4 *propMatrix, double plane[4])
Get the plane as a homogeneous 4-vector that gives the plane equation coefficients.
virtual void SetSliceNumber(int slice)
The slice to display, if there are multiple slices.
void SetExactPixelMatch(int v)
Force linear interpolation.
int GetSliceFromCamera(vtkMatrix4x4 *propMatrix, vtkCamera *camera)
Get the current slice as the one closest to the focal point.
void SetPoints(vtkPoints *points)
Set points that describe a polygon on which the slice will be rendered.
static void GetDimensionIndices(int orientation, int &xdim, int &ydim)
Get the dimension indices according to the orientation.
void SetPassColorData(int v)
Pass color data.
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
Handle requests from the pipeline executive.
virtual void Render(vtkRenderer *renderer, vtkImageSlice *prop)
This should only be called by the renderer.
virtual int GetSliceNumber()
int GetOrientationFromCamera(vtkMatrix4x4 *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...
static vtkImageSliceMapper * New()
represents an image in a 3D scene
Definition: vtkImageSlice.h:53
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:42
represent and manipulate 3D points
Definition: vtkPoints.h:40
abstract specification for renderers
Definition: vtkRenderer.h:64
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
@ points
Definition: vtkX3D.h:446
@ orientation
Definition: vtkX3D.h:262
@ extent
Definition: vtkX3D.h:345
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248