VTK: Filters/AMR/vtkAMRCutPlane.h Source File

| VTK 9.3.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
19 #include "vtkMultiBlockDataSetAlgorithm.h"
20
21 #include <map> // For STL map
22 #include <vector> // For STL vector
23
24 VTK_ABI_NAMESPACE_BEGIN
25 class vtkMultiBlockDataSet;
26 class vtkOverlappingAMR;
27 class vtkMultiProcessController;
28 class vtkInformation;
29 class vtkInformationVector;
30 class vtkIndent;
31 class vtkPlane;
32 class vtkUniformGrid;
33 class vtkCell;
34 class vtkPoints;
35 class vtkCellArray;
36 class vtkPointData;
37 class vtkCellData;
38
39 class VTKFILTERSAMR_EXPORT vtkAMRCutPlane : public vtkMultiBlockDataSetAlgorithm
40 {
41 public:
42 static vtkAMRCutPlane* New();
43 vtkTypeMacro(vtkAMRCutPlane, vtkMultiBlockDataSetAlgorithm);
44 void PrintSelf(ostream& oss, vtkIndent indent) override;
45
47
50 vtkSetVector3Macro(Center, double);
52
54
57 vtkSetVector3Macro(Normal, double);
59
61
64 vtkSetMacro(LevelOfResolution, int);
65 vtkGetMacro(LevelOfResolution, int);
67
69
74 vtkSetMacro(UseNativeCutter, bool);
75 vtkGetMacro(UseNativeCutter, bool);
76 vtkBooleanMacro(UseNativeCutter, bool);
78
80
84 virtual void SetController(vtkMultiProcessController*);
85 vtkGetObjectMacro(Controller, vtkMultiProcessController);
87
88 // Standard pipeline routines
89
90 int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
91 int FillInputPortInformation(int port, vtkInformation* info) override;
92 int FillOutputPortInformation(int port, vtkInformation* info) override;
93
98 int RequestInformation(vtkInformation* rqst, vtkInformationVector** inputVector,
99 vtkInformationVector* outputVector) override;
100
104 int RequestUpdateExtent(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
105
109 vtkSetMacro(InitialRequest, bool);
110
111 protected:
112 vtkAMRCutPlane();
113 ~vtkAMRCutPlane() override;
114
119 vtkPlane* GetCutPlane(vtkOverlappingAMR* metadata);
120
124 void ExtractCellFromGrid(vtkUniformGrid* grid, vtkCell* cell,
125 std::map<vtkIdType, vtkIdType>& gridPntMapping, vtkPoints* nodes, vtkCellArray* cells);
126
131 void ExtractPointDataFromGrid(vtkUniformGrid* grid,
132 std::map<vtkIdType, vtkIdType>& gridPntMapping, vtkIdType NumNodes, vtkPointData* PD);
133
138 void ExtractCellDataFromGrid(
139 vtkUniformGrid* grid, std::vector<vtkIdType>& cellIdxList, vtkCellData* CD);
140
147 void ComputeAMRBlocksToLoad(vtkPlane* p, vtkOverlappingAMR* m);
148
149 // Descriription:
150 // Initializes the cut-plane center given the min/max bounds.
151 void InitializeCenter(double min[3], double max[3]);
152
154
157 bool PlaneIntersectsAMRBox(vtkPlane* pl, double bounds[6]);
158 bool PlaneIntersectsAMRBox(double plane[4], double bounds[6]);
160
164 bool PlaneIntersectsCell(vtkPlane* pl, vtkCell* cell);
165
169 bool IsAMRData2D(vtkOverlappingAMR* input);
170
174 void CutAMRBlock(
175 vtkPlane* cutPlane, unsigned int blockIdx, vtkUniformGrid* grid, vtkMultiBlockDataSet* dataSet);
176
177 int LevelOfResolution;
178 double Center[3];
179 double Normal[3];
180 bool InitialRequest;
181 bool UseNativeCutter;
182 vtkMultiProcessController* Controller;
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 */
vtkAMRCutPlane
A concrete instance of vtkMultiBlockDataSet that provides functionality for cutting an AMR dataset (a...
Definition: vtkAMRCutPlane.h:40
vtkAMRCutPlane::LevelOfResolution
int LevelOfResolution
Definition: vtkAMRCutPlane.h:177
vtkAMRCutPlane::UseNativeCutter
bool UseNativeCutter
Definition: vtkAMRCutPlane.h:181
vtkAMRCutPlane::IsAMRData2D
bool IsAMRData2D(vtkOverlappingAMR *input)
A utility function that checks if the input AMR data is 2-D.
vtkAMRCutPlane::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkAMRCutPlane::ExtractCellFromGrid
void ExtractCellFromGrid(vtkUniformGrid *grid, vtkCell *cell, std::map< vtkIdType, vtkIdType > &gridPntMapping, vtkPoints *nodes, vtkCellArray *cells)
Extracts cell.
vtkAMRCutPlane::GetCutPlane
vtkPlane * GetCutPlane(vtkOverlappingAMR *metadata)
Returns the cut-plane defined by a vtkCutPlane instance based on the user-supplied center and normal.
vtkAMRCutPlane::BlocksToLoad
std::vector< int > BlocksToLoad
Definition: vtkAMRCutPlane.h:184
vtkAMRCutPlane::InitializeCenter
void InitializeCenter(double min[3], double max[3])
vtkAMRCutPlane::SetController
virtual void SetController(vtkMultiProcessController *)
Set/Get a multiprocess controller for parallel processing.
vtkAMRCutPlane::ComputeAMRBlocksToLoad
void ComputeAMRBlocksToLoad(vtkPlane *p, vtkOverlappingAMR *m)
Given a cut-plane, p, and the metadata, m, this method computes which blocks need to be loaded.
vtkAMRCutPlane::vtkAMRCutPlane
vtkAMRCutPlane()
vtkAMRCutPlane::~vtkAMRCutPlane
~vtkAMRCutPlane() override
vtkAMRCutPlane::PlaneIntersectsAMRBox
bool PlaneIntersectsAMRBox(double plane[4], double bounds[6])
Determines if a plane intersects with an AMR box.
vtkAMRCutPlane::RequestUpdateExtent
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Performs upstream requests to the reader.
vtkAMRCutPlane::CutAMRBlock
void CutAMRBlock(vtkPlane *cutPlane, unsigned int blockIdx, vtkUniformGrid *grid, vtkMultiBlockDataSet *dataSet)
Applies cutting to an AMR block.
vtkAMRCutPlane::InitialRequest
bool InitialRequest
Definition: vtkAMRCutPlane.h:180
vtkAMRCutPlane::FillOutputPortInformation
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
vtkAMRCutPlane::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkAMRCutPlane::New
static vtkAMRCutPlane * New()
vtkAMRCutPlane::Controller
vtkMultiProcessController * Controller
Definition: vtkAMRCutPlane.h:182
vtkAMRCutPlane::RequestInformation
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.
vtkAMRCutPlane::ExtractPointDataFromGrid
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...
vtkAMRCutPlane::PrintSelf
void PrintSelf(ostream &oss, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAMRCutPlane::PlaneIntersectsAMRBox
bool PlaneIntersectsAMRBox(vtkPlane *pl, double bounds[6])
Determines if a plane intersects with an AMR box.
vtkAMRCutPlane::PlaneIntersectsCell
bool PlaneIntersectsCell(vtkPlane *pl, vtkCell *cell)
Determines if a plane intersects with a grid cell.
vtkAMRCutPlane::ExtractCellDataFromGrid
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.
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:185
vtkCellData
represent and manipulate cell attribute data
Definition: vtkCellData.h:40
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:59
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkMultiBlockDataSetAlgorithm
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
Definition: vtkMultiBlockDataSetAlgorithm.h:25
vtkMultiBlockDataSet
Composite dataset that organizes datasets into blocks.
Definition: vtkMultiBlockDataSet.h:50
vtkMultiProcessController
Multiprocessing communication superclass.
Definition: vtkMultiProcessController.h:72
vtkOverlappingAMR
hierarchical dataset of vtkUniformGrids
Definition: vtkOverlappingAMR.h:45
vtkPlane
perform various plane computations
Definition: vtkPlane.h:35
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:39
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:38
vtkUniformGrid
image data with blanking
Definition: vtkUniformGrid.h:39
vtkX3D::Normal
@ Normal
Definition: vtkX3D.h:45
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkMultiBlockDataSetAlgorithm.h
vtkIdType
int vtkIdType
Definition: vtkType.h:315
max
#define max(a, b)
Definition: vtkX3DExporterFIWriterHelper.h:19