VTK  9.3.1
vtkExtractCTHPart.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
31 #ifndef vtkExtractCTHPart_h
32 #define vtkExtractCTHPart_h
33 
34 #include "vtkFiltersParallelModule.h" // For export macro
36 #include "vtkSmartPointer.h" // for using smartpointer
37 
38 VTK_ABI_NAMESPACE_BEGIN
39 class vtkAppendPolyData;
40 class vtkContourFilter;
41 class vtkDataArray;
42 class vtkDataSet;
44 class vtkDoubleArray;
45 class vtkExtractCTHPartInternal;
46 class vtkImageData;
49 class vtkPlane;
50 class vtkPolyData;
51 class vtkRectilinearGrid;
52 class vtkUniformGrid;
55 class vtkExtractCTHPartFragments;
56 
57 //#define EXTRACT_USE_IMAGE_DATA 1
58 
59 class VTKFILTERSPARALLEL_EXPORT vtkExtractCTHPart : public vtkMultiBlockDataSetAlgorithm
60 {
61 public:
62  static vtkExtractCTHPart* New();
64  void PrintSelf(ostream& os, vtkIndent indent) override;
65 
67 
70  void AddVolumeArrayName(const char*);
71  void RemoveVolumeArrayNames();
72  int GetNumberOfVolumeArrayNames();
73  const char* GetVolumeArrayName(int idx);
75 
77 
82  void SetController(vtkMultiProcessController* controller);
83  vtkGetObjectMacro(Controller, vtkMultiProcessController);
85 
87 
90  vtkSetMacro(Capping, bool);
91  vtkGetMacro(Capping, bool);
92  vtkBooleanMacro(Capping, bool);
94 
96 
100  vtkSetMacro(GenerateTriangles, bool);
101  vtkGetMacro(GenerateTriangles, bool);
102  vtkBooleanMacro(GenerateTriangles, bool);
104 
106 
111  vtkSetMacro(GenerateSolidGeometry, bool);
112  vtkGetMacro(GenerateSolidGeometry, bool);
113  vtkBooleanMacro(GenerateSolidGeometry, bool);
115 
117 
122  vtkSetMacro(RemoveGhostCells, bool);
123  vtkGetMacro(RemoveGhostCells, bool);
124  vtkBooleanMacro(RemoveGhostCells, bool);
126 
128 
131  void SetClipPlane(vtkPlane* clipPlane);
132  vtkGetObjectMacro(ClipPlane, vtkPlane);
134 
138  vtkMTimeType GetMTime() override;
139 
141 
145  vtkSetClampMacro(VolumeFractionSurfaceValue, double, 0.0, 1.0);
146  vtkGetMacro(VolumeFractionSurfaceValue, double);
148 
149 protected:
151  ~vtkExtractCTHPart() override;
152 
153  int FillInputPortInformation(int port, vtkInformation* info) override;
155 
160  bool ComputeGlobalBounds(vtkCompositeDataSet* input);
161 
166  vtkSmartPointer<vtkDataSet> ExtractContour(vtkCompositeDataSet* input, const char* arrayName);
167 
172  vtkSmartPointer<vtkDataSet> ExtractSolid(vtkCompositeDataSet* input, const char* arrayName);
173 
174  void ExecuteFaceQuads(vtkDataSet* input, vtkPolyData* output, int maxFlag, int originExtents[6],
175  int ext[6], int aAxis, int bAxis, int cAxis);
176 
182  int IsGhostFace(int axis0, int maxFlag, int dims[3], vtkUnsignedCharArray* ghostArray);
183 
184  void TriggerProgressEvent(double val);
185 
191  bool Capping;
195 
196 private:
197  vtkExtractCTHPart(const vtkExtractCTHPart&) = delete;
198  void operator=(const vtkExtractCTHPart&) = delete;
199 
200  class VectorOfFragments;
201  class VectorOfSolids;
202 
206  inline void DetermineSurfaceValue(int dataType);
207 
212  template <class T>
213  bool ExtractClippedContourOnBlock(
214  vtkExtractCTHPart::VectorOfFragments& fragments, T* input, const char* arrayName);
215 
220  template <class T>
221  bool ExtractContourOnBlock(
222  vtkExtractCTHPart::VectorOfFragments& fragments, T* input, const char* arrayName);
223 
228  template <class T>
229  void ExtractExteriorSurface(vtkExtractCTHPart::VectorOfFragments& fragments, T* input);
230 
235  template <class T>
236  bool ExtractClippedVolumeOnBlock(VectorOfSolids& solids, T* input, const char* arrayName);
237 
241  void ExecuteCellDataToPointData(
242  vtkDataArray* cellVolumeFraction, vtkDoubleArray* pointVolumeFraction, const int* dims);
243 
244  double ProgressShift;
245  double ProgressScale;
246 
247  class ScaledProgress;
248  friend class ScaledProgress;
249  vtkExtractCTHPartInternal* Internals;
250 };
251 VTK_ABI_NAMESPACE_END
252 #endif
a dataset that is topologically regular with variable spacing in the three coordinate directions ...
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
abstract class to specify dataset behavior
Definition: vtkDataSet.h:52
double VolumeFractionSurfaceValueInternal
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
dynamic, self-adjusting array of double
static vtkMultiBlockDataSetAlgorithm * New()
abstract superclass for composite (multi-block or AMR) datasets
generate isosurfaces/isolines from scalar values
a simple class to control print indentation
Definition: vtkIndent.h:28
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
appends one or more polygonal datasets together
dataset represents arbitrary combinations of all possible cell types
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
virtual vtkMTimeType GetMTime()
Return this object's modified time.
perform various plane computations
Definition: vtkPlane.h:25
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
dynamic, self-adjusting array of unsigned char
image data with blanking
vtkMultiProcessController * Controller
Store zero or more vtkInformation instances.
Extracts outer surface (as vtkPolyData) of any dataset.
Generates surface of a CTH volume fraction.
Multiprocessing communication superclass.