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 
65  void SetInputData(vtkImageData *input);
66  vtkImageData *GetInput();
67  vtkDataSet *GetDataSetInput();
68  vtkDataObject *GetDataObjectInput();
70 
72 
75  vtkSetMacro(Border, int);
76  vtkBooleanMacro(Border, int);
77  vtkGetMacro(Border, int);
79 
81 
85  vtkSetMacro(Background, int);
86  vtkBooleanMacro(Background, int);
87  vtkGetMacro(Background, int);
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 
114  vtkGetObjectMacro(SlicePlane, vtkPlane);
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:
146  ~vtkImageMapper3D();
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 
182  void MakeTextureGeometry(
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 
199  vtkRenderer *GetCurrentRenderer();
200 
202  vtkImageSlice *GetCurrentProp() { return this->CurrentProp; }
203 
206  vtkMatrix4x4 *GetDataToWorldMatrix();
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
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:38
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:61
A class for performing multithreaded execution.
vtkScalarsToColors * DefaultLookupTable
#define VTK_MAX_THREADS
Definition: vtkConfigure.h:41
map scalar values into colors via a lookup table
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
image display properties
abstract specification for renderers
Definition: vtkRenderer.h:63
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:42
Superclass for mapping scalar values to colors.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
virtual int FillOutputPortInformation(int port, vtkInformation *info)
a simple class to control print indentation
Definition: vtkIndent.h:38
abstract class for mapping images to the screen
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
perform various plane computations
Definition: vtkPlane.h:36
abstract class specifies interface to map 3D data
virtual int FillInputPortInformation(int port, vtkInformation *info)
vtkImageSlice * GetCurrentProp()
vtkMultiThreader * Threader
represents an image in a 3D scene
Definition: vtkImageSlice.h:51
virtual void ReleaseGraphicsResources(vtkWindow *)
#define VTKRENDERINGCORE_EXPORT
void PrintSelf(ostream &os, vtkIndent indent)
Store zero or more vtkInformation instances.
general representation of visualization data
Definition: vtkDataObject.h:64
represent and manipulate 3D points
Definition: vtkPoints.h:38