VTK  9.7.1
vtkGeometryFilterDispatcher.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
3 // SPDX-License-Identifier: BSD-3-Clause
15 #ifndef vtkGeometryFilterDispatcher_h
16 #define vtkGeometryFilterDispatcher_h
17 
18 #include "vtkDataObjectAlgorithm.h"
19 #include "vtkFiltersParallelModule.h" // needed for export macro
20 #include "vtkSmartPointer.h" // needed for vtkSmartPointer
21 
22 #include "vtkNew.h" // for vtkNew
23 
24 VTK_ABI_NAMESPACE_BEGIN
25 
26 class vtkCartesianGrid;
27 class vtkCellGrid;
28 class vtkDataSet;
30 class vtkDataObjectTree;
32 class vtkFeatureEdges;
33 class vtkGenericDataSet;
35 class vtkGeometryFilter;
36 class vtkHyperTreeGrid;
37 class vtkImageData;
41 class vtkOutlineSource;
42 class vtkPolyData;
43 class vtkPolyDataNormals;
45 class vtkRectilinearGrid;
46 class vtkStructuredGrid;
49 
50 class VTKFILTERSPARALLEL_EXPORT vtkGeometryFilterDispatcher : public vtkDataObjectAlgorithm
51 {
52 public:
55  void PrintSelf(ostream& os, vtkIndent indent) override;
56 
58 
62  vtkGetMacro(OutlineFlag, bool);
64 
66 
69  vtkSetMacro(UseOutline, bool);
70  vtkGetMacro(UseOutline, bool);
71  vtkBooleanMacro(UseOutline, bool);
73 
75 
79  void SetGenerateFeatureEdges(bool);
80  vtkGetMacro(GenerateFeatureEdges, bool);
82 
84 
87  vtkSetMacro(BlockColorsDistinctValues, int);
88  vtkGetMacro(BlockColorsDistinctValues, int);
90 
92 
97  void SetGenerateCellNormals(bool);
98  vtkGetMacro(GenerateCellNormals, bool);
99  vtkBooleanMacro(GenerateCellNormals, bool);
101 
103 
108  void SetGeneratePointNormals(bool);
109  vtkGetMacro(GeneratePointNormals, bool);
110  vtkBooleanMacro(GeneratePointNormals, bool);
112 
114 
121  void SetFeatureAngle(double);
122  vtkGetMacro(FeatureAngle, double);
124 
126 
131  void SetSplitting(bool);
132  vtkGetMacro(Splitting, bool);
133  vtkBooleanMacro(Splitting, bool);
135 
137 
143  vtkSetMacro(Triangulate, bool);
144  vtkGetMacro(Triangulate, bool);
145  vtkBooleanMacro(Triangulate, bool);
147 
149 
156  virtual void SetNonlinearSubdivisionLevel(int);
157  vtkGetMacro(NonlinearSubdivisionLevel, int);
159 
161 
167  virtual void SetMatchBoundariesIgnoringCellOrder(int);
168  vtkGetMacro(MatchBoundariesIgnoringCellOrder, int);
170 
172 
175  virtual void SetController(vtkMultiProcessController*);
176  vtkGetObjectMacro(Controller, vtkMultiProcessController);
178 
180 
185  void SetPassThroughCellIds(bool);
186  vtkGetMacro(PassThroughCellIds, bool);
187  vtkBooleanMacro(PassThroughCellIds, bool);
189 
191 
196  void SetPassThroughPointIds(bool);
197  vtkGetMacro(PassThroughPointIds, bool);
198  vtkBooleanMacro(PassThroughPointIds, bool);
200 
202 
205  vtkSetMacro(GenerateProcessIds, bool);
206  vtkGetMacro(GenerateProcessIds, bool);
207  vtkBooleanMacro(GenerateProcessIds, bool);
209 
211 
217  vtkSetMacro(HideInternalAMRFaces, bool);
218  vtkGetMacro(HideInternalAMRFaces, bool);
219  vtkBooleanMacro(HideInternalAMRFaces, bool);
221 
223 
233  vtkSetMacro(UseNonOverlappingAMRMetaDataForOutlines, bool);
234  vtkGetMacro(UseNonOverlappingAMRMetaDataForOutlines, bool);
235  vtkBooleanMacro(UseNonOverlappingAMRMetaDataForOutlines, bool);
237 
238 protected:
240  ~vtkGeometryFilterDispatcher() override;
241 
243 
248  virtual int RequestAMRData(vtkInformation* request, vtkInformationVector** inputVector,
249  vtkInformationVector* outputVector);
250  virtual int RequestDataObjectTree(vtkInformation* request, vtkInformationVector** inputVector,
251  vtkInformationVector* outputVector);
252  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
253  vtkInformationVector* outputVector) override;
255 
261  void ExecuteAMRBlock(vtkCartesianGrid* input, vtkPolyData* output, const bool extractface[6]);
262 
266  void ExecuteAMRBlockOutline(
267  const double bounds[6], vtkPolyData* output, const bool extractface[6]);
268 
269  void ExecuteBlock(vtkDataObject* input, vtkPolyData* output, bool doCommunicate, int updatePiece,
270  int updateNumPieces, int updateGhosts, const int wholeExtent[6]);
271 
272  void DataSetExecute(vtkDataSet* input, vtkPolyData* output, bool doCommunicate);
273  void GenericDataSetExecute(vtkGenericDataSet* input, vtkPolyData* output, bool doCommunicate);
274 
275  void ImageDataExecute(
276  vtkImageData* input, vtkPolyData* output, bool doCommunicate, int updatePiece, const int* ext);
277 
278  void StructuredGridExecute(vtkStructuredGrid* input, vtkPolyData* output, int updatePiece,
279  int updateNumPieces, int updateGhosts, const int wholeExtent[6]);
280 
281  void RectilinearGridExecute(vtkRectilinearGrid* input, vtkPolyData* output, int updatePiece,
282  int updateNumPieces, int updateGhosts, const int wholeExtent[6]);
283 
284  void UnstructuredGridExecute(
285  vtkUnstructuredGridBase* input, vtkPolyData* output, bool doCommunicate);
286 
287  void PolyDataExecute(vtkPolyData* input, vtkPolyData* output, bool doCommunicate);
288 
289  void HyperTreeGridExecute(vtkHyperTreeGrid* input, vtkPolyData* output, bool doCommunicate);
290 
291  void ExplicitStructuredGridExecute(vtkExplicitStructuredGrid* input, vtkPolyData* out,
292  bool doCommunicate, const int wholeExtent[6]);
293 
294  void CellGridExecute(vtkCellGrid* input, vtkPolyData* output, bool doCommunicate);
295 
297 
301  void CleanupOutputData(vtkPolyData* output);
303 
304  bool OutlineFlag = false;
305  bool UseOutline = true;
306  int BlockColorsDistinctValues = 7;
307  bool GenerateCellNormals = false;
308  bool GeneratePointNormals = false;
309  bool Splitting = true;
310  double FeatureAngle = 30.0;
311  bool Triangulate = false;
312  int NonlinearSubdivisionLevel = 1;
313  int MatchBoundariesIgnoringCellOrder = 0;
314 
315  vtkMultiProcessController* Controller = nullptr;
323 
328  int CheckAttributes(vtkDataObject* input);
329 
330  // Callback for recording progress of internal filters.
331  void HandleGeometryFilterProgress(vtkObject* caller, unsigned long, void*);
332 
333  int FillInputPortInformation(int, vtkInformation*) override;
334 
335  void ReportReferences(vtkGarbageCollector*) override;
336 
337  bool GenerateProcessIds = false;
338  bool PassThroughCellIds = true;
339  bool PassThroughPointIds = true;
340  bool HideInternalAMRFaces = true;
341  bool UseNonOverlappingAMRMetaDataForOutlines = true;
342  bool GenerateFeatureEdges = false;
343 
344 private:
346  void operator=(const vtkGeometryFilterDispatcher&) = delete;
347 
353  void AddDataObjectTreeArrays(vtkDataObjectTree* realInput, vtkDataObjectTree* output);
354 
358  void AddCompositeIndex(vtkPolyData* pd, unsigned int index);
360 
366  void AddBlockColors(vtkDataObject* pd, unsigned int index);
367  void AddHierarchicalIndex(vtkPolyData* pd, unsigned int level, unsigned int index);
368  class BoundsReductionOperation;
370 
379  void GenerateFeatureEdgesHTG(vtkHyperTreeGrid* input, vtkPolyData* output);
380 
384  void ExecuteNormalsComputation(vtkPolyData* output);
385 
390  void GenerateProcessIdsArrays(vtkPolyData* output);
391 
396  bool UseCacheIfPossible(vtkDataObject* input, vtkDataObject* output);
397 
401  void UpdateCache(vtkDataObject* output);
402 
411  vtkSmartPointer<vtkDataObjectTree> GetDataObjectTreeInput(vtkInformationVector** inputVector);
412 
414 };
415 
416 VTK_ABI_NAMESPACE_END
417 
418 #endif
virtual int RequestDataObject(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
a dataset that is topologically regular with variable spacing in the three coordinate directions ...
abstract base class for most VTK objects
Definition: vtkObject.h:52
vtkSmartPointer< vtkPolyDataNormals > PolyDataNormals
vtkSmartPointer< vtkUnstructuredGridGeometryFilter > UnstructuredGridGeometryFilter
provides implementation for most abstract methods in the superclass vtkCompositeDataSet ...
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
static vtkDataObjectAlgorithm * New()
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
void ReportReferences(vtkGarbageCollector *) override
vtkSmartPointer< vtkFeatureEdges > FeatureEdgesFilter
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:71
vtkSmartPointer< vtkGenericGeometryFilter > GenericGeometryFilter
Get corrected wireframe from tessellated facets.
Detect and break reference loops.
Visualization data composed of cells of arbitrary type.
Definition: vtkCellGrid.h:48
extract geometry from data (or convert data to polygonal type)
a simple class to control print indentation
Definition: vtkIndent.h:28
vtkSmartPointer< vtkRecoverGeometryWireframe > RecoverWireframeFilter
Geometry filter that does outlines for volumes.
extract interior, boundary, non-manifold, and/or sharp edges from polygonal data
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
create wireframe outline around bounding box
compute normals for polygonal mesh
Superclass for algorithms that produce only data object as output.
structured grid with explicit topology and geometry
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
extract geometry from an unstructured grid
topologically regular array of data
Store zero or more vtkInformation instances.
extract boundary geometry from dataset (or convert data to polygonal type)
Abstract API for vtkImageData and vtkRectilinearGrid.
vtkDataObjectMeshCache is a class to store and reuse the mesh of a vtkDataSet, while forwarding data ...
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
defines dataset interface
vtkSmartPointer< vtkGeometryFilter > GeometryFilter
general representation of visualization data
Definition: vtkDataObject.h:55
dataset represents arbitrary combinations of all possible cell types.
vtkSmartPointer< vtkOutlineSource > OutlineSource
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Multiprocessing communication superclass.