VTK
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 <vector> // For STL vector
31 #include <map> // For STL map
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 
100 
101 
107  vtkInformation *rqst,
108  vtkInformationVector **inputVector,
109  vtkInformationVector *outputVector ) override;
110 
116 
117 protected:
119  ~vtkAMRCutPlane() override;
120 
126 
131  vtkUniformGrid *grid, vtkCell* cell,
132  std::map<vtkIdType,vtkIdType>& gridPntMapping,
133  vtkPoints *nodes,
134  vtkCellArray *cells );
135 
141  vtkUniformGrid *grid,
142  std::map<vtkIdType,vtkIdType>& gridPntMapping,
143  vtkIdType NumNodes,
144  vtkPointData *PD );
145 
151  vtkUniformGrid *grid,
152  std::vector<vtkIdType>& cellIdxList,
153  vtkCellData *CD);
154 
162 
163  // Descriription:
164  // Initializes the cut-plane center given the min/max bounds.
165  void InitializeCenter( double min[3], double max[3] );
166 
168 
171  bool PlaneIntersectsAMRBox( vtkPlane* pl, double bounds[6] );
172  bool PlaneIntersectsAMRBox( double plane[4], double bounds[6] );
174 
179 
184 
189  vtkPlane *cutPlane,
190  unsigned int blockIdx,
191  vtkUniformGrid *grid, vtkMultiBlockDataSet *dataSet );
192 
194  double Center[3];
195  double Normal[3];
199 
200  std::vector<int> BlocksToLoad;
201 
202 private:
203  vtkAMRCutPlane(const vtkAMRCutPlane& ) = delete;
204  void operator=(const vtkAMRCutPlane& ) = delete;
205 };
206 
207 #endif /* vtkAMRCutPlane_h */
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:40
vtkAMRCutPlane::Controller
vtkMultiProcessController * Controller
Definition: vtkAMRCutPlane.h:198
vtkAMRCutPlane::PlaneIntersectsCell
bool PlaneIntersectsCell(vtkPlane *pl, vtkCell *cell)
Determines if a plane intersects with a grid cell.
vtkPlane
perform various plane computations
Definition: vtkPlane.h:38
vtkAMRCutPlane::ExtractCellFromGrid
void ExtractCellFromGrid(vtkUniformGrid *grid, vtkCell *cell, std::map< vtkIdType, vtkIdType > &gridPntMapping, vtkPoints *nodes, vtkCellArray *cells)
Extracts cell.
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:38
vtkAMRCutPlane::BlocksToLoad
std::vector< int > BlocksToLoad
Definition: vtkAMRCutPlane.h:200
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:42
vtkX3D::Normal
@ Normal
Definition: vtkX3D.h:45
vtkUniformGrid
image data with blanking
Definition: vtkUniformGrid.h:41
vtkAMRCutPlane::New
static vtkAMRCutPlane * New()
vtkMultiBlockDataSet
Composite dataset that organizes datasets into blocks.
Definition: vtkMultiBlockDataSet.h:52
vtkAMRCutPlane::vtkAMRCutPlane
vtkAMRCutPlane()
max
#define max(a, b)
Definition: vtkX3DExporterFIWriterHelper.h:31
vtkAMRCutPlane::CutAMRBlock
void CutAMRBlock(vtkPlane *cutPlane, unsigned int blockIdx, vtkUniformGrid *grid, vtkMultiBlockDataSet *dataSet)
Applies cutting to an AMR block.
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkAMRCutPlane::PlaneIntersectsAMRBox
bool PlaneIntersectsAMRBox(vtkPlane *pl, double bounds[6])
Determines if a plane intersects with an AMR box.
vtkAMRCutPlane::PlaneIntersectsAMRBox
bool PlaneIntersectsAMRBox(double plane[4], double bounds[6])
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.
vtkMultiProcessController
Multiprocessing communication superclass.
Definition: vtkMultiProcessController.h:83
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:60
vtkCellData
represent and manipulate cell attribute data
Definition: vtkCellData.h:39
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:51
vtkAMRCutPlane::UseNativeCutter
bool UseNativeCutter
Definition: vtkAMRCutPlane.h:197
vtkAMRCutPlane::IsAMRData2D
bool IsAMRData2D(vtkOverlappingAMR *input)
A utility function that checks if the input AMR data is 2-D.
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...
vtkMultiBlockDataSetAlgorithm.h
vtkAMRCutPlane::GetCutPlane
vtkPlane * GetCutPlane(vtkOverlappingAMR *metadata)
Returns the cut-plane defined by a vtkCutPlane instance based on the user-supplied center and normal.
vtkOverlappingAMR
hierarchical dataset of vtkUniformGrids
Definition: vtkOverlappingAMR.h:47
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkAMRCutPlane
Definition: vtkAMRCutPlane.h:48
vtkAMRCutPlane::LevelOfResolution
int LevelOfResolution
Definition: vtkAMRCutPlane.h:193
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::~vtkAMRCutPlane
~vtkAMRCutPlane() override
vtkAMRCutPlane::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkAMRCutPlane::RequestUpdateExtent
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Performs upstream requests to the reader.
vtkAMRCutPlane::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkAMRCutPlane::PrintSelf
void PrintSelf(ostream &oss, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAMRCutPlane::InitializeCenter
void InitializeCenter(double min[3], double max[3])
vtkAMRCutPlane::initialRequest
bool initialRequest
Definition: vtkAMRCutPlane.h:196
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::FillOutputPortInformation
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
vtkMultiBlockDataSetAlgorithm
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
Definition: vtkMultiBlockDataSetAlgorithm.h:36