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 );
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 
91  vtkGetMacro(Controller, vtkMultiProcessController*);
93 
94  // Standard pipeline routines
95 
96  virtual int RequestData(
100 
101 
106  virtual int RequestInformation(
107  vtkInformation *rqst,
108  vtkInformationVector **inputVector,
109  vtkInformationVector *outputVector );
110 
114  virtual int RequestUpdateExtent(
116 
117 protected:
118  vtkAMRCutPlane();
119  virtual ~vtkAMRCutPlane();
120 
125  vtkPlane* GetCutPlane( vtkOverlappingAMR *metadata );
126 
130  void ExtractCellFromGrid(
131  vtkUniformGrid *grid, vtkCell* cell,
132  std::map<vtkIdType,vtkIdType>& gridPntMapping,
133  vtkPoints *nodes,
134  vtkCellArray *cells );
135 
140  void ExtractPointDataFromGrid(
141  vtkUniformGrid *grid,
142  std::map<vtkIdType,vtkIdType>& gridPntMapping,
143  vtkIdType NumNodes,
144  vtkPointData *PD );
145 
150  void ExtractCellDataFromGrid(
151  vtkUniformGrid *grid,
152  std::vector<vtkIdType>& cellIdxList,
153  vtkCellData *CD);
154 
161  void ComputeAMRBlocksToLoad( vtkPlane* p, vtkOverlappingAMR* m);
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 
178  bool PlaneIntersectsCell( vtkPlane *pl, vtkCell *cell );
179 
183  bool IsAMRData2D( vtkOverlappingAMR *input );
184 
188  void CutAMRBlock(
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& ) VTK_DELETE_FUNCTION;
204  void operator=(const vtkAMRCutPlane& ) VTK_DELETE_FUNCTION;
205 };
206 
207 #endif /* vtkAMRCutPlane_h */
vtkMultiProcessController * Controller
represent and manipulate point attribute data
Definition: vtkPointData.h:37
Store vtkAlgorithm input/output information.
represent and manipulate cell attribute data
Definition: vtkCellData.h:38
A concrete instance of vtkMultiBlockDataSet that provides functionality for cutting an AMR dataset (a...
int vtkIdType
Definition: vtkType.h:287
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:59
a simple class to control print indentation
Definition: vtkIndent.h:39
perform various plane computations
Definition: vtkPlane.h:37
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.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
image data with blanking
object to represent cell connectivity
Definition: vtkCellArray.h:50
Composite dataset that organizes datasets into blocks.
hierarchical dataset of vtkUniformGrids
Store zero or more vtkInformation instances.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
#define max(a, b)
represent and manipulate 3D points
Definition: vtkPoints.h:39
std::vector< int > BlocksToLoad
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
Multiprocessing communication superclass.