![]() |
Open CASCADE Technology Reference Manual 8.0.0
|
Performs BVH tree traversal of two polyhedra to find candidate triangle pairs for intersection testing. This class implements the BVH_PairTraverse interface to efficiently find potentially intersecting triangles using bounding box tests. More...
#include <IntPatch_BVHTraversal.hxx>

Data Structures | |
| struct | TrianglePair |
| Pair of triangle indices (both 1-based, original indices in polyhedra). More... | |
Public Member Functions | |
| IntPatch_BVHTraversal () | |
| Creates an empty traversal object. | |
| virtual | ~IntPatch_BVHTraversal () |
| Destructor. | |
| int | Perform (IntPatch_PolyhedronBVH &theSet1, IntPatch_PolyhedronBVH &theSet2, bool theSelfInterference=false) |
| Performs BVH traversal and collects candidate triangle pairs. | |
| const NCollection_DynamicArray< TrianglePair > & | Pairs () const |
| Returns the collected triangle pairs. | |
| void | Clear () |
| Clears the collected pairs. | |
Public Member Functions inherited from BVH_PairTraverse< double, 3 > | |
| BVH_PairTraverse () | |
| void | SetBVHSets (void *theBVHSet1, void *theBVHSet2) |
| virtual bool | RejectNode (const BVH_VecNt &theCornerMin1, const BVH_VecNt &theCornerMax1, const BVH_VecNt &theCornerMin2, const BVH_VecNt &theCornerMax2, double &theMetric) const=0 |
| Leaf element acceptance. Returns true if the pair of elements is accepted, false otherwise. | |
| int | Select () |
| Performs selection of the elements from two BVH trees by the rules defined in Accept/Reject methods. Returns the number of accepted pairs of elements. | |
| int | Select (const opencascade::handle< BVH_Tree< double, Dimension > > &theBVH1, const opencascade::handle< BVH_Tree< double, Dimension > > &theBVH2) |
| Performs selection of the elements from two BVH trees by the rules defined in Accept/Reject methods. Returns the number of accepted pairs of elements. | |
Public Member Functions inherited from BVH_BaseTraverse< MetricType > | |
| virtual bool | IsMetricBetter (const MetricType &, const MetricType &) const |
| virtual bool | RejectMetric (const MetricType &) const |
| virtual bool | Stop () const |
BVH_PairTraverse interface implementation | ||||||||||||||||
Rejects pair of nodes if their bounding boxes don't overlap.
| ||||||||||||||||
| virtual bool | RejectNode (const BVH_Vec3d &theCMin1, const BVH_Vec3d &theCMax1, const BVH_Vec3d &theCMin2, const BVH_Vec3d &theCMax2, double &theMetric) const override | |||||||||||||||
| First BVH set. | ||||||||||||||||
| virtual bool | Accept (const int theIndex1, const int theIndex2) override | |||||||||||||||
| Accepts a pair of leaf elements and stores their original indices. | ||||||||||||||||
Additional Inherited Members | |
Public Types inherited from BVH_PairTraverse< double, 3 > | |
| typedef BVH_Box< double, Dimension >::BVH_VecNt | BVH_VecNt |
Protected Member Functions inherited from BVH_BaseTraverse< MetricType > | |
| BVH_BaseTraverse () | |
| Destructor. | |
| virtual | ~BVH_BaseTraverse ()=default |
| Destructor. | |
Protected Attributes inherited from BVH_PairTraverse< double, 3 > | |
| void * | myBVHSet1 |
| void * | myBVHSet2 |
Performs BVH tree traversal of two polyhedra to find candidate triangle pairs for intersection testing. This class implements the BVH_PairTraverse interface to efficiently find potentially intersecting triangles using bounding box tests.
The traversal collects pairs of original (1-based) triangle indices that have overlapping bounding boxes, which should then be tested for actual geometric intersection using IntPatch_InterferencePolyhedron::Intersect().
| IntPatch_BVHTraversal::IntPatch_BVHTraversal | ( | ) |
Creates an empty traversal object.
|
virtual |
Destructor.
|
overridevirtual |
Accepts a pair of leaf elements and stores their original indices.
| [in] | theIndex1 | 0-based index in the first BVH set |
| [in] | theIndex2 | 0-based index in the second BVH set |
Implements BVH_PairTraverse< double, 3 >.
|
inline |
Clears the collected pairs.
|
inline |
Returns the collected triangle pairs.
| int IntPatch_BVHTraversal::Perform | ( | IntPatch_PolyhedronBVH & | theSet1, |
| IntPatch_PolyhedronBVH & | theSet2, | ||
| bool | theSelfInterference = false ) |
Performs BVH traversal and collects candidate triangle pairs.
| [in] | theSet1 | BVH set for the first polyhedron |
| [in] | theSet2 | BVH set for the second polyhedron |
| [in] | theSelfInterference | if true, skip pairs where first index >= second index (used for self-intersection where we don't want to test same pair twice) |
|
overridevirtual |
First BVH set.