VTK  9.0.1
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 : public vtkOverlappingAMRAlgorithm
41 {
42 public:
43  static vtkAMRSliceFilter* New();
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
47  // Inline Gettters & Setters
48 
50 
53  vtkSetMacro(OffsetFromOrigin, double);
54  vtkGetMacro(OffsetFromOrigin, double);
56 
58 
61  vtkSetMacro(MaxResolution, unsigned int);
62  vtkGetMacro(MaxResolution, unsigned int);
64 
68  enum NormalTag : char
69  {
70  X_NORMAL = 1,
71  Y_NORMAL = 2,
72  Z_NORMAL = 4
73  };
74 
76 
80  vtkSetMacro(Normal, int);
81  vtkGetMacro(Normal, int);
83 
85 
89  vtkSetMacro(Controller, vtkMultiProcessController*);
90  vtkGetMacro(Controller, vtkMultiProcessController*);
92 
93  // Standard Pipeline methods
97 
102  int RequestInformation(vtkInformation* rqst, vtkInformationVector** inputVector,
103  vtkInformationVector* outputVector) override;
104 
109 
110 protected:
112  ~vtkAMRSliceFilter() override = default;
113 
118  int GetDonorCellIdx(double x[3], vtkUniformGrid* ug);
119 
124  int GetDonorPointIdx(double x[3], vtkUniformGrid* ug);
125 
130  void ComputeCellCenter(vtkUniformGrid* ug, const int cellIdx, double centroid[3]);
131 
136  vtkUniformGrid* GetSlice(double origin[3], int* dims, double* gorigin, double* spacing);
137 
141  void GetSliceCellData(vtkUniformGrid* slice, vtkUniformGrid* grid3D);
142 
146  void GetSlicePointData(vtkUniformGrid* slice, vtkUniformGrid* grid3D);
147 
151  bool PlaneIntersectsAMRBox(double plane[4], double bounds[6]);
152 
158  void ComputeAMRBlocksToLoad(vtkPlane* p, vtkOverlappingAMR* metadata);
159 
163  void GetAMRSliceInPlane(vtkPlane* p, vtkOverlappingAMR* inp, vtkOverlappingAMR* out);
164 
168  bool IsAMRData2D(vtkOverlappingAMR* input);
169 
173  vtkPlane* GetCutPlane(vtkOverlappingAMR* input);
174 
176  int Normal;
177  unsigned int MaxResolution;
179 
180  std::vector<int> BlocksToLoad;
181 
182 private:
183  vtkAMRSliceFilter(const vtkAMRSliceFilter&) = delete;
184  void operator=(const vtkAMRSliceFilter&) = delete;
185 };
186 
187 #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
a simple class to control print indentation
Definition: vtkIndent.h:33
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
NormalTag
Tags to identify normals along the X, Y and Z directions.
std::vector< int > BlocksToLoad
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.