Parasol Planning Library (PPL)
CDClearanceMap Class Reference

#include <CDInfo.h>

Public Types

Local Types
typedef std::pair< const Body *, const Body * > BodyKey
 
typedef std::pair< const MultiBody *, const MultiBody * > MultiBodyKey
 
typedef std::map< BodyKey, double > BodyMap
 
typedef std::map< MultiBodyKey, double > MultiBodyMap
 
typedef BodyMap::const_iterator iterator
 

Public Member Functions

Modifiers
void Merge (const CDClearanceMap &_other)
 
void SetClearance (const Body *const _a, const Body *const _b, const double _clearance)
 
void Clear ()
 Reset the structure. More...
 
Queries
double GetClearance (const Body *const _a, const Body *const _b) const noexcept
 
double GetClearance (const MultiBody *const _a, const MultiBody *const _b) const noexcept
 
double GetMinClearance () const noexcept
 Get the lowest reported clearance. More...
 
BodyKey GetClosestBodies () const noexcept
 Get the body pair which had the lowest clearance value. More...
 
MultiBodyKey GetClosestMultiBodies () const noexcept
 Get the multibody pair which had the lowest clearance value. More...
 
iterator begin () const noexcept
 
iterator end () const noexcept
 

Detailed Description

Map for tracking the detected clearance between bodies during collision detection.

Member Typedef Documentation

◆ BodyKey

typedef std::pair<const Body*, const Body*> CDClearanceMap::BodyKey

◆ BodyMap

typedef std::map<BodyKey, double> CDClearanceMap::BodyMap

◆ iterator

typedef BodyMap::const_iterator CDClearanceMap::iterator

◆ MultiBodyKey

typedef std::pair<const MultiBody*, const MultiBody*> CDClearanceMap::MultiBodyKey

◆ MultiBodyMap

typedef std::map<MultiBodyKey, double> CDClearanceMap::MultiBodyMap

Member Function Documentation

◆ begin()

CDClearanceMap::iterator CDClearanceMap::begin ( ) const
noexcept

◆ Clear()

void CDClearanceMap::Clear ( )

Reset the structure.

◆ end()

CDClearanceMap::iterator CDClearanceMap::end ( ) const
noexcept

◆ GetClearance() [1/2]

double CDClearanceMap::GetClearance ( const Body *const  _a,
const Body *const  _b 
) const
noexcept

Get the observed clearance between two bodies.

Parameters
_aThe first body.
_bThe second body.
Returns
The clearance observed between _a and _b, or infinity if it was not observed.
Note
Set one of the bodies to null to get the minimum clearance for the non-null body.

◆ GetClearance() [2/2]

double CDClearanceMap::GetClearance ( const MultiBody *const  _a,
const MultiBody *const  _b 
) const
noexcept

Get the observed clearance between two multibodies.

Parameters
_aThe first multibody.
_bThe second multibody.
Returns
The clearance observed between _a and _b, or infinity if it was not observed.
Note
Set one of the multibodies to null to get the minimum clearance for the non-null multibody.

◆ GetClosestBodies()

CDClearanceMap::BodyKey CDClearanceMap::GetClosestBodies ( ) const
noexcept

Get the body pair which had the lowest clearance value.

◆ GetClosestMultiBodies()

CDClearanceMap::MultiBodyKey CDClearanceMap::GetClosestMultiBodies ( ) const
noexcept

Get the multibody pair which had the lowest clearance value.

◆ GetMinClearance()

double CDClearanceMap::GetMinClearance ( ) const
noexcept

Get the lowest reported clearance.

◆ Merge()

void CDClearanceMap::Merge ( const CDClearanceMap _other)

Merge another clearance map into this one. If a key is present in both maps, the lowest clearance will be maintained.

Parameters
_otherThe map to merge into this one.

◆ SetClearance()

void CDClearanceMap::SetClearance ( const Body *const  _a,
const Body *const  _b,
const double  _clearance 
)

Set the observed clearance between two bodies.

Parameters
_aThe first body.
_bThe second body.
_clearanceThe clearance observed between _a and _b.

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