Open CASCADE Technology  7.7.0
Data Structures
BOPTools_PairSelector< Dimension > Class Template Reference

Template Selector for selection of the elements from two BVH trees. More...

#include <BOPTools_PairSelector.hxx>

Inheritance diagram for BOPTools_PairSelector< Dimension >:
Inheritance graph
[legend]

Data Structures

struct  PairIDs
 Auxiliary structure to keep the pair of indices. More...
 

Public Types

public types
typedef BVH::VectorType< Standard_Real, Dimension >::Type BVH_VecNd
 
- Public Types inherited from BVH_PairTraverse< Standard_Real, Dimension, BVH_BoxSet< Standard_Real, Dimension, Standard_Integer > >
typedef BVH_Box< Standard_Real, Dimension >::BVH_VecNt BVH_VecNt
 

Public Member Functions

Constructor
 BOPTools_PairSelector ()
 Empty constructor. More...
 
public interfaces
void Clear ()
 Clears the indices. More...
 
void Sort ()
 Sorts the indices. More...
 
void SetSame (const Standard_Boolean theIsSame)
 Tells to selector that BVH trees are the same. If the flag is set to true the resulting vector will contain only unique pairs (mirrored pairs will be rejected, e.g. (1, 2) will be taken, (2, 1) will be rejected) and will not contain pairs in which IDs are the same (pair (1, 1) will be rejected). If it is required to have a full vector of pairs even for the same BVH trees, just keep the false value of this flag. More...
 
const std::vector< PairIDs > & Pairs () const
 Returns the list of accepted indices. More...
 
Rejection/Acceptance rules
virtual Standard_Boolean RejectNode (const BVH_VecNd &theCMin1, const BVH_VecNd &theCMax1, const BVH_VecNd &theCMin2, const BVH_VecNd &theCMax2, Standard_Real &) const override
 Basing on the bounding boxes of the nodes checks if the pair of nodes should be rejected. More...
 
Standard_Boolean RejectElement (const Standard_Integer theID1, const Standard_Integer theID2)
 Checks if the pair of elements should be rejected. More...
 
virtual Standard_Boolean Accept (const Standard_Integer theID1, const Standard_Integer theID2) override
 Checks and accepts the pair of elements. More...
 
- Public Member Functions inherited from BVH_PairTraverse< Standard_Real, Dimension, BVH_BoxSet< Standard_Real, Dimension, Standard_Integer > >
 BVH_PairTraverse ()
 Constructor. More...
 
void SetBVHSets (BVH_BoxSet< Standard_Real, Dimension, Standard_Integer > *theBVHSet1, BVH_BoxSet< Standard_Real, Dimension, Standard_Integer > *theBVHSet2)
 Sets the BVH Sets containing the BVH trees. More...
 
virtual Standard_Boolean RejectNode (const BVH_VecNt &theCornerMin1, const BVH_VecNt &theCornerMax1, const BVH_VecNt &theCornerMin2, const BVH_VecNt &theCornerMax2, Standard_Real &theMetric) const=0
 Rejection of the pair of nodes by bounding boxes. Metric is computed to choose the best branch. Returns true if the pair of nodes should be rejected, 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< Standard_Real, Dimension >> &theBVH1, const opencascade::handle< BVH_Tree< Standard_Real, 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...
 
- Public Member Functions inherited from BVH_BaseTraverse< Standard_Real >
virtual Standard_Boolean IsMetricBetter (const Standard_Real &, const Standard_Real &) const
 Compares the two metrics and chooses the best one. Returns true if the first metric is better than the second, false otherwise. More...
 
virtual Standard_Boolean RejectMetric (const Standard_Real &) const
 Rejects the node by the metric. More...
 
virtual Standard_Boolean Stop () const
 Returns the flag controlling the tree descend. Returns true if the tree descend should be stopped. More...
 

Protected Attributes

Fields
std::vector< PairIDsmyPairs
 Selected pairs of indices. More...
 
Standard_Boolean mySameBVHs
 Selection is performed from the same BVH trees. More...
 
- Protected Attributes inherited from BVH_PairTraverse< Standard_Real, Dimension, BVH_BoxSet< Standard_Real, Dimension, Standard_Integer > >
BVH_BoxSet< Standard_Real, Dimension, Standard_Integer > * myBVHSet1
 
BVH_BoxSet< Standard_Real, Dimension, Standard_Integer > * myBVHSet2
 

Additional Inherited Members

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

Detailed Description

template<int Dimension>
class BOPTools_PairSelector< Dimension >

Template Selector for selection of the elements from two BVH trees.

Member Typedef Documentation

◆ BVH_VecNd

template<int Dimension>
typedef BVH::VectorType<Standard_Real, Dimension>::Type BOPTools_PairSelector< Dimension >::BVH_VecNd

Constructor & Destructor Documentation

◆ BOPTools_PairSelector()

template<int Dimension>
BOPTools_PairSelector< Dimension >::BOPTools_PairSelector ( )
inline

Empty constructor.

Member Function Documentation

◆ Accept()

template<int Dimension>
virtual Standard_Boolean BOPTools_PairSelector< Dimension >::Accept ( const Standard_Integer  theID1,
const Standard_Integer  theID2 
)
inlineoverridevirtual

◆ Clear()

template<int Dimension>
void BOPTools_PairSelector< Dimension >::Clear ( )
inline

Clears the indices.

◆ Pairs()

template<int Dimension>
const std::vector<PairIDs>& BOPTools_PairSelector< Dimension >::Pairs ( ) const
inline

Returns the list of accepted indices.

◆ RejectElement()

template<int Dimension>
Standard_Boolean BOPTools_PairSelector< Dimension >::RejectElement ( const Standard_Integer  theID1,
const Standard_Integer  theID2 
)
inline

Checks if the pair of elements should be rejected.

◆ RejectNode()

template<int Dimension>
virtual Standard_Boolean BOPTools_PairSelector< Dimension >::RejectNode ( const BVH_VecNd theCMin1,
const BVH_VecNd theCMax1,
const BVH_VecNd theCMin2,
const BVH_VecNd theCMax2,
Standard_Real  
) const
inlineoverridevirtual

Basing on the bounding boxes of the nodes checks if the pair of nodes should be rejected.

◆ SetSame()

template<int Dimension>
void BOPTools_PairSelector< Dimension >::SetSame ( const Standard_Boolean  theIsSame)
inline

Tells to selector that BVH trees are the same. If the flag is set to true the resulting vector will contain only unique pairs (mirrored pairs will be rejected, e.g. (1, 2) will be taken, (2, 1) will be rejected) and will not contain pairs in which IDs are the same (pair (1, 1) will be rejected). If it is required to have a full vector of pairs even for the same BVH trees, just keep the false value of this flag.

◆ Sort()

template<int Dimension>
void BOPTools_PairSelector< Dimension >::Sort ( )
inline

Sorts the indices.

Field Documentation

◆ myPairs

template<int Dimension>
std::vector<PairIDs> BOPTools_PairSelector< Dimension >::myPairs
protected

Selected pairs of indices.

◆ mySameBVHs

template<int Dimension>
Standard_Boolean BOPTools_PairSelector< Dimension >::mySameBVHs
protected

Selection is performed from the same BVH trees.


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