version 3.3

VRS::BehaviorCallback Class Reference

Callback Behavior Node. More...

#include <vrs/sg/behaviorcallback.h>

Inheritance diagram for VRS::BehaviorCallback:

VRS::LeafBehavior VRS::BehaviorNode VRS::SharedObj VRS::Visitable

List of all members.

Public Member Functions

 BehaviorCallback (Callback *activate=0, Callback *deactivate=0, Callback *handleTimeEvent=0, Callback *handleCanvasEvent=0, Callback *handleSpaceMouseEvent=0)
void setActivateCallback (Callback *action)
void setDeactivateCallback (Callback *action)
void setTimeCallback (Callback *action)
void setCanvasCallback (Callback *action)
void setSpaceMouseCallback (Callback *action)
CallbackgetActivateCallback () const
CallbackgetDeactivateCallback () const
CallbackgetTimeCallback () const
CallbackgetCanvasCallback () const
CallbackgetSpaceMouseCallback () const
 Set/get the action objects.
TimeEventcurrentTimeEvent ()
CanvasEventcurrentCanvasEvent ()
SpaceMouseEventcurrentSpaceMouseEvent ()
void nextRedraw (int redrawCode)
virtual void activate (int hint=BehaviorNode::NoHint)
virtual void deactivate (int hint=BehaviorNode::NoHint)
 Execute the activate/deactivate action, if any.
virtual
BehaviorNode::InvalidationHint 
handle (Event *e)
 VRS_TYPEINFO (BehaviorCallback, LeafBehavior)


Detailed Description

Callback Behavior Node.

Constructor & Destructor Documentation

VRS::BehaviorCallback::BehaviorCallback ( Callback activate = 0,
Callback deactivate = 0,
Callback handleTimeEvent = 0,
Callback handleCanvasEvent = 0,
Callback handleSpaceMouseEvent = 0 
)

An `BehaviorCallback' node associates action objects with the activate method, deactivate method, time events, and canvas events of a behavior leaf node. Each action is optional. If set, the action is executed if its corresponding method gets invoked. An action associated with a behavior callback can inquire the current event and can set the next redraw flag explicitly.


Member Function Documentation

void VRS::BehaviorCallback::setActivateCallback ( Callback action  ) 

void VRS::BehaviorCallback::setDeactivateCallback ( Callback action  ) 

void VRS::BehaviorCallback::setTimeCallback ( Callback action  ) 

void VRS::BehaviorCallback::setCanvasCallback ( Callback action  ) 

void VRS::BehaviorCallback::setSpaceMouseCallback ( Callback action  ) 

Callback * VRS::BehaviorCallback::getActivateCallback (  )  const [inline]

Callback * VRS::BehaviorCallback::getDeactivateCallback (  )  const [inline]

Callback * VRS::BehaviorCallback::getTimeCallback (  )  const [inline]

Callback * VRS::BehaviorCallback::getCanvasCallback (  )  const [inline]

Callback * VRS::BehaviorCallback::getSpaceMouseCallback (  )  const [inline]

Set/get the action objects.

TimeEvent * VRS::BehaviorCallback::currentTimeEvent (  )  [inline]

CanvasEvent * VRS::BehaviorCallback::currentCanvasEvent (  )  [inline]

SpaceMouseEvent * VRS::BehaviorCallback::currentSpaceMouseEvent (  )  [inline]

void VRS::BehaviorCallback::nextRedraw ( int  redrawCode  )  [inline]

`timeEvent' returns the current time event which has been responsible for executing the time action. `canvasEvent' returns the current canvas event which has been responsible for executing the canvas action. `spaceMouseEvent' returns the current spacemouse event which has been responsible for executing the spacemouse action. All three methods return NULL if no appropriate event has been received, or if the methods are called while no action is executed; i.e., the method should only be called by the execute method of an associated action. `nextRedraw' sets the redraw code used in the `handle' method. By default, it is set to `RedrawNothing'.

virtual void VRS::BehaviorCallback::activate ( int  hint = BehaviorNode::NoHint  )  [virtual]

Reimplemented from VRS::BehaviorNode.

virtual void VRS::BehaviorCallback::deactivate ( int  hint = BehaviorNode::NoHint  )  [virtual]

Execute the activate/deactivate action, if any.

Reimplemented from VRS::BehaviorNode.

virtual BehaviorNode::InvalidationHint VRS::BehaviorCallback::handle ( Event e  )  [virtual]

A behavior callback can handle time events and canvas events. `handle' checks for time and canvas events, and calls the associated time action or canvas action. No events are processed if the node is deactivated.

Implements VRS::BehaviorNode.

VRS::BehaviorCallback::VRS_TYPEINFO ( BehaviorCallback  ,
LeafBehavior   
)


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

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