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
34class vtkCamera;
35class vtkImageData;
38class vtkUniformGrid;
39
40class VTKRENDERINGVOLUMEAMR_EXPORT vtkAMRVolumeMapper : public vtkVolumeMapper
41{
42public:
45 void PrintSelf( ostream& os, vtkIndent indent );
46
48
51 virtual void SetInputData( vtkImageData* );
52 virtual void SetInputData( vtkDataSet* );
54 virtual void SetInputConnection (int port, 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
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);
159
160// The possible values for the default and current render mode ivars
161 enum
162 {
163 DefaultRenderMode=0,
169 InvalidRenderMode
170 };
171
173
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
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
265
267 vtkInformationVector **inputVector,
268 vtkInformationVector *outputVector);
270 vtkInformationVector **inputVector,
271 vtkInformationVector *outputVector);
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
309 vtkCamera* camera, vtkRenderer* renderer,
310 const double data_bounds[6], double out_bounds[6]);
311
312protected:
315
316 // see algorithm for more info
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
342private:
343 vtkAMRVolumeMapper(const vtkAMRVolumeMapper&) VTK_DELETE_FUNCTION;
344 void operator=(const vtkAMRVolumeMapper&) VTK_DELETE_FUNCTION;
345};
346
347
348#endif
This filter is a concrete instance of vtkMultiBlockDataSetAlgorithm and provides functionality for ex...
AMR class for a volume mapper.
void SetInterpolationMode(int mode)
Set interpolation mode for downsampling (lowres GPU) (initial value: cubic).
virtual void SetInputData(vtkImageData *)
Set the input data.
virtual void GetCroppingRegionPlanes(double *planes)
virtual void SetCroppingRegionPlanes(double arg1, double arg2, double arg3, double arg4, double arg5, double arg6)
Set/Get the Cropping Region Planes ( xmin, xmax, ymin, ymax, zmin, zmax ) These planes are defined in...
virtual double * GetBounds()
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax,...
void UpdateResampler(vtkRenderer *ren, vtkOverlappingAMR *amr)
virtual void SetCroppingRegionPlanes(double *planes)
virtual void SelectScalarArray(int arrayNum)
When ScalarMode is set to UsePointFieldData or UseCellFieldData, you can specify which scalar array t...
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
void SetRequestedRenderModeToRayCast()
Set the requested render mode to vtkAMRVolumeMapper::RayCastRenderMode.
virtual void SetCropping(int mode)
Turn On/Off orthogonal cropping.
const char * GetScalarModeAsString()
Return the method for obtaining scalar data.
virtual char * GetArrayName()
Get the array name or number and component to use for rendering.
void UpdateResamplerFrustrumMethod(vtkRenderer *ren, vtkOverlappingAMR *amr)
void ProcessUpdateExtentRequest(vtkRenderer *renderer, vtkInformation *info, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
virtual void SetBlendMode(int mode)
Set/Get the blend mode.
virtual double * GetCroppingRegionPlanes()
vtkSmartVolumeMapper * InternalMapper
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkUniformGrid * Grid
virtual void SetCroppingRegionFlags(int mode)
Set the flags for the cropping regions.
virtual void SetInputData(vtkOverlappingAMR *)
virtual void SetInputConnection(int port, vtkAlgorithmOutput *input)
Set the connection for the given input port index.
static vtkAMRVolumeMapper * New()
virtual int GetBlendMode()
void SetRequestedRenderModeToTexture()
Set the requested render mode to vtkAMRVolumeMapper::TextureRenderMode.
virtual void SetScalarMode(int mode)
Control how the mapper works with scalar point data and cell attribute data.
virtual void SetInputConnection(vtkAlgorithmOutput *input)
virtual void SelectScalarArray(const char *arrayName)
void ProcessInformationRequest(vtkRenderer *renderer, vtkInformation *info, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
void SetInterpolationModeToNearestNeighbor()
virtual void Render(vtkRenderer *ren, vtkVolume *vol)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
virtual void SetInputData(vtkDataSet *)
void SetRequestedRenderMode(int mode)
Set the requested render mode.
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
void SetRequestedRenderModeToRayCastAndTexture()
Set the requested render mode to vtkAMRVolumeMapper::RayCastAndTextureRenderMode.
virtual int GetCropping()
virtual int GetCroppingRegionFlags()
void SetRequestedRenderModeToGPU()
Set the requested render mode to vtkAMRVolumeMapper::GPURenderMode.
static bool ComputeResamplerBoundsFrustumMethod(vtkCamera *camera, vtkRenderer *renderer, const double data_bounds[6], double out_bounds[6])
Utility method used by UpdateResamplerFrustrumMethod() to compute the bounds.
int GetRequestedRenderMode()
virtual void GetBounds(double bounds[6])
Get the bounds for this mapper as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
virtual int GetArrayId()
virtual int GetArrayAccessMode()
void SetRequestedRenderModeToDefault()
Set the requested render mode to vtkAMRVolumeMapper::DefaultRenderMode.
vtkAMRResampleFilter * Resampler
virtual double * GetBounds()
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax,...
Proxy object to connect input/output ports.
virtual void SetInputConnection(int port, vtkAlgorithmOutput *input)
Set the connection for the given input port index.
a virtual camera for 3D rendering
Definition: vtkCamera.h:51
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
hierarchical dataset of vtkUniformGrids
abstract specification for renderers
Definition: vtkRenderer.h:64
Adaptive volume mapper.
image data with blanking
Abstract class for a volume mapper.
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...
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:51
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
@ info
Definition: vtkX3D.h:376
@ mode
Definition: vtkX3D.h:247
@ port
Definition: vtkX3D.h:447
#define VTK_RESLICE_CUBIC
#define VTK_RESLICE_NEAREST
#define VTK_RESLICE_LINEAR
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.