#include <DataTracker.h>
Tracking Data mechanism to be able to check when selected Data changed since their last clean.
The Data must be added to tracking system by calling "trackData". Then it can be checked if it changed with "hasChanged" since its last "clean".
Use datatrackers to check if your data have changed! Do not use BaseData's "isDirty()" method, as it has a completely different purpose: BaseData::isDirty() checks whether or not the data is up-to-date with its parent values while DataTracker::hasChanged(myData) checks whether the data has been modified since it has last been checked
Protected Attributes | |
DataTrackers | m_dataTrackers |
Public Member Functions | |
void | trackData (const objectmodel::BaseData &data) |
bool | hasChanged (const objectmodel::BaseData &data) const |
bool | hasChanged () const |
Did one of the tracked data change since the last call to clean()? More... | |
void | clean (const objectmodel::BaseData &data) |
void | clean () |
comparison point is cleaned for all tracked Data More... | |
const std::map< const objectmodel::BaseData *, int > & | getMapTrackedData () |
Provide the map of tracked Data. More... | |
|
protected |
void sofa::core::DataTracker::clean | ( | ) |
comparison point is cleaned for all tracked Data
void sofa::core::DataTracker::clean | ( | const objectmodel::BaseData & | data | ) |
comparison point is cleaned for the specified tracked Data
|
inline |
Provide the map of tracked Data.
bool sofa::core::DataTracker::hasChanged | ( | ) | const |
Did one of the tracked data change since the last call to clean()?
bool sofa::core::DataTracker::hasChanged | ( | const objectmodel::BaseData & | data | ) | const |
void sofa::core::DataTracker::trackData | ( | const objectmodel::BaseData & | data | ) |
select a Data to track to be able to check if it was dirtied since the previous clean.