vtkPVGeometryFilter.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
11 #ifndef vtkPVGeometryFilter_h
12 #define vtkPVGeometryFilter_h
13 
14 #include "vtkDataObjectAlgorithm.h"
15 #include "vtkPVVTKExtensionsFiltersRenderingModule.h" // needed for export macro
16 #include "vtkSmartPointer.h" // needed for vtkSmartPointer
17 
18 #include "vtkNew.h" // for vtkNew
19 
20 class vtkCartesianGrid;
21 class vtkCellGrid;
22 class vtkDataSet;
23 class vtkDataObjectMeshCache;
24 class vtkDataObjectTree;
25 class vtkExplicitStructuredGrid;
26 class vtkFeatureEdges;
27 class vtkGenericDataSet;
29 class vtkGeometryFilter;
30 class vtkHyperTreeGrid;
31 class vtkImageData;
35 class vtkOutlineSource;
36 class vtkPolyData;
37 class vtkPolyDataNormals;
38 class vtkRecoverGeometryWireframe;
39 class vtkRectilinearGrid;
40 class vtkStructuredGrid;
43 
45 {
46 public:
47  static vtkPVGeometryFilter* New();
49  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
52 
56  vtkGetMacro(OutlineFlag, int);
58 
60 
63  vtkSetMacro(UseOutline, int);
64  vtkGetMacro(UseOutline, int);
66 
68 
72  void SetGenerateFeatureEdges(bool);
73  vtkGetMacro(GenerateFeatureEdges, bool);
75 
77 
80  vtkSetMacro(BlockColorsDistinctValues, int);
81  vtkGetMacro(BlockColorsDistinctValues, int);
83 
85 
90  void SetGenerateCellNormals(int);
91  vtkGetMacro(GenerateCellNormals, int);
92  vtkBooleanMacro(GenerateCellNormals, int);
94 
96 
101  void SetGeneratePointNormals(bool);
102  vtkGetMacro(GeneratePointNormals, bool);
103  vtkBooleanMacro(GeneratePointNormals, bool);
105 
107 
114  void SetFeatureAngle(double);
115  vtkGetMacro(FeatureAngle, double);
117 
119 
124  void SetSplitting(bool);
125  vtkBooleanMacro(Splitting, vtkTypeBool);
127 
129 
135  vtkSetMacro(Triangulate, int);
136  vtkGetMacro(Triangulate, int);
137  vtkBooleanMacro(Triangulate, int);
139 
141 
148  virtual void SetNonlinearSubdivisionLevel(int);
149  vtkGetMacro(NonlinearSubdivisionLevel, int);
151 
153 
159  virtual void SetMatchBoundariesIgnoringCellOrder(int);
160  vtkGetMacro(MatchBoundariesIgnoringCellOrder, int);
162 
164 
167  virtual void SetController(vtkMultiProcessController*);
168  vtkGetObjectMacro(Controller, vtkMultiProcessController);
170 
172 
177  void SetPassThroughCellIds(int);
178  vtkGetMacro(PassThroughCellIds, int);
179  vtkBooleanMacro(PassThroughCellIds, int);
181 
183 
188  void SetPassThroughPointIds(int);
189  vtkGetMacro(PassThroughPointIds, int);
190  vtkBooleanMacro(PassThroughPointIds, int);
192 
194 
197  vtkSetMacro(GenerateProcessIds, bool);
198  vtkGetMacro(GenerateProcessIds, bool);
199  vtkBooleanMacro(GenerateProcessIds, bool);
201 
203 
209  vtkSetMacro(HideInternalAMRFaces, bool);
210  vtkGetMacro(HideInternalAMRFaces, bool);
211  vtkBooleanMacro(HideInternalAMRFaces, bool);
213 
215 
225  vtkSetMacro(UseNonOverlappingAMRMetaDataForOutlines, bool);
226  vtkGetMacro(UseNonOverlappingAMRMetaDataForOutlines, bool);
227  vtkBooleanMacro(UseNonOverlappingAMRMetaDataForOutlines, bool);
229 
230 protected:
232  ~vtkPVGeometryFilter() override;
233 
235 
240  virtual int RequestAMRData(vtkInformation* request, vtkInformationVector** inputVector,
241  vtkInformationVector* outputVector);
242  virtual int RequestDataObjectTree(vtkInformation* request, vtkInformationVector** inputVector,
243  vtkInformationVector* outputVector);
244  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
245  vtkInformationVector* outputVector) override;
247 
253  void ExecuteAMRBlock(vtkCartesianGrid* input, vtkPolyData* output, const bool extractface[6]);
254 
258  void ExecuteAMRBlockOutline(
259  const double bounds[6], vtkPolyData* output, const bool extractface[6]);
260 
261  void ExecuteBlock(vtkDataObject* input, vtkPolyData* output, int doCommunicate, int updatePiece,
262  int updateNumPieces, int updateGhosts, const int* wholeExtent);
263 
264  void DataSetExecute(vtkDataSet* input, vtkPolyData* output, int doCommunicate);
265  void GenericDataSetExecute(vtkGenericDataSet* input, vtkPolyData* output, int doCommunicate);
266 
267  void ImageDataExecute(
268  vtkImageData* input, vtkPolyData* output, int doCommunicate, int updatePiece, const int* ext);
269 
270  void StructuredGridExecute(vtkStructuredGrid* input, vtkPolyData* output, int updatePiece,
271  int updateNumPieces, int updateGhosts, const int* wholeExtent);
272 
273  void RectilinearGridExecute(vtkRectilinearGrid* input, vtkPolyData* output, int updatePiece,
274  int updateNumPieces, int updateGhosts, const int* wholeExtent);
275 
276  void UnstructuredGridExecute(
277  vtkUnstructuredGridBase* input, vtkPolyData* output, int doCommunicate);
278 
279  void PolyDataExecute(vtkPolyData* input, vtkPolyData* output, int doCommunicate);
280 
281  void HyperTreeGridExecute(vtkHyperTreeGrid* input, vtkPolyData* output, int doCommunicate);
282 
283  void ExplicitStructuredGridExecute(
284  vtkExplicitStructuredGrid* input, vtkPolyData* out, int doCommunicate, const int* wholeExtent);
285 
286  void CellGridExecute(vtkCellGrid* input, vtkPolyData* output, int doCommunicate);
287 
289 
293  void CleanupOutputData(vtkPolyData* output);
295 
301  bool Splitting;
302  double FeatureAngle;
305  int MatchBoundariesIgnoringCellOrder = 0;
306 
315 
320  int CheckAttributes(vtkDataObject* input);
321 
322  // Callback for recording progress of internal filters.
323  void HandleGeometryFilterProgress(vtkObject* caller, unsigned long, void*);
324 
325  int FillInputPortInformation(int, vtkInformation*) override;
326 
327  void ReportReferences(vtkGarbageCollector*) override;
328 
335 
336 private:
337  vtkPVGeometryFilter(const vtkPVGeometryFilter&) = delete;
338  void operator=(const vtkPVGeometryFilter&) = delete;
339 
340  void AddCompositeIndex(vtkPolyData* pd, unsigned int index);
342 
348  void AddBlockColors(vtkDataObject* pd, unsigned int index);
349  void AddHierarchicalIndex(vtkPolyData* pd, unsigned int level, unsigned int index);
350  class BoundsReductionOperation;
352 
361  void GenerateFeatureEdgesHTG(vtkHyperTreeGrid* input, vtkPolyData* output);
362 
366  void ExecuteNormalsComputation(vtkPolyData* output);
367 
372  void GenerateProcessIdsArrays(vtkPolyData* output);
373 
378  bool UseCacheIfPossible(vtkDataObject* input, vtkDataObject* output);
379 
383  void UpdateCache(vtkDataObject* output);
384 
393  vtkSmartPointer<vtkDataObjectTree> GetDataObjectTreeInput(vtkInformationVector** inputVector);
394 
396 };
397 
398 #endif
virtual int RequestDataObject(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkMultiProcessController * Controller
static vtkDataObjectAlgorithm * New()
vtkSmartPointer< vtkRecoverGeometryWireframe > RecoverWireframeFilter
Geometry filter that does outlines for volumes.
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
int vtkTypeBool
vtkSmartPointer< vtkPolyDataNormals > PolyDataNormals
vtkSmartPointer< vtkUnstructuredGridGeometryFilter > UnstructuredGridGeometryFilter
#define VTKPVVTKEXTENSIONSFILTERSRENDERING_EXPORT
vtkSmartPointer< vtkGenericGeometryFilter > GenericGeometryFilter
virtual int FillInputPortInformation(int port, vtkInformation *info)
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkSmartPointer< vtkFeatureEdges > FeatureEdgesFilter
void ReportReferences(vtkGarbageCollector *) VTK_OVERRIDE
void operator=(const vtkObjectBase &)
vtkSmartPointer< vtkOutlineSource > OutlineSource
vtkSmartPointer< vtkGeometryFilter > GeometryFilter