VTK  9.0.1
vtkAMRCutPlane.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAMRCutPlane.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14  =========================================================================*/
24 #ifndef vtkAMRCutPlane_h
25 #define vtkAMRCutPlane_h
26 
27 #include "vtkFiltersAMRModule.h" // For export macro
29 
30 #include <map> // For STL map
31 #include <vector> // For STL vector
32 
34 class vtkOverlappingAMR;
36 class vtkInformation;
38 class vtkIndent;
39 class vtkPlane;
40 class vtkUniformGrid;
41 class vtkCell;
42 class vtkPoints;
43 class vtkCellArray;
44 class vtkPointData;
45 class vtkCellData;
46 
47 class VTKFILTERSAMR_EXPORT vtkAMRCutPlane : public vtkMultiBlockDataSetAlgorithm
48 {
49 public:
50  static vtkAMRCutPlane* New();
52  void PrintSelf(ostream& oss, vtkIndent indent) override;
53 
55 
58  vtkSetVector3Macro(Center, double);
60 
62 
65  vtkSetVector3Macro(Normal, double);
67 
69 
72  vtkSetMacro(LevelOfResolution, int);
73  vtkGetMacro(LevelOfResolution, int);
75 
77 
80  vtkSetMacro(UseNativeCutter, bool);
81  vtkGetMacro(UseNativeCutter, bool);
82  vtkBooleanMacro(UseNativeCutter, bool);
84 
86 
90  vtkSetMacro(Controller, vtkMultiProcessController*);
91  vtkGetMacro(Controller, vtkMultiProcessController*);
93 
94  // Standard pipeline routines
95 
99 
104  int RequestInformation(vtkInformation* rqst, vtkInformationVector** inputVector,
105  vtkInformationVector* outputVector) override;
106 
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  void CutAMRBlock(
176  vtkPlane* cutPlane, unsigned int blockIdx, vtkUniformGrid* grid, vtkMultiBlockDataSet* dataSet);
177 
179  double Center[3];
180  double Normal[3];
184 
185  std::vector<int> BlocksToLoad;
186 
187 private:
188  vtkAMRCutPlane(const vtkAMRCutPlane&) = delete;
189  void operator=(const vtkAMRCutPlane&) = delete;
190 };
191 
192 #endif /* vtkAMRCutPlane_h */
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:33
vtkAMRCutPlane::Controller
vtkMultiProcessController * Controller
Definition: vtkAMRCutPlane.h:183
vtkPlane
perform various plane computations
Definition: vtkPlane.h:31
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:31
vtkAMRCutPlane::BlocksToLoad
std::vector< int > BlocksToLoad
Definition: vtkAMRCutPlane.h:185
vtkIdType
int vtkIdType
Definition: vtkType.h:338
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkX3D::Normal
@ Normal
Definition: vtkX3D.h:51
vtkMultiBlockDataSetAlgorithm::FillOutputPortInformation
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
vtkUniformGrid
image data with blanking
Definition: vtkUniformGrid.h:34
vtkMultiBlockDataSetAlgorithm::New
static vtkMultiBlockDataSetAlgorithm * New()
vtkMultiBlockDataSetAlgorithm::RequestUpdateExtent
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
Definition: vtkMultiBlockDataSetAlgorithm.h:99
vtkMultiBlockDataSet
Composite dataset that organizes datasets into blocks.
Definition: vtkMultiBlockDataSet.h:45
max
#define max(a, b)
Definition: vtkX3DExporterFIWriterHelper.h:31
vtkMultiBlockDataSetAlgorithm::RequestData
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
Definition: vtkMultiBlockDataSetAlgorithm.h:89
vtkX3D::port
@ port
Definition: vtkX3D.h:453
vtkMultiProcessController
Multiprocessing communication superclass.
Definition: vtkMultiProcessController.h:75
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:56
vtkCellData
represent and manipulate cell attribute data
Definition: vtkCellData.h:32
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:179
vtkAMRCutPlane::UseNativeCutter
bool UseNativeCutter
Definition: vtkAMRCutPlane.h:182
vtkMultiBlockDataSetAlgorithm.h
vtkOverlappingAMR
hierarchical dataset of vtkUniformGrids
Definition: vtkOverlappingAMR.h:40
vtkMultiBlockDataSetAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:73
vtkX3D::info
@ info
Definition: vtkX3D.h:382
vtkAMRCutPlane
Definition: vtkAMRCutPlane.h:47
vtkAMRCutPlane::LevelOfResolution
int LevelOfResolution
Definition: vtkAMRCutPlane.h:178
vtkMultiBlockDataSetAlgorithm::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkMultiBlockDataSetAlgorithm::RequestInformation
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
Definition: vtkMultiBlockDataSetAlgorithm.h:80
vtkAMRCutPlane::initialRequest
bool initialRequest
Definition: vtkAMRCutPlane.h:181
vtkMultiBlockDataSetAlgorithm
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
Definition: vtkMultiBlockDataSetAlgorithm.h:32