VTK  9.7.1
vtkAMRCutPlane.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 vtkAMRCutPlane_h
16 #define vtkAMRCutPlane_h
17 
18 #include "vtkFiltersAMRModule.h" // For export macro
20 
21 #include <map> // For STL map
22 #include <vector> // For STL vector
23 
24 VTK_ABI_NAMESPACE_BEGIN
26 class vtkOverlappingAMR;
28 class vtkInformation;
30 class vtkIndent;
31 class vtkPlane;
32 class vtkUniformGrid;
34 class vtkCell;
35 class vtkPoints;
36 class vtkCellArray;
37 class vtkPointData;
38 class vtkCellData;
39 
40 class VTKFILTERSAMR_EXPORT vtkAMRCutPlane : public vtkMultiBlockDataSetAlgorithm
41 {
42 public:
43  static vtkAMRCutPlane* New();
45  void PrintSelf(ostream& oss, vtkIndent indent) override;
46 
48 
51  vtkSetVector3Macro(Center, double);
53 
55 
58  vtkSetVector3Macro(Normal, double);
60 
62 
65  vtkSetMacro(LevelOfResolution, int);
66  vtkGetMacro(LevelOfResolution, int);
68 
70 
75  vtkSetMacro(UseNativeCutter, bool);
76  vtkGetMacro(UseNativeCutter, bool);
77  vtkBooleanMacro(UseNativeCutter, bool);
79 
81 
85  virtual void SetController(vtkMultiProcessController*);
86  vtkGetObjectMacro(Controller, vtkMultiProcessController);
88 
89  // Standard pipeline routines
90 
94 
100  vtkInformationVector* outputVector) override;
101 
106 
110  vtkSetMacro(InitialRequest, bool);
111 
112 protected:
113  vtkAMRCutPlane();
114  ~vtkAMRCutPlane() override;
115 
120  vtkPlane* GetCutPlane(vtkOverlappingAMR* metadata);
121 
125  void ExtractCellFromGrid(vtkUniformGrid* grid, vtkCell* cell,
126  std::map<vtkIdType, vtkIdType>& gridPntMapping, vtkPoints* nodes, vtkCellArray* cells);
127 
132  void ExtractPointDataFromGrid(vtkUniformGrid* grid,
133  std::map<vtkIdType, vtkIdType>& gridPntMapping, vtkIdType NumNodes, vtkPointData* PD);
134 
139  void ExtractCellDataFromGrid(
140  vtkUniformGrid* grid, std::vector<vtkIdType>& cellIdxList, vtkCellData* CD);
141 
148  void ComputeAMRBlocksToLoad(vtkPlane* p, vtkOverlappingAMR* m);
149 
150  // Descriription:
151  // Initializes the cut-plane center given the min/max bounds.
152  void InitializeCenter(double min[3], double max[3]);
153 
155 
158  bool PlaneIntersectsAMRBox(vtkPlane* pl, double bounds[6]);
159  bool PlaneIntersectsAMRBox(double plane[4], double bounds[6]);
161 
165  bool PlaneIntersectsCell(vtkPlane* pl, vtkCell* cell);
166 
170  bool IsAMRData2D(vtkOverlappingAMR* input);
171 
175  vtkSmartPointer<vtkUnstructuredGrid> CutAMRBlock(vtkPlane* cutPlane, vtkUniformGrid* grid);
176 
178  double Center[3];
179  double Normal[3];
183 
184  std::vector<int> BlocksToLoad;
185 
186 private:
187  vtkAMRCutPlane(const vtkAMRCutPlane&) = delete;
188  void operator=(const vtkAMRCutPlane&) = delete;
189 };
190 
191 VTK_ABI_NAMESPACE_END
192 #endif /* vtkAMRCutPlane_h */
vtkMultiProcessController * Controller
represent and manipulate point attribute data
Definition: vtkPointData.h:30
Store vtkAlgorithm input/output information.
represent and manipulate cell attribute data
Definition: vtkCellData.h:31
A concrete instance of vtkMultiBlockDataSet that provides functionality for cutting an AMR dataset (a...
Hold a reference to a vtkObjectBase instance.
Definition: vtkMeta.h:23
int vtkIdType
Definition: vtkType.h:363
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
static vtkMultiBlockDataSetAlgorithm * New()
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
abstract class to specify cell behavior
Definition: vtkCell.h:50
a simple class to control print indentation
Definition: vtkIndent.h:28
dataset represents arbitrary combinations of all possible cell types
perform various plane computations
Definition: vtkPlane.h:31
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
Deprecated vtkImageData.
object to represent cell connectivity
Definition: vtkCellArray.h:177
Composite dataset that organizes datasets into blocks.
a multi-resolution dataset based on vtkCartesianGrid allowing overlaps
Store zero or more vtkInformation instances.
#define max(a, b)
represent and manipulate 3D points
Definition: vtkPoints.h:30
std::vector< int > BlocksToLoad
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
Multiprocessing communication superclass.