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 =========================================================================*/
32 #ifndef vtkImageMapper3D_h
33 #define vtkImageMapper3D_h
34 
35 #include "vtkRenderingCoreModule.h" // For export macro
36 #include "vtkAbstractMapper3D.h"
37 
38 class vtkRenderer;
39 class vtkProp3D;
40 class vtkPoints;
41 class vtkMatrix4x4;
42 class vtkLookupTable;
43 class vtkScalarsToColors;
44 class vtkImageSlice;
45 class vtkImageProperty;
46 class vtkImageData;
47 class vtkMultiThreader;
48 class vtkImageToImageMapper3DFriendship;
49 
50 class VTKRENDERINGCORE_EXPORT vtkImageMapper3D : public vtkAbstractMapper3D
51 {
52 public:
54  void PrintSelf(ostream& os, vtkIndent indent) override;
55 
59  virtual void Render(vtkRenderer *renderer, vtkImageSlice *prop) = 0;
60 
66  void ReleaseGraphicsResources(vtkWindow *) override = 0;
67 
69 
72  void SetInputData(vtkImageData *input);
73  vtkImageData *GetInput();
74  vtkDataSet *GetDataSetInput();
75  vtkDataObject *GetDataObjectInput();
77 
79 
85  vtkSetMacro(Border, vtkTypeBool);
86  vtkBooleanMacro(Border, vtkTypeBool);
87  vtkGetMacro(Border, vtkTypeBool);
89 
91 
97  vtkSetMacro(Background, vtkTypeBool);
98  vtkBooleanMacro(Background, vtkTypeBool);
99  vtkGetMacro(Background, vtkTypeBool);
101 
103 
108  vtkSetMacro(SliceAtFocalPoint, vtkTypeBool);
109  vtkBooleanMacro(SliceAtFocalPoint, vtkTypeBool);
110  vtkGetMacro(SliceAtFocalPoint, vtkTypeBool);
112 
114 
119  vtkSetMacro(SliceFacesCamera, vtkTypeBool);
120  vtkBooleanMacro(SliceFacesCamera, vtkTypeBool);
121  vtkGetMacro(SliceFacesCamera, vtkTypeBool);
123 
125 
132  vtkGetObjectMacro(SlicePlane, vtkPlane);
134 
140  virtual void GetSlicePlaneInDataCoords(vtkMatrix4x4 *propMatrix,
141  double plane[4]);
142 
144 
147  vtkSetClampMacro(NumberOfThreads, int, 1, VTK_MAX_THREADS);
148  vtkGetMacro(NumberOfThreads, int);
150 
152 
161  vtkSetMacro(Streaming, vtkTypeBool);
162  vtkGetMacro(Streaming, vtkTypeBool);
163  vtkBooleanMacro(Streaming, vtkTypeBool);
165 
166 protected:
168  ~vtkImageMapper3D() override;
169 
171 
174  int FillInputPortInformation(int port, vtkInformation* info) override;
177 
181  int ProcessRequest(vtkInformation* request,
182  vtkInformationVector** inInfo,
183  vtkInformationVector* outInfo) override;
184 
189  static void CheckerboardRGBA(
190  unsigned char *data, int xsize, int ysize,
191  double originx, double originy, double spacingx, double spacingy);
192 
198  unsigned char *MakeTextureData(
199  vtkImageProperty *property, vtkImageData *input, int extent[6],
200  int &xsize, int &ysize, int &bytesPerPixel, bool &reuseTexture,
201  bool &reuseData);
202 
207  void MakeTextureGeometry(
208  const int extent[6], double coords[12], double tcoords[8]);
209 
217  virtual void ComputeTextureSize(
218  const int extent[6], int &xdim, int &ydim,
219  int imageSize[2], int textureSize[2]);
220 
225  vtkRenderer *GetCurrentRenderer();
226 
230  vtkImageSlice *GetCurrentProp() { return this->CurrentProp; }
231 
236  vtkMatrix4x4 *GetDataToWorldMatrix();
237 
242  void GetBackgroundColor(vtkImageProperty *property, double color[4]);
243 
250 
251  // The slice.
255 
256  // Information about the image, updated by UpdateInformation
257  double DataSpacing[3];
258  double DataOrigin[3];
259  int DataWholeExtent[6];
260 
261  // Set by vtkImageStack when doing multi-pass rendering
265 
266 private:
267  // The prop this mapper is attached to, or zero if none.
268  vtkImageSlice *CurrentProp;
269  vtkRenderer *CurrentRenderer;
270 
271  // The cached data-to-world matrix
272  vtkMatrix4x4 *DataToWorldMatrix;
273 
274  vtkImageMapper3D(const vtkImageMapper3D&) = delete;
275  void operator=(const vtkImageMapper3D&) = delete;
276 
277  friend class vtkImageToImageMapper3DFriendship;
278 };
279 
280 #endif
vtkTypeBool SliceAtFocalPoint
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:41
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
A class for performing multithreaded execution.
vtkScalarsToColors * DefaultLookupTable
map scalar values into colors via a lookup table
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
image display properties
vtkTypeBool Streaming
abstract specification for renderers
Definition: vtkRenderer.h:63
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:46
int vtkTypeBool
Definition: vtkABI.h:69
Superclass for mapping scalar values to colors.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
virtual int FillOutputPortInformation(int port, vtkInformation *info)
Fill the output port information objects for this algorithm.
a simple class to control print indentation
Definition: vtkIndent.h:39
abstract class for mapping images to the screen
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
perform various plane computations
Definition: vtkPlane.h:37
abstract class specifies interface to map 3D data
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
vtkImageSlice * GetCurrentProp()
Get the vtkImage prop associated with this mapper, or zero if none.
vtkMultiThreader * Threader
vtkTypeBool Background
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
represents an image in a 3D scene
Definition: vtkImageSlice.h:52
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this mapper.
Store zero or more vtkInformation instances.
general representation of visualization data
Definition: vtkDataObject.h:64
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkTypeBool SliceFacesCamera