ParaView
vtkAMRDualContour.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAMRDualContour.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 =========================================================================*/
29 #ifndef vtkAMRDualContour_h
30 #define vtkAMRDualContour_h
31 
32 #include "vtkMultiBlockDataSetAlgorithm.h"
33 #include "vtkPVVTKExtensionsDefaultModule.h" //needed for exports
34 #include <string>
35 #include <vector>
36 
37 class vtkDataSet;
38 class vtkImageData;
39 class vtkPolyData;
40 class vtkNonOverlappingAMR;
41 class vtkPoints;
42 class vtkDoubleArray;
43 class vtkCellArray;
44 class vtkCellData;
45 class vtkIntArray;
46 class vtkFloatArray;
47 class vtkMultiProcessController;
48 class vtkDataArraySelection;
49 class vtkCallbackCommand;
50 
54 class vtkAMRDualContourEdgeLocator;
55 
56 class VTKPVVTKEXTENSIONSDEFAULT_EXPORT vtkAMRDualContour : public vtkMultiBlockDataSetAlgorithm
57 {
58 public:
59  static vtkAMRDualContour* New();
60  vtkTypeMacro(vtkAMRDualContour, vtkMultiBlockDataSetAlgorithm);
61  void PrintSelf(ostream& os, vtkIndent indent);
62 
63  vtkSetMacro(IsoValue, double);
64  vtkGetMacro(IsoValue, double);
65 
67 
72  vtkSetMacro(EnableCapping, int);
73  vtkGetMacro(EnableCapping, int);
74  vtkBooleanMacro(EnableCapping, int);
75  vtkSetMacro(EnableDegenerateCells, int);
76  vtkGetMacro(EnableDegenerateCells, int);
77  vtkBooleanMacro(EnableDegenerateCells, int);
78  vtkSetMacro(EnableMultiProcessCommunication, int);
79  vtkGetMacro(EnableMultiProcessCommunication, int);
80  vtkBooleanMacro(EnableMultiProcessCommunication, int);
82 
84 
89  vtkSetMacro(EnableMergePoints, int);
90  vtkGetMacro(EnableMergePoints, int);
91  vtkBooleanMacro(EnableMergePoints, int);
93 
95 
98  vtkSetMacro(TriangulateCap, int);
99  vtkGetMacro(TriangulateCap, int);
100  vtkBooleanMacro(TriangulateCap, int);
102 
104 
110  vtkSetMacro(SkipGhostCopy, int);
111  vtkGetMacro(SkipGhostCopy, int);
112  vtkBooleanMacro(SkipGhostCopy, int);
114 
115  vtkGetObjectMacro(Controller, vtkMultiProcessController);
116  virtual void SetController(vtkMultiProcessController*);
117 
118 protected:
120  virtual ~vtkAMRDualContour();
121 
122  double IsoValue;
123 
124  // Algorithm options that may improve performance.
131 
132  virtual int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
133 
137  void InitializeRequest(vtkNonOverlappingAMR* input);
138 
142  void FinalizeRequest();
143 
148  vtkMultiBlockDataSet* DoRequestData(vtkNonOverlappingAMR* input, const char* arrayNameToProcess);
149 
150  virtual int FillInputPortInformation(int port, vtkInformation* info);
151  virtual int FillOutputPortInformation(int port, vtkInformation* info);
152 
153  void ShareBlockLocatorWithNeighbors(vtkAMRDualGridHelperBlock* block);
154 
155  void ProcessBlock(vtkAMRDualGridHelperBlock* block, int blockId, const char* arrayName);
156 
157  void ProcessDualCell(vtkAMRDualGridHelperBlock* block, int blockId, int x, int y, int z,
158  vtkIdType cornerOffsets[8], vtkDataArray* volumeFractionArray);
159 
160  void AddCapPolygon(int ptCount, vtkIdType* pointIds, int blockId);
161 
162  // This method is getting too many arguements!
163  // Capping was an after thought...
164  void CapCell(int cellX, int cellY, int cellZ, // block coordinates
165  // Which cell faces need to be capped.
166  unsigned char cubeBoundaryBits,
167  // Marching cubes case for this cell
168  int cubeCase,
169  // Ids of the point created on edges for the internal surface
170  vtkIdType edgePtIds[12],
171  // Locations of 8 corners. (xyz4xyz4...) 4th value is not used.
172  double cornerPoints[32],
173  // The id order is VTK from marching cube cases. Different than axis orded "cornerPoints".
174  vtkIdType cornerOffsets[8],
175  // For block id array (for debugging). I should just make this an ivar.
176  int blockId,
177  // For passing attirbutes to output mesh
178  vtkDataSet* inData);
179 
180  // Stuff exclusively for debugging.
181  vtkIntArray* BlockIdCellArray;
182  vtkFloatArray* TemperatureArray;
183 
184  // Ivars used to reduce method parrameters.
186  vtkPolyData* Mesh;
187  vtkPoints* Points;
188  vtkCellArray* Faces;
189 
190  vtkMultiProcessController* Controller;
191 
192  // I made these ivars to avoid allocating multiple times.
193  // The buffer is not used too many times, but ...
196 
197  vtkAMRDualContourEdgeLocator* BlockLocator;
198 
199  // Stuff for passing cell attributes to point attributes.
200  void InitializeCopyAttributes(vtkNonOverlappingAMR* hbdsInput, vtkDataSet* mesh);
201  void InterpolateAttributes(vtkDataSet* uGrid, vtkIdType offset0, vtkIdType offset1, double k,
202  vtkDataSet* mesh, vtkIdType outId);
203  void CopyAttributes(vtkDataSet* uGrid, vtkIdType inId, vtkDataSet* mesh, vtkIdType outId);
204  void FinalizeCopyAttributes(vtkDataSet* mesh);
205 
206 private:
207  vtkAMRDualContour(const vtkAMRDualContour&) VTK_DELETE_FUNCTION;
208  void operator=(const vtkAMRDualContour&) VTK_DELETE_FUNCTION;
209 };
210 
211 #endif
212 
213 // VTK-HeaderTest-Exclude: vtkAMRDualContour.h
vtkMultiProcessController * Controller
vtkAMRDualGridHelper * Helper
Extract particles and analyse them.
vtkCellArray * Faces
vtkFloatArray * TemperatureArray
vtkAMRDualContourEdgeLocator * BlockLocator
Tools for processing AMR as a dual grid.
vtkIntArray * BlockIdCellArray