Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
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

Constructor

 BVH_PairDistance ()
 
Compute the distance

Computes the distance between two BVH trees

NumType ComputeDistance ()
 
Accessing the results

Returns IsDone flag

bool IsDone () const
 Returns the computed distance.
 
NumType Distance () const
 Returns the computed distance.
 
Definition of the rules for tree descend

Compares the two metrics and chooses the best one

bool IsMetricBetter (const NumType &theLeft, const NumType &theRight) const override
 Computes the distance between boxes of the nodes.
 
bool 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.
 
bool RejectMetric (const NumType &theMetric) const override
 Rejects the branch by the metric.
 
bool Stop () const override
 Returns the flag controlling the tree descend.
 
- Public Member Functions inherited from BVH_PairTraverse< NumType, Dimension, BVHSetType, NumType >
 BVH_PairTraverse ()
 
void SetBVHSets (BVHSetType *theBVHSet1, BVHSetType *theBVHSet2)
 
virtual bool RejectNode (const BVH_VecNt &theCornerMin1, const BVH_VecNt &theCornerMax1, const BVH_VecNt &theCornerMin2, const BVH_VecNt &theCornerMax2, NumType &theMetric) const=0
 Leaf element acceptance. Returns true if the pair of elements is accepted, false otherwise.
 
virtual bool Accept (const int theIndex1, const int theIndex2)=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< 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.
 
- Public Member Functions inherited from BVH_BaseTraverse< MetricType >
virtual bool IsMetricBetter (const MetricType &, const MetricType &) const
 
virtual bool RejectMetric (const MetricType &) const
 

Protected Attributes

Fields
NumType myDistance
 Square distance.
 
bool myIsDone
 State of the algorithm.
 
- Protected Attributes inherited from BVH_PairTraverse< NumType, Dimension, BVHSetType, NumType >
BVHSetTypemyBVHSet1
 
BVHSetTypemyBVHSet2
 

Additional Inherited Members

- Protected Member Functions inherited from BVH_BaseTraverse< MetricType >
 BVH_BaseTraverse ()
 Destructor.
 
virtual ~BVH_BaseTraverse ()=default
 Destructor.
 

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

Member Function Documentation

◆ ComputeDistance()

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

◆ 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 >
bool BVH_PairDistance< NumType, Dimension, BVHSetType >::IsDone ( ) const
inline

Returns the computed distance.

◆ IsMetricBetter()

template<class NumType , int Dimension, class BVHSetType >
bool BVH_PairDistance< NumType, Dimension, BVHSetType >::IsMetricBetter ( const NumType & theLeft,
const NumType & theRight ) const
inlineoverride

Computes the distance between boxes of the nodes.

◆ RejectMetric()

template<class NumType , int Dimension, class BVHSetType >
bool BVH_PairDistance< NumType, Dimension, BVHSetType >::RejectMetric ( const NumType & theMetric) const
inlineoverride

Rejects the branch by the metric.

◆ RejectNode()

template<class NumType , int Dimension, class BVHSetType >
bool 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
inlineoverride

Computes the distance between boxes of the nodes.

◆ Stop()

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

Returns the flag controlling the tree descend.

Reimplemented from BVH_BaseTraverse< MetricType >.

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 >
bool BVH_PairDistance< NumType, Dimension, BVHSetType >::myIsDone
protected

State of the algorithm.


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