ParaView
vtkAMRDualClip.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAMRDualClip.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 =========================================================================*/
26 #ifndef vtkAMRDualClip_h
27 #define vtkAMRDualClip_h
28 
29 #include "vtkMultiBlockDataSetAlgorithm.h"
30 #include "vtkPVVTKExtensionsDefaultModule.h" //needed for exports
31 
32 class vtkDataSet;
33 class vtkImageData;
34 class vtkUnstructuredGrid;
35 class vtkNonOverlappingAMR;
36 class vtkPoints;
37 class vtkUnsignedCharArray;
38 class vtkDoubleArray;
39 class vtkCellArray;
40 class vtkCellData;
41 class vtkIntArray;
42 class vtkMultiProcessController;
43 class vtkDataArraySelection;
44 class vtkCallbackCommand;
45 
49 class vtkAMRDualClipLocator;
50 
51 class VTKPVVTKEXTENSIONSDEFAULT_EXPORT vtkAMRDualClip : public vtkMultiBlockDataSetAlgorithm
52 {
53 public:
54  static vtkAMRDualClip* New();
55  vtkTypeMacro(vtkAMRDualClip, vtkMultiBlockDataSetAlgorithm);
56  void PrintSelf(ostream& os, vtkIndent indent);
57 
58  vtkSetMacro(IsoValue, double);
59  vtkGetMacro(IsoValue, double);
60 
62 
67  vtkSetMacro(EnableInternalDecimation, int);
68  vtkGetMacro(EnableInternalDecimation, int);
69  vtkSetMacro(EnableDegenerateCells, int);
70  vtkGetMacro(EnableDegenerateCells, int);
71  vtkBooleanMacro(EnableDegenerateCells, int);
72  vtkSetMacro(EnableMultiProcessCommunication, int);
73  vtkGetMacro(EnableMultiProcessCommunication, int);
74  vtkBooleanMacro(EnableMultiProcessCommunication, int);
76 
78 
83  vtkSetMacro(EnableMergePoints, int);
84  vtkGetMacro(EnableMergePoints, int);
85  vtkBooleanMacro(EnableMergePoints, int);
87 
88  vtkGetObjectMacro(Controller, vtkMultiProcessController);
89  virtual void SetController(vtkMultiProcessController*);
90 
91 protected:
93  ~vtkAMRDualClip();
94 
95  double IsoValue;
96 
97  // Algorithm options that may improve performance.
102 
103  // Needed for copying cell data to point data.
104  vtkUnstructuredGrid* Mesh;
105 
106  virtual int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
107 
108  void InitializeCopyAttributes(vtkNonOverlappingAMR* hbdsInput, vtkDataSet* mesh);
109 
114  vtkMultiBlockDataSet* DoRequestData(vtkNonOverlappingAMR* input, const char* arrayNameToProcess);
115 
116  virtual int FillInputPortInformation(int port, vtkInformation* info);
117  virtual int FillOutputPortInformation(int port, vtkInformation* info);
118 
119  void ShareBlockLocatorWithNeighbors(vtkAMRDualGridHelperBlock* block);
120 
121  void ProcessBlock(vtkAMRDualGridHelperBlock* block, int blockId, const char* arrayName);
122 
123  void ProcessDualCell(vtkAMRDualGridHelperBlock* block, int blockId, int x, int y, int z,
124  vtkIdType cornerOffsets[8], vtkDataArray* volumeFractionArray);
125 
126  void InitializeLevelMask(vtkAMRDualGridHelperBlock* block);
127  void ShareLevelMask(vtkAMRDualGridHelperBlock* block);
128  void DistributeLevelMasks();
129 
130  // void DebugCases();
131  // void PermuteCases();
132  // void MirrorCases();
133  // void AddGlyph(double x, double y, double z);
134 
135  // Stuff exclusively for debugging.
136  vtkIntArray* BlockIdCellArray;
137  vtkUnsignedCharArray* LevelMaskPointArray;
138 
139  // Ivars used to reduce method parrameters.
141  vtkPoints* Points;
142  vtkCellArray* Cells;
143 
144  vtkMultiProcessController* Controller;
145 
146  // I made these ivars to avoid allocating multiple times.
147  // The buffer is not used too many times, but .....
150 
151  vtkAMRDualClipLocator* BlockLocator;
152 
153 private:
154  vtkAMRDualClip(const vtkAMRDualClip&) VTK_DELETE_FUNCTION;
155  void operator=(const vtkAMRDualClip&) VTK_DELETE_FUNCTION;
156 };
157 
158 #endif
vtkMultiProcessController * Controller
Clip (with scalars) an AMR volume to unstructured grid.
vtkCellArray * Cells
vtkAMRDualGridHelper * Helper
vtkPoints * Points
vtkIntArray * BlockIdCellArray
int EnableMultiProcessCommunication
vtkUnstructuredGrid * Mesh
Tools for processing AMR as a dual grid.
int * MessageBufferLength
vtkUnsignedCharArray * LevelMaskPointArray
int EnableInternalDecimation
vtkAMRDualClipLocator * BlockLocator