| VRS - The Virtual Rendering System |
| version 3.3 |
#include <vrs/sg/timect.h>

Public Types | |
| enum | SyncMode { SM_DoNothing, SM_Restore, SM_LastMode } |
| typedef void(R::* | SetMethod )(S) |
| typedef T(R::* | GetMethod )() const |
Public Member Functions | |
| VRS_SERIALIZABLE_CLASS_ENUM (SyncMode) | |
| TimeCt (R *object, SetMethod setM, GetMethod getM, TimeMap< T > *timeMap, SyncMode mode=SM_DoNothing) | |
| void | setObject (R *obj, SetMethod setM, GetMethod getM) |
| R * | getObject () const |
| void | setMap (TimeMap< T > *timeMap) |
| TimeMap< T > * | getMap () const |
| void | setDeactivateMode (SyncMode mode) |
| SyncMode | getDeactivateMode () const |
| virtual void | activate (int hint=BehaviorNode::NoHint) |
| virtual void | deactivate (int hint=BehaviorNode::NoHint) |
| virtual BehaviorNode::InvalidationHint | handle (Event *e) |
| VRS_TYPEINFO (TimeCt, LeafBehavior) | |
| typedef void(R::* VRS::TimeCt< R, S, T >::SetMethod)(S) |
| typedef T(R::* VRS::TimeCt< R, S, T >::GetMethod)() const |
| enum VRS::TimeCt::SyncMode |
| VRS::TimeCt< R, S, T >::TimeCt | ( | R * | object, | |
| SetMethod | setM, | |||
| GetMethod | getM, | |||
| TimeMap< T > * | timeMap, | |||
| SyncMode | mode = SM_DoNothing | |||
| ) |
An `TimeCt' node applies a time-dependent mapping to an attribute of a shared object. The attribute is accessed by a set-method
and a get-method
Most VRS shapes and attributes conform to these conventions.
There are three template parameters:
Examples: To constrain the outer radius of an `Torus' object, we would declare the constraint by
because the outer radius is of type `double' and the set-method is defined as `TorussetOuterRadius(double)'.
To constrain the center of an `Sphere' we would declare the constraint by
because the center is of type 'Vector' and the set-method is defined as `SpheresetCenter(const Vector&)'.
| VRS::TimeCt< R, S, T >::VRS_SERIALIZABLE_CLASS_ENUM | ( | SyncMode | ) |
| void VRS::TimeCt< R, S, T >::setObject | ( | R * | obj, | |
| SetMethod | setM, | |||
| GetMethod | getM | |||
| ) |
| R* VRS::TimeCt< R, S, T >::getObject | ( | ) | const |
Sets/gets the object to be constrained. If no object is given, the constraint has no effect.
| void VRS::TimeCt< R, S, T >::setMap | ( | TimeMap< T > * | timeMap | ) |
| TimeMap<T>* VRS::TimeCt< R, S, T >::getMap | ( | ) | const |
Sets/gets the mapping applied to the attribute. It must be possible to convert the parameter type T to a value of type S. Normally S is equivalent to T. Sometimes, S differs slightly because the set-method expects a parameter of type `const T&'. This is why `TimeCt' needs S and T.
| void VRS::TimeCt< R, S, T >::setDeactivateMode | ( | SyncMode | mode | ) |
| SyncMode VRS::TimeCt< R, S, T >::getDeactivateMode | ( | ) | const |
If the constraint is deactivated, the constraint node can either restore the original value, or just do nothing.
| virtual void VRS::TimeCt< R, S, T >::activate | ( | int | hint = BehaviorNode::NoHint |
) | [virtual] |
Reimplemented from VRS::BehaviorNode.
| virtual void VRS::TimeCt< R, S, T >::deactivate | ( | int | hint = BehaviorNode::NoHint |
) | [virtual] |
`activate' inquires the current value of the attribute if the deactivation mode is set to `Restore'. `deactivate' restores this original value in that case.
Reimplemented from VRS::BehaviorNode.
| virtual BehaviorNode::InvalidationHint VRS::TimeCt< R, S, T >::handle | ( | Event * | e | ) | [virtual] |
A constraint node can handle `TimeEvent's. `handle' evaluates time events if the node is activated. Other event types are ignored. If a time event is received, it calls the mapping for the moment of the time event. The result of the mapping is used as argument to the set-method in order to configure the constrained object.
Implements VRS::BehaviorNode.
| VRS::TimeCt< R, S, T >::VRS_TYPEINFO | ( | TimeCt< R, S, T > | , | |
| LeafBehavior | ||||
| ) |