VTK  9.5.20250715
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
24VTK_ABI_NAMESPACE_BEGIN
28class vtkInformation;
30class vtkIndent;
31class vtkPlane;
32class vtkUniformGrid;
34class vtkCell;
35class vtkPoints;
36class vtkCellArray;
37class vtkPointData;
38class vtkCellData;
39
40class VTKFILTERSAMR_EXPORT vtkAMRCutPlane : public vtkMultiBlockDataSetAlgorithm
41{
42public:
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
86 vtkGetObjectMacro(Controller, vtkMultiProcessController);
88
89 // Standard pipeline routines
90
92 int FillInputPortInformation(int port, vtkInformation* info) override;
93 int FillOutputPortInformation(int port, vtkInformation* info) override;
94
100 vtkInformationVector* outputVector) override;
101
106
110 vtkSetMacro(InitialRequest, bool);
111
112protected:
114 ~vtkAMRCutPlane() override;
115
121
126 std::map<vtkIdType, vtkIdType>& gridPntMapping, vtkPoints* nodes, vtkCellArray* cells);
127
133 std::map<vtkIdType, vtkIdType>& gridPntMapping, vtkIdType NumNodes, vtkPointData* PD);
134
140 vtkUniformGrid* grid, std::vector<vtkIdType>& cellIdxList, vtkCellData* CD);
141
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
166
171
176
178 double Center[3];
179 double Normal[3];
183
184 std::vector<int> BlocksToLoad;
185
186private:
187 vtkAMRCutPlane(const vtkAMRCutPlane&) = delete;
188 void operator=(const vtkAMRCutPlane&) = delete;
189};
190
191VTK_ABI_NAMESPACE_END
192#endif /* vtkAMRCutPlane_h */
A concrete instance of vtkMultiBlockDataSet that provides functionality for cutting an AMR dataset (a...
bool IsAMRData2D(vtkOverlappingAMR *input)
A utility function that checks if the input AMR data is 2-D.
vtkPlane * GetCutPlane(vtkOverlappingAMR *metadata)
Returns the cut-plane defined by a vtkCutPlane instance based on the user-supplied center and normal.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void ExtractCellFromGrid(vtkUniformGrid *grid, vtkCell *cell, std::map< vtkIdType, vtkIdType > &gridPntMapping, vtkPoints *nodes, vtkCellArray *cells)
Extracts cell.
std::vector< int > BlocksToLoad
void InitializeCenter(double min[3], double max[3])
virtual void SetController(vtkMultiProcessController *)
Set/Get a multiprocess controller for parallel processing.
void ComputeAMRBlocksToLoad(vtkPlane *p, vtkOverlappingAMR *m)
Given a cut-plane, p, and the metadata, m, this method computes which blocks need to be loaded.
static vtkAMRCutPlane * New()
~vtkAMRCutPlane() override
bool PlaneIntersectsAMRBox(double plane[4], double bounds[6])
Determines if a plane intersects with an AMR box.
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Performs upstream requests to the reader.
vtkSmartPointer< vtkUnstructuredGrid > CutAMRBlock(vtkPlane *cutPlane, vtkUniformGrid *grid)
Applies cutting to an AMR block.
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkMultiProcessController * Controller
int RequestInformation(vtkInformation *rqst, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Gets the metadata from upstream module and determines which blocks should be loaded by this instance.
void ExtractPointDataFromGrid(vtkUniformGrid *grid, std::map< vtkIdType, vtkIdType > &gridPntMapping, vtkIdType NumNodes, vtkPointData *PD)
Given the grid and a subset ID pair, grid IDs mapping to the extracted grid IDs, extract the point da...
void PrintSelf(ostream &oss, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
bool PlaneIntersectsAMRBox(vtkPlane *pl, double bounds[6])
Determines if a plane intersects with an AMR box.
bool PlaneIntersectsCell(vtkPlane *pl, vtkCell *cell)
Determines if a plane intersects with a grid cell.
void ExtractCellDataFromGrid(vtkUniformGrid *grid, std::vector< vtkIdType > &cellIdxList, vtkCellData *CD)
Given the grid and the list of cells that are extracted, extract the corresponding cell data.
object to represent cell connectivity
represent and manipulate cell attribute data
abstract class to specify cell behavior
Definition vtkCell.h:129
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
Composite dataset that organizes datasets into blocks.
Multiprocessing communication superclass.
a multi-resolution dataset based on vtkUniformGrid allowing overlaps
perform various plane computations
Definition vtkPlane.h:141
represent and manipulate point attribute data
represent and manipulate 3D points
Definition vtkPoints.h:139
Hold a reference to a vtkObjectBase instance.
image data with blanking
dataset represents arbitrary combinations of all possible cell types
int vtkIdType
Definition vtkType.h:332
#define max(a, b)