Open CASCADE Technology 7.8.0
BVH_Distance< NumType, Dimension, ObjectType, BVHSetType > Class Template Reference

Abstract class for computation of the min distance between some Object and elements of BVH tree. To use this class it is required to define two methods: More...

#include <BVH_Distance.hxx>

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

Public Member Functions

Constructor
 BVH_Distance ()
 Constructor.
 
Setting object for distance computation
void SetObject (const ObjectType &theObject)
 Sets the object to which the distance is required.
 
Compute the distance
NumType ComputeDistance ()
 Computes the distance between object and BVH tree.
 
Accessing the results
Standard_Boolean IsDone () const
 Returns IsDone flag.
 
NumType Distance () const
 Returns the computed distance.
 
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.
 
virtual Standard_Boolean RejectMetric (const NumType &theMetric) const override
 Rejects the branch by the metric.
 
virtual Standard_Boolean Stop () const override
 Returns the flag controlling the tree descend.
 
- Public Member Functions inherited from BVH_Traverse< NumType, Dimension, BVHSetType, NumType >
 BVH_Traverse ()
 Constructor.
 
void SetBVHSet (BVHSetType *theBVHSet)
 Sets the BVH Set containing the BVH tree.
 
virtual Standard_Boolean AcceptMetric (const NumType &) const
 Basing on the given metric, checks if the whole branch may be accepted without any further checks. Returns true if the metric is accepted, false otherwise.
 
virtual Standard_Boolean RejectNode (const BVH_VecNt &theCornerMin, const BVH_VecNt &theCornerMax, NumType &theMetric) const=0
 Rejection of the node by bounding box. Metric is computed to choose the best branch. Returns true if the node should be rejected, false otherwise.
 
virtual Standard_Boolean Accept (const Standard_Integer theIndex, const NumType &theMetric)=0
 Leaf element acceptance. Metric of the parent leaf-node is passed to avoid the check on the element and accept it unconditionally. Returns true if the element has been accepted, false otherwise.
 
Standard_Integer Select ()
 Selection of the elements from the BVH tree by the rules defined in Accept/Reject methods. The method requires the BVHSet containing BVH tree to be set. Returns the number of accepted elements.
 
Standard_Integer Select (const opencascade::handle< BVH_Tree< NumType, Dimension > > &theBVH)
 Performs selection of the elements from the BVH tree by the rules defined in Accept/Reject methods. Returns the number of accepted elements.
 
- Public Member Functions inherited from BVH_BaseTraverse< MetricType >
virtual Standard_Boolean IsMetricBetter (const MetricType &, const MetricType &) const
 Compares the two metrics and chooses the best one. Returns true if the first metric is better than the second, false otherwise.
 
virtual Standard_Boolean RejectMetric (const MetricType &) const
 Rejects the node by the metric.
 

Protected Attributes

Fields
NumType myDistance
 Distance.
 
Standard_Boolean myIsDone
 State of the algorithm.
 
ObjectType myObject
 Object to compute the distance to.
 
- Protected Attributes inherited from BVH_Traverse< NumType, Dimension, BVHSetType, NumType >
BVHSetTypemyBVHSet
 

Additional Inherited Members

- Public Types inherited from BVH_Traverse< NumType, Dimension, BVHSetType, NumType >
typedef BVH_Box< NumType, Dimension >::BVH_VecNt BVH_VecNt
 
- Protected Member Functions inherited from BVH_BaseTraverse< MetricType >
 BVH_BaseTraverse ()
 Constructor.
 
virtual ~BVH_BaseTraverse ()
 Destructor.
 

Detailed Description

template<class NumType, int Dimension, class ObjectType, class BVHSetType>
class BVH_Distance< NumType, Dimension, ObjectType, BVHSetType >

Abstract class for computation of the min distance between some Object and elements of BVH tree. To use this class it is required to define two methods:

Template Parameters
NumTypeNumeric data type
DimensionVector dimension
ObjectTypeType of the object to which the distance is required
BVHSetTypeType of the set on which BVH is built

Constructor & Destructor Documentation

◆ BVH_Distance()

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

Constructor.

Member Function Documentation

◆ ComputeDistance()

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

Computes the distance between object and BVH tree.

◆ Distance()

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

Returns the computed distance.

◆ IsDone()

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

Returns IsDone flag.

◆ IsMetricBetter()

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

Compares the two metrics and chooses the best one.

◆ RejectMetric()

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

Rejects the branch by the metric.

◆ SetObject()

template<class NumType , int Dimension, class ObjectType , class BVHSetType >
void BVH_Distance< NumType, Dimension, ObjectType, BVHSetType >::SetObject ( const ObjectType &  theObject)
inline

Sets the object to which the distance is required.

◆ Stop()

template<class NumType , int Dimension, class ObjectType , class BVHSetType >
virtual Standard_Boolean BVH_Distance< NumType, Dimension, ObjectType, 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 ObjectType , class BVHSetType >
NumType BVH_Distance< NumType, Dimension, ObjectType, BVHSetType >::myDistance
protected

Distance.

◆ myIsDone

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

State of the algorithm.

◆ myObject

template<class NumType , int Dimension, class ObjectType , class BVHSetType >
ObjectType BVH_Distance< NumType, Dimension, ObjectType, BVHSetType >::myObject
protected

Object to compute the distance to.


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