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 
51 
54  vtkSetMacro(OffsetFromOrigin,double);
55  vtkGetMacro(OffsetFromOrigin,double);
57 
59 
62  vtkSetMacro(MaxResolution,unsigned int);
63  vtkGetMacro(MaxResolution,unsigned int);
65 
69  enum NormalTag : int
70  {
71  X_NORMAL = 1, Y_NORMAL = 2, Z_NORMAL = 4
72  };
73 
75 
79  vtkSetMacro(Normal,int);
80  vtkGetMacro(Normal,int);
82 
84 
88  vtkSetMacro( Controller, vtkMultiProcessController* );
89  vtkGetMacro( Controller, vtkMultiProcessController* );
91 
92  // Standard Pipeline methods
93  int RequestData(
97 
102  int RequestInformation(
103  vtkInformation *rqst,
104  vtkInformationVector **inputVector,
105  vtkInformationVector *outputVector ) override;
106 
112 
113 protected:
115  ~vtkAMRSliceFilter() override;
116 
121  int GetDonorCellIdx( double x[3], vtkUniformGrid *ug );
122 
127  void ComputeCellCenter(
128  vtkUniformGrid *ug, const int cellIdx, double centroid[3] );
129 
134  vtkUniformGrid* GetSlice( double origin[3], int* dims, double* gorigin, double* spacing );
135 
139  void GetSliceCellData( vtkUniformGrid *slice, vtkUniformGrid *grid3D );
140 
144  bool PlaneIntersectsAMRBox( double plane[4], double bounds[6] );
145 
151  void ComputeAMRBlocksToLoad(
152  vtkPlane *p, vtkOverlappingAMR *metadata );
153 
157  void GetAMRSliceInPlane(
158  vtkPlane *p, vtkOverlappingAMR *inp,
159  vtkOverlappingAMR *out );
160 
164  bool IsAMRData2D( vtkOverlappingAMR *input );
165 
169  vtkPlane* GetCutPlane( vtkOverlappingAMR *input );
170 
172  int Normal;
173  unsigned int MaxResolution;
175 
176  std::vector< int > BlocksToLoad;
177 
178 private:
179  vtkAMRSliceFilter( const vtkAMRSliceFilter& ) = delete;
180  void operator=( const vtkAMRSliceFilter& ) = delete;
181 };
182 
183 #endif /* vtkAMRSliceFilter_h */
A base class for all algorithms that take as input vtkOverlappingAMR and produce vtkOverlappingAMR.
Store vtkAlgorithm input/output information.
Encloses a rectangular region of voxel like cells.
Definition: vtkAMRBox.h:33
std::vector< int > BlocksToLoad
a simple class to control print indentation
Definition: vtkIndent.h:33
NormalTag
Tags to identify normals along the X, Y and Z directions.
vtkMultiProcessController * Controller
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()
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.
unsigned int MaxResolution
Multiprocessing communication superclass.