RobWorkProject
24.12.4-
|
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< ContactDetectorTracking > | Ptr |
Smart pointer type. | |
Public Member Functions | |
ContactDetectorTracking () | |
Constructor. | |
ContactDetectorTracking (const ContactDetectorTracking &data) | |
Copy data to new container. | |
virtual | ~ContactDetectorTracking () |
Destructor. | |
ContactDetectorTracking & | operator= (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::Ptr > | getUserData () 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... | |
ContactStrategyTracking & | getStrategyTracking (const ContactModel *modelA, const ContactModel *modelB) |
Get the stored ContactStrategyTracking for a specific pair of ContactModels. More... | |
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.
std::vector<ContactInfo>& getInfo | ( | ) |
Get a reference to the stored meta-data.
const std::vector<ContactInfo>& getInfo | ( | ) | const |
Get a reference to the stored meta-data.
std::size_t getSize | ( | ) | const |
Get the number of contacts tracked.
ContactStrategyTracking& getStrategyTracking | ( | const ContactModel * | modelA, |
const ContactModel * | modelB | ||
) |
Get the stored ContactStrategyTracking for a specific pair of ContactModels.
modelA | [in] the first ContactModel. |
modelB | [in] the second ContactModel. |
std::vector<ContactStrategyTracking::UserData::Ptr> getUserData | ( | ) | const |
Get user data for all contacts.
ContactStrategyTracking::UserData::Ptr getUserData | ( | std::size_t | index | ) | const |
Get user data for the contact with given index.
index | [in] the contact to get user data for. |
ContactDetectorTracking& operator= | ( | const ContactDetectorTracking & | data | ) |
Assign data from other container to this container.
data | [in] the data to copy. |
void remove | ( | std::size_t | index | ) |
Remove meta-data for a specific contact.
index | [in] the contact to remove. |
void setUserData | ( | const std::vector< ContactStrategyTracking::UserData::Ptr > & | data | ) |
Set user data for all contacts.
data | [in] list of pointers to data. |
void setUserData | ( | std::size_t | index, |
ContactStrategyTracking::UserData::Ptr | data | ||
) |
Attach user data to a given contact.
index | [in] the contact to set user data for. |
data | [in] a pointer to the data. |