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  =========================================================================*/
23 #ifndef VTKAMRCUTPLANE_H_
24 #define VTKAMRCUTPLANE_H_
25 
26 #include "vtkFiltersAMRModule.h" // For export macro
28 
29 #include <vector> // For STL vector
30 #include <map> // For STL map
31 
33 class vtkOverlappingAMR;
35 class vtkInformation;
37 class vtkIndent;
38 class vtkPlane;
39 class vtkUniformGrid;
40 class vtkCell;
41 class vtkPoints;
42 class vtkCellArray;
43 class vtkPointData;
44 class vtkCellData;
45 
47 {
48 public:
49  static vtkAMRCutPlane *New();
51  void PrintSelf(ostream &oss, vtkIndent indent );
52 
54 
55  vtkSetVector3Macro(Center, double);
57 
59 
60  vtkSetVector3Macro(Normal, double);
62 
64 
65  vtkSetMacro(LevelOfResolution, int);
66  vtkGetMacro(LevelOfResolution, int);
68 
70  */
71  vtkSetMacro(UseNativeCutter, bool);
72  vtkGetMacro(UseNativeCutter, bool);
73  vtkBooleanMacro(UseNativeCutter, bool);
75 
77 
79  vtkSetMacro(Controller, vtkMultiProcessController*);
80  vtkGetMacro(Controller, vtkMultiProcessController*);
82 
83  // Standard pipeline routines
84 
85  virtual int RequestData(
89 
90 
92 
94  virtual int RequestInformation(
95  vtkInformation *rqst,
96  vtkInformationVector **inputVector,
97  vtkInformationVector *outputVector );
99 
101 
102  virtual int RequestUpdateExtent(
105 
106 protected:
107  vtkAMRCutPlane();
108  virtual ~vtkAMRCutPlane();
109 
112  vtkPlane* GetCutPlane( vtkOverlappingAMR *metadata );
113 
115 
116  void ExtractCellFromGrid(
117  vtkUniformGrid *grid, vtkCell* cell,
118  std::map<vtkIdType,vtkIdType>& gridPntMapping,
119  vtkPoints *nodes,
120  vtkCellArray *cells );
122 
124 
126  void ExtractPointDataFromGrid(
127  vtkUniformGrid *grid,
128  std::map<vtkIdType,vtkIdType>& gridPntMapping,
129  vtkIdType NumNodes,
130  vtkPointData *PD );
132 
134 
136  void ExtractCellDataFromGrid(
137  vtkUniformGrid *grid,
138  std::vector<vtkIdType>& cellIdxList,
139  vtkCellData *CD);
141 
146  void ComputeAMRBlocksToLoad( vtkPlane* p, vtkOverlappingAMR* m);
147 
148  // Descriription:
149  // Initializes the cut-plane center given the min/max bounds.
150  void InitializeCenter( double min[3], double max[3] );
151 
153 
154  bool PlaneIntersectsAMRBox( vtkPlane* pl, double bounds[6] );
155  bool PlaneIntersectsAMRBox( double plane[4], double bounds[6] );
157 
159  bool PlaneIntersectsCell( vtkPlane *pl, vtkCell *cell );
160 
162  bool IsAMRData2D( vtkOverlappingAMR *input );
163 
165 
166  void CutAMRBlock(
167  vtkPlane *cutPlane,
168  unsigned int blockIdx,
169  vtkUniformGrid *grid, vtkMultiBlockDataSet *dataSet );
171 
173  double Center[3];
174  double Normal[3];
178 
179 // BTX
180  std::vector<int> BlocksToLoad;
181 // ETX
182 
183 private:
184  vtkAMRCutPlane(const vtkAMRCutPlane& ); // Not implemented
185  void operator=(const vtkAMRCutPlane& ); // Not implemented
186 };
187 
188 #endif /* VTKAMRCUTPLANE_H_ */
vtkMultiProcessController * Controller
represent and manipulate point attribute data
Definition: vtkPointData.h:36
Store vtkAlgorithm input/output information.
represent and manipulate cell attribute data
Definition: vtkCellData.h:37
#define VTKFILTERSAMR_EXPORT
int vtkIdType
Definition: vtkType.h:275
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
static vtkMultiBlockDataSetAlgorithm * New()
virtual int FillOutputPortInformation(int port, vtkInformation *info)
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
abstract class to specify cell behavior
Definition: vtkCell.h:61
a simple class to control print indentation
Definition: vtkIndent.h:38
perform various plane computations
Definition: vtkPlane.h:36
image data with blanking
object to represent cell connectivity
Definition: vtkCellArray.h:49
Composite dataset that organizes datasets into blocks.
virtual int FillInputPortInformation(int port, vtkInformation *info)
hierarchical dataset of vtkUniformGrids
void PrintSelf(ostream &os, vtkIndent indent)
Store zero or more vtkInformation instances.
#define max(a, b)
represent and manipulate 3D points
Definition: vtkPoints.h:38
std::vector< int > BlocksToLoad
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Multiprocessing communication superclass.