VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
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);
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 
231  virtual void SetInteractiveUpdateRate(double rate);
232 
235  virtual double GetInteractiveUpdateRate();
236 
237 //BTX
240  virtual void Render(vtkRenderer *ren, vtkVolume *vol);
241 
246  virtual void ReleaseGraphicsResources(vtkWindow *);
247 
248  void ProcessUpdateExtentRequest(vtkRenderer *renderer, vtkInformation*info,
249  vtkInformationVector **inputVector,
250  vtkInformationVector *outputVector);
251  void ProcessInformationRequest(vtkRenderer *renderer, vtkInformation*info,
252  vtkInformationVector **inputVector,
253  vtkInformationVector *outputVector);
254  void UpdateResampler(vtkRenderer *ren, vtkOverlappingAMR *amr);
255  void UpdateResamplerFrustrumMethod(vtkRenderer *ren, vtkOverlappingAMR *amr);
256 //ETX
257 
259 
260  vtkSetMacro(RequestedResamplingMode, int);
261  vtkGetMacro(RequestedResamplingMode, int);
262  vtkSetMacro(FreezeFocalPoint, bool);
263  vtkGetMacro(FreezeFocalPoint, bool);
265 
267 
269  vtkSetMacro(ResamplerUpdateTolerance, double);
270  vtkGetMacro(ResamplerUpdateTolerance, double);
272 
274 
278  vtkSetMacro(UseDefaultThreading, bool);
279  vtkGetMacro(UseDefaultThreading, bool);
281 
283 
285  static bool ComputeResamplerBoundsFrustumMethod(
286  vtkCamera* camera, vtkRenderer* renderer,
287  const double data_bounds[6], double out_bounds[6]);
288 protected:
292 
293  // see algorithm for more info
295  void UpdateGrid();
296 
300  int NumberOfSamples[3];
301  double Bounds[6];
302  // This indicates that the input has meta data for
303  // doing demand driven operations.
307  // Cached values for camera focal point and
308  // the distance between the camera position and
309  // focal point
310  double LastFocalPointPosition[3];
312  // This is used when determing if
313  // either the camera or focal point has
314  // move enough to cause the resampler to update
318 
319 private:
320  vtkAMRVolumeMapper(const vtkAMRVolumeMapper&); // Not implemented.
321  void operator=(const vtkAMRVolumeMapper&); // Not implemented.
322 };
323 
324 
325 #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()
GLenum GLenum GLenum input
Definition: vtkgl.h:15941
virtual void SetCroppingRegionFlags(int)
vtkAMRResampleFilter * Resampler
abstract class to specify dataset behavior
Definition: vtkDataSet.h:60
virtual void SetInputConnection(vtkAlgorithmOutput *input)
vtkSmartVolumeMapper * InternalMapper
virtual int FillInputPortInformation(int, vtkInformation *)
void SetInterpolationModeToNearestNeighbor()
virtual void SetBlendMode(int)
const char * GetScalarModeAsString()
GLuint GLuint GLuint GLuint arg1
Definition: vtkgl.h:16715
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:33
virtual void SetCroppingRegionPlanes(double, double, double, double, double, double)
a simple class to control print indentation
Definition: vtkIndent.h:38
GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg3
Definition: vtkgl.h:16717
a virtual camera for 3D rendering
Definition: vtkCamera.h:48
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
Definition: vtkgl.h:16716
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)
#define VTKRENDERINGVOLUMEAMR_EXPORT
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()
GLenum mode
Definition: vtkgl.h:12325
virtual void GetBounds(double bounds[6])