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 =========================================================================*/
25 #ifndef vtkAMRVolumeMapper_h
26 #define vtkAMRVolumeMapper_h
27 
28 #include "vtkRenderingVolumeAMRModule.h" // For export macro
29 #include "vtkVolumeMapper.h"
30 #include "vtkImageReslice.h" // for VTK_RESLICE_NEAREST, VTK_RESLICE_CUBIC
31 
33 class vtkCamera;
34 class vtkImageData;
35 class vtkOverlappingAMR;
37 class vtkUniformGrid;
38 
39 class VTKRENDERINGVOLUMEAMR_EXPORT vtkAMRVolumeMapper : public vtkVolumeMapper
40 {
41 public:
42  static vtkAMRVolumeMapper *New();
44  void PrintSelf( ostream& os, vtkIndent indent );
45 
47 
48  virtual void SetInputData( vtkImageData* );
49  virtual void SetInputData( vtkDataSet* );
50  virtual void SetInputData( vtkOverlappingAMR* );
51  virtual void SetInputConnection (int port, vtkAlgorithmOutput *input);
52  virtual void SetInputConnection (vtkAlgorithmOutput *input)
53  {this->SetInputConnection(0, input);}
55 
57 
59  virtual double *GetBounds();
60  virtual void GetBounds(double bounds[6])
61  {this->vtkVolumeMapper::GetBounds(bounds); };
63 
73  virtual void SetScalarMode(int mode);
74 
76 
82  virtual void SetBlendMode(int mode);
83  virtual int GetBlendMode();
85 
87 
91  virtual void SelectScalarArray(int arrayNum);
92  virtual void SelectScalarArray(const char* arrayName);
94 
96 
97  virtual char* GetArrayName();
98  virtual int GetArrayId();
99  virtual int GetArrayAccessMode();
101 
103  const char *GetScalarModeAsString();
105 
107  virtual void SetCropping(int mode);
108  virtual int GetCropping();
110 
112 
115  virtual void SetCroppingRegionPlanes(double arg1, double arg2, double arg3,
116  double arg4, double arg5, double arg6);
117  virtual void SetCroppingRegionPlanes(double *planes)
119  planes[0],planes[1],planes[2],
120  planes[3],planes[4],planes[5]);}
121  virtual void GetCroppingRegionPlanes(double *planes);
122  virtual double *GetCroppingRegionPlanes();
124 
125 
134  virtual void SetCroppingRegionFlags(int mode);
135  virtual int GetCroppingRegionFlags();
137 
138 //BTX
139 // The possible values for the default and current render mode ivars
140  enum
141  {
142  DefaultRenderMode=0,
148  InvalidRenderMode
149  };
150 //ETX
151 
153 
155  void SetRequestedRenderMode(int mode);
156  int GetRequestedRenderMode();
158 
160 
165  {this->SetRequestedRenderMode(vtkAMRVolumeMapper::DefaultRenderMode);}
167 
169 
175  {this->SetRequestedRenderMode(vtkAMRVolumeMapper::RayCastAndTextureRenderMode);}
177 
179 
184  {this->SetRequestedRenderMode(vtkAMRVolumeMapper::RayCastRenderMode);}
186 
188 
193  {this->SetRequestedRenderMode(vtkAMRVolumeMapper::TextureRenderMode);}
195 
197 
200  {this->SetRequestedRenderMode(vtkAMRVolumeMapper::GPURenderMode);}
202 
204 
206  void SetInterpolationMode(int mode);
207  int GetInterpolationMode();
209 
211  {this->SetInterpolationMode(VTK_RESLICE_NEAREST);}
212 
214  {this->SetInterpolationMode(VTK_RESLICE_LINEAR);}
215 
217  {this->SetInterpolationMode(VTK_RESLICE_CUBIC);}
218 
220 
222  vtkSetVector3Macro(NumberOfSamples,int);
223  vtkGetVector3Macro(NumberOfSamples,int);
225 
226 //BTX
229  virtual void Render(vtkRenderer *ren, vtkVolume *vol);
230 
235  virtual void ReleaseGraphicsResources(vtkWindow *);
236 
237  void ProcessUpdateExtentRequest(vtkRenderer *renderer, vtkInformation*info,
238  vtkInformationVector **inputVector,
239  vtkInformationVector *outputVector);
240  void ProcessInformationRequest(vtkRenderer *renderer, vtkInformation*info,
241  vtkInformationVector **inputVector,
242  vtkInformationVector *outputVector);
243  void UpdateResampler(vtkRenderer *ren, vtkOverlappingAMR *amr);
244  void UpdateResamplerFrustrumMethod(vtkRenderer *ren, vtkOverlappingAMR *amr);
245 //ETX
246 
248 
249  vtkSetMacro(RequestedResamplingMode, int);
250  vtkGetMacro(RequestedResamplingMode, int);
251  vtkSetMacro(FreezeFocalPoint, bool);
252  vtkGetMacro(FreezeFocalPoint, bool);
254 
256 
258  vtkSetMacro(ResamplerUpdateTolerance, double);
259  vtkGetMacro(ResamplerUpdateTolerance, double);
261 
263 
267  vtkSetMacro(UseDefaultThreading, bool);
268  vtkGetMacro(UseDefaultThreading, bool);
270 
272 
274  static bool ComputeResamplerBoundsFrustumMethod(
275  vtkCamera* camera, vtkRenderer* renderer,
276  const double data_bounds[6], double out_bounds[6]);
277 protected:
281 
282  // see algorithm for more info
284  void UpdateGrid();
285 
289  int NumberOfSamples[3];
290  double Bounds[6];
291  // This indicates that the input has meta data for
292  // doing demand driven operations.
296  // Cached values for camera focal point and
297  // the distance between the camera position and
298  // focal point
299  double LastFocalPointPosition[3];
301  // This is used when determing if
302  // either the camera or focal point has
303  // move enough to cause the resampler to update
307 
308 private:
309  vtkAMRVolumeMapper(const vtkAMRVolumeMapper&); // Not implemented.
310  void operator=(const vtkAMRVolumeMapper&); // Not implemented.
311 };
312 
313 
314 #endif
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:49
#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)
void SetRequestedRenderModeToDefault()
virtual int GetBlendMode()
virtual void SetCroppingRegionFlags(int)
vtkAMRResampleFilter * Resampler
abstract class to specify dataset behavior
Definition: vtkDataSet.h:61
virtual void SetInputConnection(vtkAlgorithmOutput *input)
vtkSmartVolumeMapper * InternalMapper
virtual int FillInputPortInformation(int, vtkInformation *)
void SetInterpolationModeToNearestNeighbor()
virtual void SetBlendMode(int)
const char * GetScalarModeAsString()
abstract specification for renderers
Definition: vtkRenderer.h:63
vtkUniformGrid * Grid
virtual void SetScalarMode(int)
virtual void SetInputData(vtkImageData *)
#define VTK_RESLICE_LINEAR
void SetRequestedRenderModeToRayCastAndTexture()
Proxy object to connect input/output ports.
AMR class for a volume mapper.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
virtual void SetCroppingRegionPlanes(double, double, double, double, double, double)
a simple class to control print indentation
Definition: vtkIndent.h:38
a virtual camera for 3D rendering
Definition: vtkCamera.h:48
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
virtual double * GetCroppingRegionPlanes()
virtual double * GetBounds()
virtual void SetInputConnection(int port, vtkAlgorithmOutput *input)
virtual void Render(vtkRenderer *ren, vtkVolume *vol)=0
image data with blanking
virtual void SetCropping(int)
virtual void SetCroppingRegionPlanes(double *planes)
hierarchical dataset of vtkUniformGrids
virtual void ReleaseGraphicsResources(vtkWindow *)
Store zero or more vtkInformation instances.
virtual int GetCropping()
static vtkAlgorithm * New()
virtual void SelectScalarArray(int arrayNum)
virtual int GetCroppingRegionFlags()
void SetRequestedRenderModeToRayCast()
void SetRequestedRenderModeToTexture()
virtual void GetBounds(double bounds[6])