class CtrlMapper
Trivial utility class for mapping values to widgets and back. It is sort of similar to CtrlRetriever, but does immediate transfer of values based on flag
template <class T> CtrlMapper& operator()(Ctrl& ctrl, T& val)
Sets value of ctrl to val or val to ctrl based on current direction setting.
template <class T> CtrlMapper& operator()(Ctrl& ctrl, T& val, const T& f)
Similar to two parameter operator(), but before setting val to ctrl, it multiplies it by f and before retrieving, divides by f. Useful as simple conversion tool when e.g. the value is to be stored in meters but edited as kilometers.
CtrlMapper& ToCtrls()
Sets direction flag to move values to widgets.
CtrlMapper& ToValues()
Sets direction flag to move widgets to values
|