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  =========================================================================*/
24 #ifndef vtkAMRSliceFilter_h
25 #define vtkAMRSliceFilter_h
26 
27 #include "vtkFiltersAMRModule.h" // For export macro
29 
30 #include <vector> // For STL vector
31 
32 class vtkInformation;
34 class vtkOverlappingAMR;
36 class vtkPlane;
37 class vtkAMRBox;
38 class vtkUniformGrid;
39 
40 class VTKFILTERSAMR_EXPORT vtkAMRSliceFilter :
42 {
43 public:
44  static vtkAMRSliceFilter* New();
46  void PrintSelf(ostream &os, vtkIndent indent ) override;
47 
48  // Inline Gettters & Setters
49  vtkSetMacro(OffSetFromOrigin,double);
50  vtkGetMacro(OffSetFromOrigin,double);
51 
53 
56  vtkSetMacro( ForwardUpstream, vtkTypeBool );
57  vtkGetMacro( ForwardUpstream, vtkTypeBool );
58  vtkBooleanMacro( ForwardUpstream, vtkTypeBool );
60 
62 
65  vtkSetMacro( EnablePrefetching, vtkTypeBool );
66  vtkGetMacro( EnablePrefetching, vtkTypeBool );
67  vtkBooleanMacro( EnablePrefetching, vtkTypeBool );
69 
71 
74  vtkSetMacro(MaxResolution,int);
75  vtkGetMacro(MaxResolution,int);
77 
79 
83  vtkSetMacro(Normal,int);
84  vtkGetMacro(Normal,int);
86 
88 
92  vtkSetMacro( Controller, vtkMultiProcessController* );
93  vtkGetMacro( Controller, vtkMultiProcessController* );
95 
96  // Standard Pipeline methods
97  int RequestData(
101 
106  int RequestInformation(
107  vtkInformation *rqst,
108  vtkInformationVector **inputVector,
109  vtkInformationVector *outputVector ) override;
110 
116 
117 protected:
119  ~vtkAMRSliceFilter() override;
120 
125  int GetDonorCellIdx( double x[3], vtkUniformGrid *ug );
126 
131  void ComputeCellCenter(
132  vtkUniformGrid *ug, const int cellIdx, double centroid[3] );
133 
138  vtkUniformGrid* GetSlice( double origin[3], int* dims, double* gorigin, double* spacing );
139 
143  void GetSliceCellData( vtkUniformGrid *slice, vtkUniformGrid *grid3D );
144 
148  bool PlaneIntersectsAMRBox( double plane[4], double bounds[6] );
149 
155  void ComputeAMRBlocksToLoad(
156  vtkPlane *p, vtkOverlappingAMR *metadata );
157 
161  void GetAMRSliceInPlane(
162  vtkPlane *p, vtkOverlappingAMR *inp,
163  vtkOverlappingAMR *out );
164 
168  bool IsAMRData2D( vtkOverlappingAMR *input );
169 
173  vtkPlane* GetCutPlane( vtkOverlappingAMR *input );
174 
178  void InitializeOffSet(
179  vtkOverlappingAMR *inp, double *min, double *max );
180 
182  int Normal; // 1=>X-Normal, 2=>Y-Normal, 3=>Z-Normal
186 
189 
190  std::vector< int > BlocksToLoad;
191 
192 private:
193  vtkAMRSliceFilter( const vtkAMRSliceFilter& ) = delete;
194  void operator=( const vtkAMRSliceFilter& ) = delete;
195 };
196 
197 #endif /* vtkAMRSliceFilter_h */
A base class for all algorithms that take as input vtkOverlappingAMR and produce vtkOverlappingAMR.
vtkTypeBool ForwardUpstream
Store vtkAlgorithm input/output information.
Encloses a rectangular region of voxel like cells.
Definition: vtkAMRBox.h:33
int vtkTypeBool
Definition: vtkABI.h:69
std::vector< int > BlocksToLoad
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkMultiProcessController * Controller
vtkTypeBool EnablePrefetching
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
perform various plane computations
Definition: vtkPlane.h:31
image data with blanking
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
hierarchical dataset of vtkUniformGrids
Store zero or more vtkInformation instances.
A concrete instance of vtkOverlappingAMRAlgorithm which implements functionality for extracting slice...
int FillOutputPortInformation(int port, vtkInformation *info) override
See algorithm for more info.
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
static vtkOverlappingAMRAlgorithm * New()
#define max(a, b)
int FillInputPortInformation(int port, vtkInformation *info) override
See algorithm for more info.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Multiprocessing communication superclass.