RobWorkProject  23.9.11-
Classes | Public Types | Public Member Functions | List of all members
ContactDetectorTracking Class Reference

Container for meta-data that can be used to track contact across multiple calls to contact detector, and allows attaching user specified data to the contact. More...

#include <ContactDetectorTracking.hpp>

Classes

struct  ContactInfo
 Meta-data for a contact that allows it to be recalculated. More...
 

Public Types

typedef rw::core::Ptr< ContactDetectorTrackingPtr
 Smart pointer type.
 

Public Member Functions

 ContactDetectorTracking ()
 Constructor.
 
 ContactDetectorTracking (const ContactDetectorTracking &data)
 Copy data to new container.
 
virtual ~ContactDetectorTracking ()
 Destructor.
 
ContactDetectorTrackingoperator= (const ContactDetectorTracking &data)
 Assign data from other container to this container. More...
 
void clear ()
 Clear all stored meta-data.
 
void remove (std::size_t index)
 Remove meta-data for a specific contact. More...
 
ContactStrategyTracking::UserData::Ptr getUserData (std::size_t index) const
 Get user data for the contact with given index. More...
 
std::vector< ContactStrategyTracking::UserData::PtrgetUserData () const
 Get user data for all contacts. More...
 
void setUserData (std::size_t index, ContactStrategyTracking::UserData::Ptr data)
 Attach user data to a given contact. More...
 
void setUserData (const std::vector< ContactStrategyTracking::UserData::Ptr > &data)
 Set user data for all contacts. More...
 
std::size_t getSize () const
 Get the number of contacts tracked. More...
 
Functions for internal usage.

These functions should under normal circumstances not be used by the user of a ContactDetector.

std::vector< ContactInfo > & getInfo ()
 Get a reference to the stored meta-data. More...
 
const std::vector< ContactInfo > & getInfo () const
 Get a reference to the stored meta-data. More...
 
ContactStrategyTrackinggetStrategyTracking (const ContactModel *modelA, const ContactModel *modelB)
 Get the stored ContactStrategyTracking for a specific pair of ContactModels. More...
 

Detailed Description

Container for meta-data that can be used to track contact across multiple calls to contact detector, and allows attaching user specified data to the contact.

Member Function Documentation

◆ getInfo() [1/2]

std::vector<ContactInfo>& getInfo ( )

Get a reference to the stored meta-data.

Returns
reference to a vector of ContactInfo.

◆ getInfo() [2/2]

const std::vector<ContactInfo>& getInfo ( ) const

Get a reference to the stored meta-data.

Returns
reference to a vector of constant ContactInfo.

◆ getSize()

std::size_t getSize ( ) const

Get the number of contacts tracked.

Returns
the number of contacts.

◆ getStrategyTracking()

ContactStrategyTracking& getStrategyTracking ( const ContactModel modelA,
const ContactModel modelB 
)

Get the stored ContactStrategyTracking for a specific pair of ContactModels.

Parameters
modelA[in] the first ContactModel.
modelB[in] the second ContactModel.
Returns
a pointer to the ContactStrategyTracking - caller does NOT own the pointer.

◆ getUserData() [1/2]

std::vector<ContactStrategyTracking::UserData::Ptr> getUserData ( ) const

Get user data for all contacts.

Returns
list of pointers to user data - can be NULL if none is set.

◆ getUserData() [2/2]

ContactStrategyTracking::UserData::Ptr getUserData ( std::size_t  index) const

Get user data for the contact with given index.

Parameters
index[in] the contact to get user data for.
Returns
Pointer to user data, or NULL if no user data is set.

◆ operator=()

ContactDetectorTracking& operator= ( const ContactDetectorTracking data)

Assign data from other container to this container.

Parameters
data[in] the data to copy.
Returns
reference to this container.

◆ remove()

void remove ( std::size_t  index)

Remove meta-data for a specific contact.

Parameters
index[in] the contact to remove.

◆ setUserData() [1/2]

void setUserData ( const std::vector< ContactStrategyTracking::UserData::Ptr > &  data)

Set user data for all contacts.

Parameters
data[in] list of pointers to data.

◆ setUserData() [2/2]

void setUserData ( std::size_t  index,
ContactStrategyTracking::UserData::Ptr  data 
)

Attach user data to a given contact.

Parameters
index[in] the contact to set user data for.
data[in] a pointer to the data.

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