VTK  9.3.1
vtkAMRSliceFilter.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
15 #ifndef vtkAMRSliceFilter_h
16 #define vtkAMRSliceFilter_h
17 
18 #include "vtkFiltersAMRModule.h" // For export macro
20 
21 #include <vector> // For STL vector
22 
23 VTK_ABI_NAMESPACE_BEGIN
24 class vtkInformation;
26 class vtkOverlappingAMR;
28 class vtkPlane;
29 class vtkAMRBox;
30 class vtkUniformGrid;
31 
32 class VTKFILTERSAMR_EXPORT vtkAMRSliceFilter : public vtkOverlappingAMRAlgorithm
33 {
34 public:
35  static vtkAMRSliceFilter* New();
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
39  // Inline Getters & Setters
40 
42 
45  vtkSetMacro(OffsetFromOrigin, double);
46  vtkGetMacro(OffsetFromOrigin, double);
48 
50 
53  vtkSetMacro(MaxResolution, unsigned int);
54  vtkGetMacro(MaxResolution, unsigned int);
56 
60  enum NormalTag : char
61  {
62  X_NORMAL = 1,
63  Y_NORMAL = 2,
64  Z_NORMAL = 4
65  };
66 
68 
72  vtkSetMacro(Normal, int);
73  vtkGetMacro(Normal, int);
75 
77 
81  virtual void SetController(vtkMultiProcessController*);
82  vtkGetObjectMacro(Controller, vtkMultiProcessController);
84 
85  // Standard Pipeline methods
89 
95  vtkInformationVector* outputVector) override;
96 
101 
102 protected:
104  ~vtkAMRSliceFilter() override;
105 
110  int GetDonorCellIdx(double x[3], vtkUniformGrid* ug);
111 
116  int GetDonorPointIdx(double x[3], vtkUniformGrid* ug);
117 
122  void ComputeCellCenter(vtkUniformGrid* ug, int cellIdx, double centroid[3]);
123 
128  vtkUniformGrid* GetSlice(double origin[3], int* dims, double* gorigin, double* spacing);
129 
133  void GetSliceCellData(vtkUniformGrid* slice, vtkUniformGrid* grid3D);
134 
138  void GetSlicePointData(vtkUniformGrid* slice, vtkUniformGrid* grid3D);
139 
143  bool PlaneIntersectsAMRBox(double plane[4], double bounds[6]);
144 
150  void ComputeAMRBlocksToLoad(vtkPlane* p, vtkOverlappingAMR* metadata);
151 
155  void GetAMRSliceInPlane(vtkPlane* p, vtkOverlappingAMR* inp, vtkOverlappingAMR* out);
156 
160  bool IsAMRData2D(vtkOverlappingAMR* input);
161 
165  vtkPlane* GetCutPlane(vtkOverlappingAMR* input);
166 
168  int Normal;
169  unsigned int MaxResolution;
171 
172  std::vector<int> BlocksToLoad;
173 
174 private:
175  vtkAMRSliceFilter(const vtkAMRSliceFilter&) = delete;
176  void operator=(const vtkAMRSliceFilter&) = delete;
177 };
178 
179 VTK_ABI_NAMESPACE_END
180 #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:28
a simple class to control print indentation
Definition: vtkIndent.h:28
vtkMultiProcessController * Controller
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
perform various plane computations
Definition: vtkPlane.h:25
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.