Open CASCADE Technology  7.7.0
Public Types
BVH_PairDistance< NumType, Dimension, BVHSetType > Class Template Reference

Abstract class for computation of the min distance between elements of two BVH trees. To use this class it is required to define only the method Accept to compute the distance between elements of the trees. More...

#include <BVH_PairDistance.hxx>

Inheritance diagram for BVH_PairDistance< NumType, Dimension, BVHSetType >:
Inheritance graph
[legend]

Public Types

typedef BVH_Tools< NumType, Dimension >::BVH_VecNt BVH_VecNt
 
- Public Types inherited from BVH_PairTraverse< NumType, Dimension, BVHSetType, NumType >
typedef BVH_Box< NumType, Dimension >::BVH_VecNt BVH_VecNt
 

Public Member Functions

Constructor
 BVH_PairDistance ()
 Constructor. More...
 
Compute the distance
NumType ComputeDistance ()
 Computes the distance between two BVH trees. More...
 
Accessing the results
Standard_Boolean IsDone () const
 Returns IsDone flag. More...
 
NumType Distance () const
 Returns the computed distance. More...
 
Definition of the rules for tree descend
virtual Standard_Boolean IsMetricBetter (const NumType &theLeft, const NumType &theRight) const override
 Compares the two metrics and chooses the best one. More...
 
virtual Standard_Boolean RejectNode (const BVH_VecNt &theCornerMin1, const BVH_VecNt &theCornerMax1, const BVH_VecNt &theCornerMin2, const BVH_VecNt &theCornerMax2, NumType &theMetric) const override
 Computes the distance between boxes of the nodes. More...
 
virtual Standard_Boolean RejectMetric (const NumType &theMetric) const override
 Rejects the branch by the metric. More...
 
virtual Standard_Boolean Stop () const override
 Returns the flag controlling the tree descend. More...
 
- Public Member Functions inherited from BVH_PairTraverse< NumType, Dimension, BVHSetType, NumType >
 BVH_PairTraverse ()
 Constructor. More...
 
void SetBVHSets (BVHSetType *theBVHSet1, BVHSetType *theBVHSet2)
 Sets the BVH Sets containing the BVH trees. More...
 
virtual Standard_Boolean Accept (const Standard_Integer theIndex1, const Standard_Integer theIndex2)=0
 Leaf element acceptance. Returns true if the pair of elements is accepted, false otherwise. More...
 
Standard_Integer Select ()
 Selection of the pairs of elements of two BVH trees by the rules defined in Accept/Reject methods. The method requires the BVHSets containing BVH trees to be set. Returns the number of accepted pairs of elements. More...
 
Standard_Integer Select (const opencascade::handle< BVH_Tree< NumType, Dimension >> &theBVH1, const opencascade::handle< BVH_Tree< NumType, 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. More...
 
Metrics comparison for choosing the best branch
Rejection of the node by metric
Condition to stop the descend

Protected Attributes

Fields
NumType myDistance
 Square distance. More...
 
Standard_Boolean myIsDone
 State of the algorithm. More...
 
- Protected Attributes inherited from BVH_PairTraverse< NumType, Dimension, BVHSetType, NumType >
BVHSetType * myBVHSet1
 
BVHSetType * myBVHSet2
 

Additional Inherited Members

- Protected Member Functions inherited from BVH_BaseTraverse< NumType >
 BVH_BaseTraverse ()
 Constructor. More...
 
virtual ~BVH_BaseTraverse ()
 Destructor. More...
 

Detailed Description

template<class NumType, int Dimension, class BVHSetType>
class BVH_PairDistance< NumType, Dimension, BVHSetType >

Abstract class for computation of the min distance between elements of two BVH trees. To use this class it is required to define only the method Accept to compute the distance between elements of the trees.

Template Parameters
NumTypeNumeric data type
DimensionVector dimension
BVHSetTypeType of the set on which BVH is built

Member Typedef Documentation

◆ BVH_VecNt

template<class NumType , int Dimension, class BVHSetType >
typedef BVH_Tools<NumType, Dimension>::BVH_VecNt BVH_PairDistance< NumType, Dimension, BVHSetType >::BVH_VecNt

Constructor & Destructor Documentation

◆ BVH_PairDistance()

template<class NumType , int Dimension, class BVHSetType >
BVH_PairDistance< NumType, Dimension, BVHSetType >::BVH_PairDistance ( )
inline

Constructor.

Member Function Documentation

◆ ComputeDistance()

template<class NumType , int Dimension, class BVHSetType >
NumType BVH_PairDistance< NumType, Dimension, BVHSetType >::ComputeDistance ( )
inline

Computes the distance between two BVH trees.

◆ Distance()

template<class NumType , int Dimension, class BVHSetType >
NumType BVH_PairDistance< NumType, Dimension, BVHSetType >::Distance ( ) const
inline

Returns the computed distance.

◆ IsDone()

template<class NumType , int Dimension, class BVHSetType >
Standard_Boolean BVH_PairDistance< NumType, Dimension, BVHSetType >::IsDone ( ) const
inline

Returns IsDone flag.

◆ IsMetricBetter()

template<class NumType , int Dimension, class BVHSetType >
virtual Standard_Boolean BVH_PairDistance< NumType, Dimension, BVHSetType >::IsMetricBetter ( const NumType &  theLeft,
const NumType &  theRight 
) const
inlineoverridevirtual

Compares the two metrics and chooses the best one.

Reimplemented from BVH_BaseTraverse< NumType >.

◆ RejectMetric()

template<class NumType , int Dimension, class BVHSetType >
virtual Standard_Boolean BVH_PairDistance< NumType, Dimension, BVHSetType >::RejectMetric ( const NumType &  theMetric) const
inlineoverridevirtual

Rejects the branch by the metric.

Reimplemented from BVH_BaseTraverse< NumType >.

◆ RejectNode()

template<class NumType , int Dimension, class BVHSetType >
virtual Standard_Boolean BVH_PairDistance< NumType, Dimension, BVHSetType >::RejectNode ( const BVH_VecNt theCornerMin1,
const BVH_VecNt theCornerMax1,
const BVH_VecNt theCornerMin2,
const BVH_VecNt theCornerMax2,
NumType &  theMetric 
) const
inlineoverridevirtual

Computes the distance between boxes of the nodes.

Implements BVH_PairTraverse< NumType, Dimension, BVHSetType, NumType >.

◆ Stop()

template<class NumType , int Dimension, class BVHSetType >
virtual Standard_Boolean BVH_PairDistance< NumType, Dimension, BVHSetType >::Stop ( ) const
inlineoverridevirtual

Returns the flag controlling the tree descend.

Reimplemented from BVH_BaseTraverse< NumType >.

Field Documentation

◆ myDistance

template<class NumType , int Dimension, class BVHSetType >
NumType BVH_PairDistance< NumType, Dimension, BVHSetType >::myDistance
protected

Square distance.

◆ myIsDone

template<class NumType , int Dimension, class BVHSetType >
Standard_Boolean BVH_PairDistance< NumType, Dimension, BVHSetType >::myIsDone
protected

State of the algorithm.


The documentation for this class was generated from the following file: