VTK  9.3.20240419
vtkOverlappingCellsDetector.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
38 #ifndef vtkOverlappingCellsDetector_h
39 #define vtkOverlappingCellsDetector_h
40 
41 #include "vtkFiltersParallelDIY2Module.h" // for export macros
43 
44 #include "vtkBoundingBox.h" // For DetectOverlappingCells
45 
46 #include <set> // For DetectOverlappingCells
47 #include <unordered_map> // For DetectOverlappingCells
48 #include <vector> // For DetectOverlappingCells
49 
50 VTK_ABI_NAMESPACE_BEGIN
51 class vtkDataSet;
53 class vtkPointSet;
54 
55 class VTKFILTERSPARALLELDIY2_EXPORT vtkOverlappingCellsDetector : public vtkPassInputTypeAlgorithm
56 {
57 public:
60  void PrintSelf(ostream& os, vtkIndent indent) override;
61 
63 
68  vtkGetObjectMacro(Controller, vtkMultiProcessController);
70 
72 
75  vtkGetMacro(Tolerance, double);
76  vtkSetMacro(Tolerance, double);
78 
80 
84  vtkGetStringMacro(NumberOfOverlapsPerCellArrayName);
85  vtkSetStringMacro(NumberOfOverlapsPerCellArrayName);
87 
88 protected:
91 
93 
95 
99  int ExposeOverlappingCellsAmongBlocks(std::vector<vtkPointSet*>& outputs);
100 
124  bool DetectOverlappingCells(vtkDataSet* queryCellDataSet, vtkPointSet* queryPointCloud,
125  const std::vector<vtkBoundingBox>& queryCellBoundingBoxes, vtkDataSet* cellDataSet,
126  vtkPointSet* pointCloud, const std::vector<vtkBoundingBox>& cellBoundingBoxes,
127  std::unordered_map<vtkIdType, std::set<vtkIdType>>& collisionListMap,
128  bool updateProgress = false);
129 
134 
139 
149  double Tolerance;
150 
151 private:
153  void operator=(const vtkOverlappingCellsDetector&) = delete;
154 };
155 
156 VTK_ABI_NAMESPACE_END
157 #endif
abstract class to specify dataset behavior
Definition: vtkDataSet.h:166
a simple class to control print indentation
Definition: vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Multiprocessing communication superclass.
Exposes how many cells each cell of the input collide.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
~vtkOverlappingCellsDetector() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkOverlappingCellsDetector * New()
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
double Tolerance
Tolerance for overlap detections.
int ExposeOverlappingCellsAmongBlocks(std::vector< vtkPointSet * > &outputs)
Main pipeline.
vtkMultiProcessController * Controller
Local controller.
void SetController(vtkMultiProcessController *)
Get/Set the controller to use.
bool DetectOverlappingCells(vtkDataSet *queryCellDataSet, vtkPointSet *queryPointCloud, const std::vector< vtkBoundingBox > &queryCellBoundingBoxes, vtkDataSet *cellDataSet, vtkPointSet *pointCloud, const std::vector< vtkBoundingBox > &cellBoundingBoxes, std::unordered_map< vtkIdType, std::set< vtkIdType >> &collisionListMap, bool updateProgress=false)
Method performing the cell detection.
char * NumberOfOverlapsPerCellArrayName
Output cell scalar field counting the number of cells that each cell was found to collide.
Superclass for algorithms that produce output of the same type as input.
concrete class for storing a set of points
Definition: vtkPointSet.h:98
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447
int vtkIdType
Definition: vtkType.h:315