VTK
vtkAMRVolumeMapper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAMRVolumeMapper.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 =========================================================================*/
26 #ifndef vtkAMRVolumeMapper_h
27 #define vtkAMRVolumeMapper_h
28 
29 #include "vtkRenderingVolumeAMRModule.h" // For export macro
30 #include "vtkVolumeMapper.h"
31 #include "vtkImageReslice.h" // for VTK_RESLICE_NEAREST, VTK_RESLICE_CUBIC
32 
34 class vtkCamera;
35 class vtkImageData;
36 class vtkOverlappingAMR;
38 class vtkUniformGrid;
39 
40 class VTKRENDERINGVOLUMEAMR_EXPORT vtkAMRVolumeMapper : public vtkVolumeMapper
41 {
42 public:
43  static vtkAMRVolumeMapper *New();
45  void PrintSelf( ostream& os, vtkIndent indent );
46 
48 
51  virtual void SetInputData( vtkImageData* );
52  virtual void SetInputData( vtkDataSet* );
53  virtual void SetInputData( vtkOverlappingAMR* );
54  virtual void SetInputConnection (int port, vtkAlgorithmOutput *input);
55  virtual void SetInputConnection (vtkAlgorithmOutput *input)
56  {this->SetInputConnection(0, input);}
58 
60 
64  virtual double *GetBounds();
65  virtual void GetBounds(double bounds[6])
66  {this->vtkVolumeMapper::GetBounds(bounds); };
68 
80  virtual void SetScalarMode(int mode);
81 
83 
92  virtual void SetBlendMode(int mode);
93  virtual int GetBlendMode();
95 
97 
103  virtual void SelectScalarArray(int arrayNum);
104  virtual void SelectScalarArray(const char* arrayName);
106 
108 
111  virtual char* GetArrayName();
112  virtual int GetArrayId();
113  virtual int GetArrayAccessMode();
115 
119  const char *GetScalarModeAsString();
121 
125  virtual void SetCropping(int mode);
126  virtual int GetCropping();
128 
130 
135  virtual void SetCroppingRegionPlanes(double arg1, double arg2, double arg3,
136  double arg4, double arg5, double arg6);
137  virtual void SetCroppingRegionPlanes(double *planes)
139  planes[0],planes[1],planes[2],
140  planes[3],planes[4],planes[5]);}
141  virtual void GetCroppingRegionPlanes(double *planes);
142  virtual double *GetCroppingRegionPlanes();
144 
145 
156  virtual void SetCroppingRegionFlags(int mode);
157  virtual int GetCroppingRegionFlags();
159 
160 // The possible values for the default and current render mode ivars
161  enum
162  {
163  DefaultRenderMode=0,
169  InvalidRenderMode
170  };
171 
173 
177  void SetRequestedRenderMode(int mode);
178  int GetRequestedRenderMode();
180 
187  {this->SetRequestedRenderMode(vtkAMRVolumeMapper::DefaultRenderMode);}
188 
197  {this->SetRequestedRenderMode(vtkAMRVolumeMapper::RayCastAndTextureRenderMode);}
198 
205  {this->SetRequestedRenderMode(vtkAMRVolumeMapper::RayCastRenderMode);}
206 
214  {this->SetRequestedRenderMode(vtkAMRVolumeMapper::TextureRenderMode);}
215 
222  {this->SetRequestedRenderMode(vtkAMRVolumeMapper::GPURenderMode);}
223 
225 
229  void SetInterpolationMode(int mode);
230  int GetInterpolationMode();
232 
234  {this->SetInterpolationMode(VTK_RESLICE_NEAREST);}
235 
237  {this->SetInterpolationMode(VTK_RESLICE_LINEAR);}
238 
240  {this->SetInterpolationMode(VTK_RESLICE_CUBIC);}
241 
243 
247  vtkSetVector3Macro(NumberOfSamples,int);
248  vtkGetVector3Macro(NumberOfSamples,int);
250 
256  virtual void Render(vtkRenderer *ren, vtkVolume *vol);
257 
264  virtual void ReleaseGraphicsResources(vtkWindow *);
265 
266  void ProcessUpdateExtentRequest(vtkRenderer *renderer, vtkInformation*info,
267  vtkInformationVector **inputVector,
268  vtkInformationVector *outputVector);
269  void ProcessInformationRequest(vtkRenderer *renderer, vtkInformation*info,
270  vtkInformationVector **inputVector,
271  vtkInformationVector *outputVector);
272  void UpdateResampler(vtkRenderer *ren, vtkOverlappingAMR *amr);
273  void UpdateResamplerFrustrumMethod(vtkRenderer *ren, vtkOverlappingAMR *amr);
274 
276 
279  vtkSetMacro(RequestedResamplingMode, int);
280  vtkGetMacro(RequestedResamplingMode, int);
281  vtkSetMacro(FreezeFocalPoint, bool);
282  vtkGetMacro(FreezeFocalPoint, bool);
284 
286 
290  vtkSetMacro(ResamplerUpdateTolerance, double);
291  vtkGetMacro(ResamplerUpdateTolerance, double);
293 
295 
300  vtkSetMacro(UseDefaultThreading, bool);
301  vtkGetMacro(UseDefaultThreading, bool);
303 
308  static bool ComputeResamplerBoundsFrustumMethod(
309  vtkCamera* camera, vtkRenderer* renderer,
310  const double data_bounds[6], double out_bounds[6]);
311 
312 protected:
315 
316  // see algorithm for more info
318  void UpdateGrid();
319 
323  int NumberOfSamples[3];
324  double Bounds[6];
325  // This indicates that the input has meta data for
326  // doing demand driven operations.
330  // Cached values for camera focal point and
331  // the distance between the camera position and
332  // focal point
333  double LastFocalPointPosition[3];
335  // This is used when determing if
336  // either the camera or focal point has
337  // move enough to cause the resampler to update
341 
342 private:
343  vtkAMRVolumeMapper(const vtkAMRVolumeMapper&) VTK_DELETE_FUNCTION;
344  void operator=(const vtkAMRVolumeMapper&) VTK_DELETE_FUNCTION;
345 };
346 
347 
348 #endif
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:50
virtual char * GetArrayName()
Get the array name or number and component to use for rendering.
#define VTK_RESLICE_NEAREST
Abstract class for a volume mapper.
#define VTK_RESLICE_CUBIC
Store vtkAlgorithm input/output information.
Adaptive volume mapper.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
void SetRequestedRenderModeToDefault()
Set the requested render mode to vtkAMRVolumeMapper::DefaultRenderMode.
virtual int GetBlendMode()
Set/Get the blend mode.
virtual void SetCroppingRegionFlags(int)
Set the flags for the cropping regions.
vtkAMRResampleFilter * Resampler
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
virtual void SetInputConnection(vtkAlgorithmOutput *input)
Set the input data.
void SetRequestedRenderModeToGPU()
Set the requested render mode to vtkAMRVolumeMapper::GPURenderMode.
vtkSmartVolumeMapper * InternalMapper
virtual int FillInputPortInformation(int, vtkInformation *)
Fill the input port information objects for this algorithm.
void SetInterpolationModeToNearestNeighbor()
virtual void SetBlendMode(int)
Set/Get the blend mode.
const char * GetScalarModeAsString()
Return the method for obtaining scalar data.
abstract specification for renderers
Definition: vtkRenderer.h:63
vtkUniformGrid * Grid
virtual void SetScalarMode(int)
Control how the mapper works with scalar point data and cell attribute data.
virtual void SetInputData(vtkImageData *)
Set/Get the input data.
#define VTK_RESLICE_LINEAR
void SetRequestedRenderModeToRayCastAndTexture()
Set the requested render mode to vtkAMRVolumeMapper::RayCastAndTextureRenderMode. ...
Proxy object to connect input/output ports.
AMR class for a volume mapper.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
virtual void SetCroppingRegionPlanes(double, double, double, double, double, double)
Set/Get the Cropping Region Planes ( xmin, xmax, ymin, ymax, zmin, zmax ) These planes are defined in...
This filter is a concrete instance of vtkMultiBlockDataSetAlgorithm and provides functionality for ex...
a simple class to control print indentation
Definition: vtkIndent.h:39
a virtual camera for 3D rendering
Definition: vtkCamera.h:50
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
virtual double * GetCroppingRegionPlanes()
Set/Get the Cropping Region Planes ( xmin, xmax, ymin, ymax, zmin, zmax ) These planes are defined in...
void UpdateGrid(const int iteration)
virtual double * GetBounds()
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax, zmin,zmax).
virtual void SetInputConnection(int port, vtkAlgorithmOutput *input)
Set the connection for the given input port index.
virtual void Render(vtkRenderer *ren, vtkVolume *vol)=0
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
image data with blanking
virtual void SetCropping(int)
Turn On/Off orthogonal cropping.
virtual void SetCroppingRegionPlanes(double *planes)
Set/Get the Cropping Region Planes ( xmin, xmax, ymin, ymax, zmin, zmax ) These planes are defined in...
hierarchical dataset of vtkUniformGrids
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Store zero or more vtkInformation instances.
virtual int GetCropping()
Turn On/Off orthogonal cropping.
static vtkAlgorithm * New()
virtual void SelectScalarArray(int arrayNum)
When ScalarMode is set to UsePointFieldData or UseCellFieldData, you can specify which scalar array t...
virtual int GetCroppingRegionFlags()
Set the flags for the cropping regions.
void SetRequestedRenderModeToRayCast()
Set the requested render mode to vtkAMRVolumeMapper::RayCastRenderMode.
void SetRequestedRenderModeToTexture()
Set the requested render mode to vtkAMRVolumeMapper::TextureRenderMode.
virtual void GetBounds(double bounds[6])
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax, zmin,zmax).