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

Public Member Functions | |
| EventSwitch (Condition *onCondition=0, Condition *offCondition=0, Callback *onAction=0, Callback *offAction=0, Callback *throughAction=0) | |
| void | setOnCondition (Condition *condition) |
| void | setOffCondition (Condition *condition) |
| Condition * | getOnCondition () const |
| Condition * | getOffCondition () const |
| void | setOnAction (Callback *onAction) |
| void | setOffAction (Callback *offAction) |
| void | setThroughAction (Callback *throughAction) |
| Callback * | getOnAction () const |
| Callback * | getOffAction () const |
| Callback * | getThroughAction () const |
| bool | isOn () const |
| Event * | currentEvent () const |
| void | nextRedraw (int flag) |
| virtual BehaviorNode::InvalidationHint | handle (Event *) |
| VRS_TYPEINFO (EventSwitch, MonoBehavior) | |
| VRS::EventSwitch::EventSwitch | ( | Condition * | onCondition = 0, |
|
| Condition * | offCondition = 0, |
|||
| Callback * | onAction = 0, |
|||
| Callback * | offAction = 0, |
|||
| Callback * | throughAction = 0 | |||
| ) |
An `EventSwitch' node turn on or off the event handling for its body. It turns the event handling on if it receives an event which satisfies the on condition. It turns the event handling off, it is receives an event which satisfies the off condition. When it is turned on, all events are passed on to the body. Additionally, three actions can be installed, one for turning the event handling on, one for turning the event handling off, and one whenever an event is passed on to the body.
| void VRS::EventSwitch::setOnCondition | ( | Condition * | condition | ) | [inline] |
| void VRS::EventSwitch::setOffCondition | ( | Condition * | condition | ) | [inline] |
| Condition * VRS::EventSwitch::getOnCondition | ( | ) | const [inline] |
| Condition * VRS::EventSwitch::getOffCondition | ( | ) | const [inline] |
The on condition specifies when an event turns on the event handling for the body. If no on condition is specified, the event handling will never be turned on. The off-condition specifies when an event turns off the event handling for the body. If no off-condition is specified, the event handling will never be turned off.
| void VRS::EventSwitch::setOnAction | ( | Callback * | onAction | ) | [inline] |
| void VRS::EventSwitch::setOffAction | ( | Callback * | offAction | ) | [inline] |
| void VRS::EventSwitch::setThroughAction | ( | Callback * | throughAction | ) | [inline] |
| Callback * VRS::EventSwitch::getOnAction | ( | ) | const [inline] |
| Callback * VRS::EventSwitch::getOffAction | ( | ) | const [inline] |
| Callback * VRS::EventSwitch::getThroughAction | ( | ) | const [inline] |
The on action is execute (if any) after an event has been received for which the on-condition is satisfied. This current event can be inquired by `currentEvent'. The off action is execute (if any) after an event has been received for which the off-condition is satisfied. This current event can be inquired by `currentEvent'. The through action (if any) is executed if the event handling has been turned on for the body. All three actions can set explicitly which redraw code should be returned by `currentRedraw'.
| bool VRS::EventSwitch::isOn | ( | ) | const [inline] |
| Event * VRS::EventSwitch::currentEvent | ( | ) | const [inline] |
| void VRS::EventSwitch::nextRedraw | ( | int | flag | ) | [inline] |
`isOn' reports whether the event handling for the body is currently turned on or off. `currentEvent' returns the current event which has passed one of the conditions or which will be delegated to the body. `currentRedraw' set the redraw code for the actual call of `handle'.
| virtual BehaviorNode::InvalidationHint VRS::EventSwitch::handle | ( | Event * | e | ) | [virtual] |
'handle' is forwarded to the body. If no body is specified, nothing is done.
Reimplemented from VRS::MonoBehavior.
| VRS::EventSwitch::VRS_TYPEINFO | ( | EventSwitch | , | |
| MonoBehavior | ||||
| ) |