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 "vtkParaViewDeprecation.h" // For PARAVIEW_DEPRECATED_IN_5_13_0
17 #include "vtkSmartPointer.h" // needed for vtkSmartPointer
18 
19 #include "vtkNew.h" // for vtkNew
20 
21 class vtkCallbackCommand;
22 class vtkCellGrid;
23 class vtkDataSet;
24 class vtkDataObjectMeshCache;
25 class vtkDataObjectTree;
26 class vtkExplicitStructuredGrid;
27 class vtkFeatureEdges;
28 class vtkGenericDataSet;
30 class vtkGeometryFilter;
31 class vtkHyperTreeGrid;
32 class vtkImageData;
33 class vtkUniformGrid;
37 class vtkOutlineSource;
38 class vtkPolyData;
39 class vtkRecoverGeometryWireframe;
40 class vtkRectilinearGrid;
41 class vtkStructuredGrid;
44 class vtkAMRBox;
45 class vtkOverlappingAMR;
46 
48 {
49 public:
50  static vtkPVGeometryFilter* New();
52  void PrintSelf(ostream& os, vtkIndent indent) override;
53 
55 
59  vtkGetMacro(OutlineFlag, int);
61 
63 
66  vtkSetMacro(UseOutline, int);
67  vtkGetMacro(UseOutline, int);
69 
71 
75  void SetGenerateFeatureEdges(bool);
76  vtkGetMacro(GenerateFeatureEdges, bool);
78 
80 
83  vtkSetMacro(BlockColorsDistinctValues, int);
84  vtkGetMacro(BlockColorsDistinctValues, int);
86 
88 
93  vtkSetMacro(GenerateCellNormals, int);
94  vtkGetMacro(GenerateCellNormals, int);
95  vtkBooleanMacro(GenerateCellNormals, int);
97 
99 
105  vtkSetMacro(Triangulate, int);
106  vtkGetMacro(Triangulate, int);
107  vtkBooleanMacro(Triangulate, int);
109 
111 
118  virtual void SetNonlinearSubdivisionLevel(int);
119  vtkGetMacro(NonlinearSubdivisionLevel, int);
121 
123 
129  virtual void SetMatchBoundariesIgnoringCellOrder(int);
130  vtkGetMacro(MatchBoundariesIgnoringCellOrder, int);
132 
134 
137  virtual void SetController(vtkMultiProcessController*);
138  vtkGetObjectMacro(Controller, vtkMultiProcessController);
140 
142 
147  void SetPassThroughCellIds(int);
148  vtkGetMacro(PassThroughCellIds, int);
149  vtkBooleanMacro(PassThroughCellIds, int);
151 
153 
158  void SetPassThroughPointIds(int);
159  vtkGetMacro(PassThroughPointIds, int);
160  vtkBooleanMacro(PassThroughPointIds, int);
162 
164 
167  vtkSetMacro(GenerateProcessIds, bool);
168  vtkGetMacro(GenerateProcessIds, bool);
169  vtkBooleanMacro(GenerateProcessIds, bool);
171 
173 
179  vtkSetMacro(HideInternalAMRFaces, bool);
180  vtkGetMacro(HideInternalAMRFaces, bool);
181  vtkBooleanMacro(HideInternalAMRFaces, bool);
183 
185 
195  vtkSetMacro(UseNonOverlappingAMRMetaDataForOutlines, bool);
196  vtkGetMacro(UseNonOverlappingAMRMetaDataForOutlines, bool);
197  vtkBooleanMacro(UseNonOverlappingAMRMetaDataForOutlines, bool);
199 
200  // These keys are put in the output composite-data metadata for multipieces
201  // since this filter merges multipieces together.
202  PARAVIEW_DEPRECATED_IN_5_13_0("They are not used anymore.")
203  static vtkInformationIntegerVectorKey* POINT_OFFSETS();
204  PARAVIEW_DEPRECATED_IN_5_13_0("They are not used anymore.")
205  static vtkInformationIntegerVectorKey* VERTS_OFFSETS();
206  PARAVIEW_DEPRECATED_IN_5_13_0("They are not used anymore.")
207  static vtkInformationIntegerVectorKey* LINES_OFFSETS();
208  PARAVIEW_DEPRECATED_IN_5_13_0("They are not used anymore.")
209  static vtkInformationIntegerVectorKey* POLYS_OFFSETS();
210  PARAVIEW_DEPRECATED_IN_5_13_0("They are not used anymore.")
211  static vtkInformationIntegerVectorKey* STRIPS_OFFSETS();
212 
213 protected:
215  ~vtkPVGeometryFilter() override;
216 
218 
222  int RequestDataObject(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
223  virtual int RequestAMRData(vtkInformation* request, vtkInformationVector** inputVector,
224  vtkInformationVector* outputVector);
225  virtual int RequestDataObjectTree(vtkInformation* request, vtkInformationVector** inputVector,
226  vtkInformationVector* outputVector);
227  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
228  vtkInformationVector* outputVector) override;
230 
236  void ExecuteAMRBlock(vtkUniformGrid* input, vtkPolyData* output, const bool extractface[6]);
237 
241  void ExecuteAMRBlockOutline(
242  const double bounds[6], vtkPolyData* output, const bool extractface[6]);
243 
244  void ExecuteBlock(vtkDataObject* input, vtkPolyData* output, int doCommunicate, int updatePiece,
245  int updateNumPieces, int updateGhosts, const int* wholeExtent);
246 
247  void DataSetExecute(vtkDataSet* input, vtkPolyData* output, int doCommunicate);
248  void GenericDataSetExecute(vtkGenericDataSet* input, vtkPolyData* output, int doCommunicate);
249 
250  void ImageDataExecute(
251  vtkImageData* input, vtkPolyData* output, int doCommunicate, int updatePiece, const int* ext);
252 
253  void StructuredGridExecute(vtkStructuredGrid* input, vtkPolyData* output, int updatePiece,
254  int updateNumPieces, int updateGhosts, const int* wholeExtent);
255 
256  void RectilinearGridExecute(vtkRectilinearGrid* input, vtkPolyData* output, int updatePiece,
257  int updateNumPieces, int updateGhosts, const int* wholeExtent);
258 
259  void UnstructuredGridExecute(
260  vtkUnstructuredGridBase* input, vtkPolyData* output, int doCommunicate);
261 
262  void PolyDataExecute(vtkPolyData* input, vtkPolyData* output, int doCommunicate);
263 
264  void HyperTreeGridExecute(vtkHyperTreeGrid* input, vtkPolyData* output, int doCommunicate);
265 
266  void ExplicitStructuredGridExecute(
267  vtkExplicitStructuredGrid* input, vtkPolyData* out, int doCommunicate, const int* wholeExtent);
268 
269  void CellGridExecute(vtkCellGrid* input, vtkPolyData* output, int doCommunicate);
270 
275  void CleanupOutputData(vtkPolyData* output, int doCommunicate);
276 
277  void ExecuteCellNormals(vtkPolyData* output, int doCommunicate);
278 
279  int OutlineFlag;
280  int UseOutline;
281  int BlockColorsDistinctValues;
282  int GenerateCellNormals;
283  int Triangulate;
284  int NonlinearSubdivisionLevel;
285  int MatchBoundariesIgnoringCellOrder = 0;
286 
291  vtkSmartPointer<vtkUnstructuredGridGeometryFilter> UnstructuredGridGeometryFilter;
292  vtkSmartPointer<vtkRecoverGeometryWireframe> RecoverWireframeFilter;
293  vtkSmartPointer<vtkFeatureEdges> FeatureEdgesFilter;
294 
299  int CheckAttributes(vtkDataObject* input);
300 
301  // Callback for recording progress of internal filters.
302  void HandleGeometryFilterProgress(vtkObject* caller, unsigned long, void*);
303 
304  int FillInputPortInformation(int, vtkInformation*) override;
305 
306  void ReportReferences(vtkGarbageCollector*) override;
307 
308  bool GenerateProcessIds;
309  int PassThroughCellIds;
310  int PassThroughPointIds;
311  bool HideInternalAMRFaces;
312  bool UseNonOverlappingAMRMetaDataForOutlines;
313  bool GenerateFeatureEdges;
314 
315 private:
316  vtkPVGeometryFilter(const vtkPVGeometryFilter&) = delete;
317  void operator=(const vtkPVGeometryFilter&) = delete;
318 
319  void AddCompositeIndex(vtkPolyData* pd, unsigned int index);
321 
327  void AddBlockColors(vtkDataObject* pd, unsigned int index);
328  void AddHierarchicalIndex(vtkPolyData* pd, unsigned int level, unsigned int index);
329  class BoundsReductionOperation;
331 
340  void GenerateFeatureEdgesHTG(vtkHyperTreeGrid* input, vtkPolyData* output);
341 
346  void GenerateProcessIdsArrays(vtkPolyData* output);
347 
352  bool UseCacheIfPossible(vtkDataObject* input, vtkDataObject* output);
353 
357  void UpdateCache(vtkDataObject* output);
358 
359  vtkNew<vtkDataObjectMeshCache> MeshCache;
360 };
361 
362 #endif
static vtkDataObjectAlgorithm * New()
Geometry filter that does outlines for volumes.
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
#define PARAVIEW_DEPRECATED_IN_5_13_0(reason)
#define VTKPVVTKEXTENSIONSFILTERSRENDERING_EXPORT
#define const
Definition: zconf.h:238