VTK  9.7.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
19 #ifndef vtkAMRSliceFilter_h
20 #define vtkAMRSliceFilter_h
21 
22 #include "vtkFiltersAMRModule.h" // For export macro
24 
25 #include <vector> // For STL vector
26 
27 VTK_ABI_NAMESPACE_BEGIN
28 class vtkInformation;
30 class vtkOverlappingAMR;
32 class vtkPlane;
33 class vtkAMRBox;
34 class vtkImageData;
35 
36 class VTKFILTERSAMR_EXPORT vtkAMRSliceFilter : public vtkOverlappingAMRAlgorithm
37 {
38 public:
39  static vtkAMRSliceFilter* New();
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
43  // Inline Getters & Setters
44 
46 
49  vtkSetMacro(OffsetFromOrigin, double);
50  vtkGetMacro(OffsetFromOrigin, double);
52 
54 
57  vtkSetMacro(MaxResolution, unsigned int);
58  vtkGetMacro(MaxResolution, unsigned int);
60 
64  enum NormalTag : char
65  {
66  X_NORMAL = 1,
67  Y_NORMAL = 2,
68  Z_NORMAL = 4
69  };
70 
72 
76  vtkSetMacro(Normal, int);
77  vtkGetMacro(Normal, int);
79 
81 
85  virtual void SetController(vtkMultiProcessController*);
86  vtkGetObjectMacro(Controller, vtkMultiProcessController);
88 
89  // Standard Pipeline methods
93 
99  vtkInformationVector* outputVector) override;
100 
105 
106 protected:
108  ~vtkAMRSliceFilter() override;
109 
114  int GetDonorCellIdx(double x[3], vtkImageData* imageData);
115 
120  int GetDonorPointIdx(double x[3], vtkImageData* imageData);
121 
126  void ComputeCellCenter(vtkImageData* imageData, int cellIdx, double centroid[3]);
127 
132  vtkImageData* GetSlice(double origin[3], int* dims, double* gorigin, double* spacing);
133 
137  void GetSliceCellData(vtkImageData* slice, vtkImageData* grid3D);
138 
142  void GetSlicePointData(vtkImageData* slice, vtkImageData* grid3D);
143 
147  bool PlaneIntersectsAMRBox(double plane[4], double bounds[6]);
148 
154  void ComputeAMRBlocksToLoad(vtkPlane* p, vtkOverlappingAMR* metadata);
155 
159  void GetAMRSliceInPlane(vtkPlane* p, vtkOverlappingAMR* inp, 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 VTK_ABI_NAMESPACE_END
184 #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:29
a simple class to control print indentation
Definition: vtkIndent.h:28
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
vtkMultiProcessController * Controller
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
perform various plane computations
Definition: vtkPlane.h:31
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.
a multi-resolution dataset based on vtkCartesianGrid allowing overlaps
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.