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 =========================================================================*/
31 #ifndef vtkAMRDualContour_h
32 #define vtkAMRDualContour_h
33 
35 #include "vtkPVVTKExtensionsAMRModule.h" //needed for exports
36 #include <string>
37 #include <vector>
38 
39 class vtkDataSet;
40 class vtkImageData;
41 class vtkPolyData;
43 class vtkPoints;
44 class vtkDoubleArray;
45 class vtkCellArray;
46 class vtkCellData;
47 class vtkIntArray;
48 class vtkFloatArray;
51 class vtkCallbackCommand;
52 
56 class vtkAMRDualContourEdgeLocator;
57 
59 {
60 public:
61  static vtkAMRDualContour* New();
63  void PrintSelf(ostream& os, vtkIndent indent) override;
64 
65  vtkSetMacro(IsoValue, double);
66  vtkGetMacro(IsoValue, double);
67 
69 
74  vtkSetMacro(EnableCapping, int);
75  vtkGetMacro(EnableCapping, int);
76  vtkBooleanMacro(EnableCapping, int);
77  vtkSetMacro(EnableDegenerateCells, int);
78  vtkGetMacro(EnableDegenerateCells, int);
79  vtkBooleanMacro(EnableDegenerateCells, int);
80  vtkSetMacro(EnableMultiProcessCommunication, int);
81  vtkGetMacro(EnableMultiProcessCommunication, int);
82  vtkBooleanMacro(EnableMultiProcessCommunication, int);
84 
86 
91  vtkSetMacro(EnableMergePoints, int);
92  vtkGetMacro(EnableMergePoints, int);
93  vtkBooleanMacro(EnableMergePoints, int);
95 
97 
100  vtkSetMacro(TriangulateCap, int);
101  vtkGetMacro(TriangulateCap, int);
102  vtkBooleanMacro(TriangulateCap, int);
104 
106 
112  vtkSetMacro(SkipGhostCopy, int);
113  vtkGetMacro(SkipGhostCopy, int);
114  vtkBooleanMacro(SkipGhostCopy, int);
116 
117  vtkGetObjectMacro(Controller, vtkMultiProcessController);
118  virtual void SetController(vtkMultiProcessController*);
119 
120 protected:
122  ~vtkAMRDualContour() override;
123 
124  double IsoValue;
125 
126  // Algorithm options that may improve performance.
133 
135 
139  void InitializeRequest(vtkNonOverlappingAMR* input);
140 
144  void FinalizeRequest();
145 
150  vtkMultiBlockDataSet* DoRequestData(vtkNonOverlappingAMR* input, const char* arrayNameToProcess);
151 
152  int FillInputPortInformation(int port, vtkInformation* info) override;
153  int FillOutputPortInformation(int port, vtkInformation* info) override;
154 
155  void ShareBlockLocatorWithNeighbors(vtkAMRDualGridHelperBlock* block);
156 
157  void ProcessBlock(vtkAMRDualGridHelperBlock* block, int blockId, const char* arrayName);
158 
159  void ProcessDualCell(vtkAMRDualGridHelperBlock* block, int blockId, int x, int y, int z,
160  vtkIdType cornerOffsets[8], vtkDataArray* volumeFractionArray);
161 
162  void AddCapPolygon(int ptCount, vtkIdType* pointIds, int blockId);
163 
164  // This method is getting too many arguments!
165  // Capping was an after thought...
166  void CapCell(int cellX, int cellY, int cellZ, // block coordinates
167  // Which cell faces need to be capped.
168  unsigned char cubeBoundaryBits,
169  // Marching cubes case for this cell
170  int cubeCase,
171  // Ids of the point created on edges for the internal surface
172  vtkIdType edgePtIds[12],
173  // Locations of 8 corners. (xyz4xyz4...) 4th value is not used.
174  double cornerPoints[32],
175  // The id order is VTK from marching cube cases. Different than axis ordered "cornerPoints".
176  vtkIdType cornerOffsets[8],
177  // For block id array (for debugging). I should just make this an ivar.
178  int blockId,
179  // For passing attributes to output mesh
180  vtkDataSet* inData);
181 
182  // Stuff exclusively for debugging.
185 
186  // Ivars used to reduce method parrameters.
191 
193 
194  // I made these ivars to avoid allocating multiple times.
195  // The buffer is not used too many times, but ...
198 
199  vtkAMRDualContourEdgeLocator* BlockLocator;
200 
201  // Stuff for passing cell attributes to point attributes.
202  void InitializeCopyAttributes(vtkNonOverlappingAMR* hbdsInput, vtkDataSet* mesh);
203  void InterpolateAttributes(vtkDataSet* uGrid, vtkIdType offset0, vtkIdType offset1, double k,
204  vtkDataSet* mesh, vtkIdType outId);
205  void CopyAttributes(vtkDataSet* uGrid, vtkIdType inId, vtkDataSet* mesh, vtkIdType outId);
206  void FinalizeCopyAttributes(vtkDataSet* mesh);
207 
208 private:
209  vtkAMRDualContour(const vtkAMRDualContour&) = delete;
210  void operator=(const vtkAMRDualContour&) = delete;
211 };
212 
213 #endif
214 
215 // VTK-HeaderTest-Exclude: vtkAMRDualContour.h
vtkMultiProcessController * Controller
int vtkIdType
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkAMRDualGridHelper * Helper
Extract particles and analyse them.
static vtkMultiBlockDataSetAlgorithm * New()
vtkCellArray * Faces
virtual int FillOutputPortInformation(int port, vtkInformation *info)
vtkFloatArray * TemperatureArray
vtkAMRDualContourEdgeLocator * BlockLocator
#define VTKPVVTKEXTENSIONSAMR_EXPORT
Tools for processing AMR as a dual grid.
virtual int FillInputPortInformation(int port, vtkInformation *info)
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
vtkIntArray * BlockIdCellArray
void operator=(const vtkObjectBase &)