VTK
vtkImageMapper3D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageMapper3D.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 =========================================================================*/
31 #ifndef vtkImageMapper3D_h
32 #define vtkImageMapper3D_h
33 
34 #include "vtkRenderingCoreModule.h" // For export macro
35 #include "vtkAbstractMapper3D.h"
36 
37 class vtkRenderer;
38 class vtkProp3D;
39 class vtkPoints;
40 class vtkMatrix4x4;
41 class vtkLookupTable;
42 class vtkScalarsToColors;
43 class vtkImageSlice;
44 class vtkImageProperty;
45 class vtkImageData;
46 class vtkMultiThreader;
47 class vtkImageToImageMapper3DFriendship;
48 
50 {
51 public:
53  void PrintSelf(ostream& os, vtkIndent indent);
54 
56  virtual void Render(vtkRenderer *renderer, vtkImageSlice *prop) = 0;
57 
61  virtual void ReleaseGraphicsResources(vtkWindow *) = 0;
62 
64 
70 
72 
75  vtkSetMacro(Border, int);
76  vtkBooleanMacro(Border, int);
77  vtkGetMacro(Border, int);
79 
81 
89 
91 
94  vtkSetMacro(SliceAtFocalPoint, int);
95  vtkBooleanMacro(SliceAtFocalPoint, int);
96  vtkGetMacro(SliceAtFocalPoint, int);
98 
100 
103  vtkSetMacro(SliceFacesCamera, int);
104  vtkBooleanMacro(SliceFacesCamera, int);
105  vtkGetMacro(SliceFacesCamera, int);
107 
109 
116 
118 
121  virtual void GetSlicePlaneInDataCoords(vtkMatrix4x4 *propMatrix,
122  double plane[4]);
124 
126 
127  vtkSetClampMacro(NumberOfThreads, int, 1, VTK_MAX_THREADS);
128  vtkGetMacro(NumberOfThreads, int);
130 
132 
139  vtkSetMacro(Streaming, int);
140  vtkGetMacro(Streaming, int);
141  vtkBooleanMacro(Streaming, int);
143 
144 protected:
147 
149 
153 
155 
156  virtual int ProcessRequest(vtkInformation* request,
157  vtkInformationVector** inInfo,
158  vtkInformationVector* outInfo);
160 
162 
164  static void CheckerboardRGBA(
165  unsigned char *data, int xsize, int ysize,
166  double originx, double originy, double spacingx, double spacingy);
168 
170 
173  unsigned char *MakeTextureData(
174  vtkImageProperty *property, vtkImageData *input, int extent[6],
175  int &xsize, int &ysize, int &bytesPerPixel, bool &reuseTexture,
176  bool &reuseData);
178 
180 
183  const int extent[6], double coords[12], double tcoords[8]);
185 
187 
192  virtual void ComputeTextureSize(
193  const int extent[6], int &xdim, int &ydim,
194  int imageSize[2], int textureSize[2]);
196 
200 
202  vtkImageSlice *GetCurrentProp() { return this->CurrentProp; }
203 
207 
210  void GetBackgroundColor(vtkImageProperty *property, double color[4]);
211 
212  int Border;
218 
219  // The slice.
223 
224  // Information about the image, updated by UpdateInformation
225  double DataSpacing[3];
226  double DataOrigin[3];
227  int DataWholeExtent[6];
228 
229  // Set by vtkImageStack when doing multi-pass rendering
233 
234 private:
235  // The prop this mapper is attached to, or zero if none.
236  vtkImageSlice *CurrentProp;
237  vtkRenderer *CurrentRenderer;
238 
239  // The cached data-to-world matrix
240  vtkMatrix4x4 *DataToWorldMatrix;
241 
242  vtkImageMapper3D(const vtkImageMapper3D&); // Not implemented.
243  void operator=(const vtkImageMapper3D&); // Not implemented.
244 
245  friend class vtkImageToImageMapper3DFriendship;
246 };
247 
248 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkPlane
perform various plane computations
Definition: vtkPlane.h:37
vtkImageMapper3D::Threader
vtkMultiThreader * Threader
Definition: vtkImageMapper3D.h:215
vtkgl::data
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: vtkgl.h:11339
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkgl::imageSize
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei imageSize
Definition: vtkgl.h:11538
vtkImageMapper3D::GetCurrentProp
vtkImageSlice * GetCurrentProp()
Definition: vtkImageMapper3D.h:202
vtkProp3D
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:43
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkImageMapper3D::Render
virtual void Render(vtkRenderer *renderer, vtkImageSlice *prop)=0
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkImageMapper3D::Border
int Border
Definition: vtkImageMapper3D.h:212
vtkImageMapper3D::GetDataObjectInput
vtkDataObject * GetDataObjectInput()
vtkgl::input
GLenum GLenum GLenum input
Definition: vtkgl.h:15941
vtkgl::coords
GLuint coords
Definition: vtkgl.h:13928
vtkAbstractMapper3D.h
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkImageMapper3D::GetSlicePlaneInDataCoords
virtual void GetSlicePlaneInDataCoords(vtkMatrix4x4 *propMatrix, double plane[4])
vtkImageMapper3D::ProcessRequest
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
vtkMultiThreader
A class for performing multithreaded execution.
Definition: vtkMultiThreader.h:94
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkImageSlice
represents an image in a 3D scene
Definition: vtkImageSlice.h:52
VTK_MAX_THREADS
#define VTK_MAX_THREADS
Definition: vtkConfigure.h:41
vtkX3D::Background
@ Background
Definition: vtkX3D.h:71
vtkImageMapper3D::MatteEnable
bool MatteEnable
Definition: vtkImageMapper3D.h:230
vtkImageProperty
image display properties
Definition: vtkImageProperty.h:42
vtkImageMapper3D::~vtkImageMapper3D
~vtkImageMapper3D()
vtkImageMapper3D::SliceAtFocalPoint
int SliceAtFocalPoint
Definition: vtkImageMapper3D.h:221
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:39
vtkRenderingCoreModule.h
vtkImageMapper3D::FillOutputPortInformation
virtual int FillOutputPortInformation(int port, vtkInformation *info)
vtkImageMapper3D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkImageMapper3D::MakeTextureGeometry
void MakeTextureGeometry(const int extent[6], double coords[12], double tcoords[8])
vtkImageMapper3D::GetCurrentRenderer
vtkRenderer * GetCurrentRenderer()
vtkImageMapper3D::NumberOfThreads
int NumberOfThreads
Definition: vtkImageMapper3D.h:216
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkScalarsToColors
Superclass for mapping scalar values to colors.
Definition: vtkScalarsToColors.h:63
vtkgl::color
GLuint color
Definition: vtkgl.h:12351
vtkImageMapper3D::SlicePlane
vtkPlane * SlicePlane
Definition: vtkImageMapper3D.h:220
vtkImageMapper3D::DefaultLookupTable
vtkScalarsToColors * DefaultLookupTable
Definition: vtkImageMapper3D.h:214
vtkImageMapper3D::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)=0
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
vtkImageMapper3D::SliceFacesCamera
int SliceFacesCamera
Definition: vtkImageMapper3D.h:222
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkLookupTable
map scalar values into colors via a lookup table
Definition: vtkLookupTable.h:74
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkImageMapper3D
abstract class for mapping images to the screen
Definition: vtkImageMapper3D.h:50
vtkAbstractMapper3D
abstract class specifies interface to map 3D data
Definition: vtkAbstractMapper3D.h:42
vtkImageMapper3D::vtkImageMapper3D
vtkImageMapper3D()
vtkImageMapper3D::GetInput
vtkImageData * GetInput()
vtkImageMapper3D::Streaming
int Streaming
Definition: vtkImageMapper3D.h:217
vtkImageMapper3D::ColorEnable
bool ColorEnable
Definition: vtkImageMapper3D.h:231
vtkImageMapper3D::GetDataSetInput
vtkDataSet * GetDataSetInput()
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkImageMapper3D::SetInputData
void SetInputData(vtkImageData *input)
vtkX3D::extent
@ extent
Definition: vtkX3D.h:345
vtkImageMapper3D::MakeTextureData
unsigned char * MakeTextureData(vtkImageProperty *property, vtkImageData *input, int extent[6], int &xsize, int &ysize, int &bytesPerPixel, bool &reuseTexture, bool &reuseData)
VTKRENDERINGCORE_EXPORT
#define VTKRENDERINGCORE_EXPORT
Definition: vtkRenderingCoreModule.h:15
vtkImageMapper3D::ComputeTextureSize
virtual void ComputeTextureSize(const int extent[6], int &xdim, int &ydim, int imageSize[2], int textureSize[2])
vtkImageMapper3D::DepthEnable
bool DepthEnable
Definition: vtkImageMapper3D.h:232
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
vtkImageMapper3D::FillInputPortInformation
virtual int FillInputPortInformation(int port, vtkInformation *info)
vtkImageMapper3D::GetDataToWorldMatrix
vtkMatrix4x4 * GetDataToWorldMatrix()
vtkImageMapper3D::GetBackgroundColor
void GetBackgroundColor(vtkImageProperty *property, double color[4])
vtkImageMapper3D::CheckerboardRGBA
static void CheckerboardRGBA(unsigned char *data, int xsize, int ysize, double originx, double originy, double spacingx, double spacingy)
vtkImageMapper3D::Background
int Background
Definition: vtkImageMapper3D.h:213