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  =========================================================================*/
27 #ifndef vtkAMRSliceFilter_h
28 #define vtkAMRSliceFilter_h
29 
30 #include "vtkFiltersAMRModule.h" // For export macro
32 
33 #include <vector> // For STL vector
34 
35 class vtkInformation;
37 class vtkOverlappingAMR;
39 class vtkPlane;
40 class vtkAMRBox;
41 class vtkUniformGrid;
42 
43 class VTKFILTERSAMR_EXPORT vtkAMRSliceFilter :
45 {
46 public:
47  static vtkAMRSliceFilter* New();
49  void PrintSelf(ostream &os, vtkIndent indent ) override;
50 
51  // Inline Gettters & Setters
52 
54 
57  vtkSetMacro(OffsetFromOrigin,double);
58  vtkGetMacro(OffsetFromOrigin,double);
60 
62 
65  vtkSetMacro(MaxResolution,unsigned int);
66  vtkGetMacro(MaxResolution,unsigned int);
68 
72  enum NormalTag : int
73  {
74  X_NORMAL = 1, Y_NORMAL = 2, Z_NORMAL = 4
75  };
76 
78 
82  vtkSetMacro(Normal,int);
83  vtkGetMacro(Normal,int);
85 
87 
91  vtkSetMacro( Controller, vtkMultiProcessController* );
92  vtkGetMacro( Controller, vtkMultiProcessController* );
94 
95  // Standard Pipeline methods
96  int RequestData(
100 
105  int RequestInformation(
106  vtkInformation *rqst,
107  vtkInformationVector **inputVector,
108  vtkInformationVector *outputVector ) override;
109 
115 
116 protected:
118  ~vtkAMRSliceFilter() override;
119 
124  int GetDonorCellIdx( double x[3], vtkUniformGrid *ug );
125 
130  void ComputeCellCenter(
131  vtkUniformGrid *ug, const int cellIdx, double centroid[3] );
132 
137  vtkUniformGrid* GetSlice( double origin[3], int* dims, double* gorigin, double* spacing );
138 
142  void GetSliceCellData( vtkUniformGrid *slice, vtkUniformGrid *grid3D );
143 
147  bool PlaneIntersectsAMRBox( double plane[4], double bounds[6] );
148 
154  void ComputeAMRBlocksToLoad(
155  vtkPlane *p, vtkOverlappingAMR *metadata );
156 
160  void GetAMRSliceInPlane(
161  vtkPlane *p, vtkOverlappingAMR *inp,
162  vtkOverlappingAMR *out );
163 
167  bool IsAMRData2D( vtkOverlappingAMR *input );
168 
172  vtkPlane* GetCutPlane( vtkOverlappingAMR *input );
173 
175  int Normal;
176  unsigned int MaxResolution;
178 
179  std::vector< int > BlocksToLoad;
180 
181 private:
182  vtkAMRSliceFilter( const vtkAMRSliceFilter& ) = delete;
183  void operator=( const vtkAMRSliceFilter& ) = delete;
184 };
185 
186 #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:39
std::vector< int > BlocksToLoad
a simple class to control print indentation
Definition: vtkIndent.h:39
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:37
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.