version 3.3

VRS::EventSwitch Class Reference

Event On/Off Switch Behavior Node. More...

#include <vrs/sg/eventswitch.h>

Inheritance diagram for VRS::EventSwitch:

VRS::MonoBehavior VRS::BehaviorNode VRS::SharedObj VRS::Visitable

List of all members.

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)
ConditiongetOnCondition () const
ConditiongetOffCondition () const
void setOnAction (Callback *onAction)
void setOffAction (Callback *offAction)
void setThroughAction (Callback *throughAction)
CallbackgetOnAction () const
CallbackgetOffAction () const
CallbackgetThroughAction () const
bool isOn () const
EventcurrentEvent () const
void nextRedraw (int flag)
virtual
BehaviorNode::InvalidationHint 
handle (Event *)
 VRS_TYPEINFO (EventSwitch, MonoBehavior)


Detailed Description

Event On/Off Switch Behavior Node.

Constructor & Destructor Documentation

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.


Member Function Documentation

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   
)


The documentation for this class was generated from the following file:

Generated on Tue May 21 06:00:31 2013 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact