VTK
vtkAMRSliceFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAMRSliceFilter.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 VTKAMRSLICEFILTER_H_
27 #define VTKAMRSLICEFILTER_H_
28 
29 #include "vtkFiltersAMRModule.h" // For export macro
31 
32 #include <vector> // For STL vector
33 
34 class vtkInformation;
36 class vtkOverlappingAMR;
38 class vtkPlane;
39 class vtkAMRBox;
40 class vtkUniformGrid;
41 
44 {
45 public:
46  static vtkAMRSliceFilter* New();
48  void PrintSelf(ostream &os, vtkIndent indent );
49 
50  // Inline Gettters & Setters
51  vtkSetMacro(OffSetFromOrigin,double);
52  vtkGetMacro(OffSetFromOrigin,double);
53 
55 
56  vtkSetMacro( ForwardUpstream, int );
57  vtkGetMacro( ForwardUpstream, int );
58  vtkBooleanMacro( ForwardUpstream, int );
60 
62 
63  vtkSetMacro( EnablePrefetching, int );
64  vtkGetMacro( EnablePrefetching, int );
65  vtkBooleanMacro( EnablePrefetching, int );
67 
69 
70  vtkSetMacro(MaxResolution,int);
71  vtkGetMacro(MaxResolution,int);
73 
75 
77  vtkSetMacro(Normal,int);
78  vtkGetMacro(Normal,int);
80 
82 
84  vtkSetMacro( Controller, vtkMultiProcessController* );
85  vtkGetMacro( Controller, vtkMultiProcessController* );
87 
88  // Standard Pipeline methods
89  virtual int RequestData(
93 
95 
97  virtual int RequestInformation(
98  vtkInformation *rqst,
99  vtkInformationVector **inputVector,
100  vtkInformationVector *outputVector );
102 
104 
105  virtual int RequestUpdateExtent(
108 
109 protected:
112 
115  int GetDonorCellIdx( double x[3], vtkUniformGrid *ug );
116 
118 
120  void ComputeCellCenter(
121  vtkUniformGrid *ug, const int cellIdx, double centroid[3] );
123 
126  vtkUniformGrid* GetSlice( double origin[3], int* dims, double* gorigin, double* spacing );
127 
129  void GetSliceCellData( vtkUniformGrid *slice, vtkUniformGrid *grid3D );
130 
132  bool PlaneIntersectsAMRBox( double plane[4], double bounds[6] );
133 
135 
138  void ComputeAMRBlocksToLoad(
139  vtkPlane *p, vtkOverlappingAMR *metadata );
141 
143 
144  void GetAMRSliceInPlane(
145  vtkPlane *p, vtkOverlappingAMR *inp,
146  vtkOverlappingAMR *out );
148 
150  bool IsAMRData2D( vtkOverlappingAMR *input );
151 
153  vtkPlane* GetCutPlane( vtkOverlappingAMR *input );
154 
156 
157  void InitializeOffSet(
158  vtkOverlappingAMR *inp, double *min, double *max );
160 
162  int Normal; // 1=>X-Normal, 2=>Y-Normal, 3=>Z-Normal
166 
169  // BTX
170  std::vector< int > BlocksToLoad;
171  // ETX
172 
173 private:
174  vtkAMRSliceFilter( const vtkAMRSliceFilter& ); // Not implemented
175  void operator=( const vtkAMRSliceFilter& ); // Not implemented
176 };
177 
178 #endif /* VTKAMRSLICEFILTER_H_ */
void PrintSelf(ostream &os, vtkIndent indent)
Store vtkAlgorithm input/output information.
Encloses a rectangular region of voxel like cells.
Definition: vtkAMRBox.h:38
#define VTKFILTERSAMR_EXPORT
virtual int FillInputPortInformation(int port, vtkInformation *info)
std::vector< int > BlocksToLoad
virtual int FillOutputPortInformation(int port, vtkInformation *info)
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkMultiProcessController * Controller
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
perform various plane computations
Definition: vtkPlane.h:36
image data with blanking
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
hierarchical dataset of vtkUniformGrids
Store zero or more vtkInformation instances.
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
static vtkOverlappingAMRAlgorithm * New()
#define max(a, b)
Multiprocessing communication superclass.