vtkRectilinearGridConnectivity.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkRectilinearGridConnectivity.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 =========================================================================*/
76 #ifndef vtkRectilinearGridConnectivity_h
77 #define vtkRectilinearGridConnectivity_h
78 
80 #include "vtkPVVTKExtensionsFiltersGeneralModule.h" //needed for exports
81 
82 class vtkPolyData;
83 class vtkDoubleArray;
84 class vtkInformation;
85 class vtkEquivalenceSet;
86 class vtkRectilinearGrid;
90 class vtkRectilinearGridConnectivityFaceHash;
91 class vtkRectilinearGridConnectivityInternal;
92 
95 {
96 public:
99  void PrintSelf(ostream& os, vtkIndent indent) override;
100 
102 
105  vtkSetClampMacro(VolumeFractionSurfaceValue, double, 0.0, 1.0);
106  vtkGetMacro(VolumeFractionSurfaceValue, double);
108 
112  void RemoveAllVolumeArrayNames();
113 
117  void RemoveDoubleVolumeArrayNames();
118 
122  void RemoveFloatVolumeArrayNames();
123 
127  void RemoveUnsignedCharVolumeArrayNames();
128 
132  void AddDoubleVolumeArrayName(char* arayName);
133 
137  void AddFloatVolumeArrayName(char* arayName);
138 
142  void AddUnsignedCharVolumeArrayName(char* arayName);
143 
147  void AddVolumeArrayName(char* arayName);
148 
149 protected:
151  ~vtkRectilinearGridConnectivity() override;
152 
156  double DualGridBounds[6];
162  vtkRectilinearGridConnectivityFaceHash* FaceHash;
163  vtkRectilinearGridConnectivityInternal* Internal;
164 
166  int FillInputPortInformation(int, vtkInformation*) override;
167  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
168  vtkInformationVector* outputVector) override;
169 
170  // ---------------------------------------------------------------------- //
171  // --------------------------- Volume arrays --------------------------- //
172  // ---------------------------------------------------------------------- //
173 
177  int GetNumberOfVolumeFractionArrays();
178 
183  int GetNumberOfVolumeArrays();
184 
188  const char* GetVolumeFractionArrayName(int arrayIdx);
189 
194  bool IsVolumeFractionArray(const char* arayName);
195 
201  bool IsVolumeArray(const char* arayName);
202 
211  int CheckVolumeDataArrays(vtkRectilinearGrid** recGrids, int numGrids);
212 
213  // ---------------------------------------------------------------------- //
214  // ----------- Dual grids generation and fragments extraction ----------- //
215  // ---------------------------------------------------------------------- //
216 
222  void CreateDualRectilinearGrid(vtkRectilinearGrid* rectGrid, vtkRectilinearGrid* dualGrid);
223 
232  void ExtractFragments(vtkRectilinearGrid** dualGrds, int numBlcks, double boundBox[6],
233  unsigned char partIndx, vtkPolyData* polyData);
234 
235  // ---------------------------------------------------------------------- //
236  // ------------- Common functions for fragments extraction ------------- //
237  // ---------------------------------------------------------------------- //
238 
251  void IntegrateFragmentAttributes(int fragIndx, int numComps, double* attrVals);
252 
258  void ResolveEquivalentFragments();
259 
269  void ResolveFaceFragmentIds();
270 
279  void ResolveIntegratedFragmentAttributes();
280 
281  // ---------------------------------------------------------------------- //
282  // ----------- Intra-process intra-block fragments extraction ----------- //
283  // ---------------------------------------------------------------------- //
284 
285  // Descrption:
286  // Give a vtkRectilinearGrid data block (rectGrid, the dual version of an
287  // original input block) with point data attributes (including some volume
288  // fraction arrays and others like pressure, density, or velocity vector),
289  // the name of a selected volume fraction array (fracName, through which to
290  // extract fragments), and a specified volume fraction iso-value (isoValue),
291  // this function performs the marching-cubes algorithm based on the volume
292  // fraction array and the iso-value to produce greater-than-isovalue sub-
293  // volumes (or polyhedra) by employing an extended 256-entry lookup table.
294  // These resulting polyhedra are stored in the output vtkPolyData (plyHedra).
295  // All point data attributes except for non-selected volume fraction arrays
296  // are integrated when marching cubes. The integrated attribute arrays are
297  // attached to the polyhedra's faces as the cell data.
298  void ExtractFragmentPolyhedra(
299  vtkRectilinearGrid* rectGrid, const char* fracName, double isoValue, vtkPolyData* plyHedra);
300 
307  void InitializeFaceHash(vtkPolyData* plyHedra);
308 
319  void AddPolygonsToFaceHash(int blockIdx, vtkPolyData* plyHedra);
320 
343  void ExtractFragmentPolygons(int blockIdx, int& maxFsize, vtkPolyData* plyHedra,
344  vtkPolyData* polygons, vtkIncrementalOctreePointLocator* gPtIdGen);
345 
346  // ---------------------------------------------------------------------- //
347  // ----------- Intra-process inter-block fragments extraction ----------- //
348  // ---------------------------------------------------------------------- //
349 
357  void InitializeFaceHash(vtkPolyData** plyDatas, int numPolys);
358 
373  void AddPolygonsToFaceHash(vtkPolyData** plyDatas, int* maxFsize, int numPolys);
374 
388  void GenerateOutputFromSingleProcess(
389  vtkPolyData** surfaces, int numSurfs, unsigned char partIndx, vtkPolyData* polyData);
390 
391  // ---------------------------------------------------------------------- //
392  // ----------------- Inter-process fragments extraction ----------------- //
393  // ---------------------------------------------------------------------- //
394 
407  void CreateInterProcessPolygons(vtkPolyData* fragPoly, vtkPolyData* procPoly,
408  vtkIncrementalOctreePointLocator* gPtIdGen, int& maxFsize);
409 
426  void AddInterProcessPolygonsToFaceHash(vtkPolyData** procPlys, int* maxFsize, int numProcs);
427 
442  void GenerateOutputFromMultiProcesses(
443  vtkPolyData** procPlys, int numProcs, unsigned char partIndx, vtkPolyData* polyData);
444 
445 private:
447  void operator=(const vtkRectilinearGridConnectivity&) = delete;
448 };
449 
450 #endif
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
static vtkMultiBlockDataSetAlgorithm * New()
vtkRectilinearGridConnectivityInternal * Internal
#define VTKPVVTKEXTENSIONSFILTERSGENERAL_EXPORT
virtual int FillInputPortInformation(int port, vtkInformation *info)
Extracts material fragments from multi-block vtkRectilinearGrid datasets based on the selected volume...
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
vtkRectilinearGridConnectivityFaceHash * FaceHash
void operator=(const vtkObjectBase &)
records groups of integers that are equivalent.
virtual vtkExecutive * CreateDefaultExecutive()