OMK::Vis::AnimatorEventPlugT< T > Class Template Reference

The plug to retrieve information the handler needs. More...

#include <OMKAnimatorEventPlugT.h>

Inheritance diagram for OMK::Vis::AnimatorEventPlugT< T >:

Inheritance graph
[legend]
Collaboration diagram for OMK::Vis::AnimatorEventPlugT< T >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

Interface of \ref OMK::Vis::AnimatorEventPlug.
virtual void setEvent (const Event *event)
 Sets the associated value.
Interface of \ref OMK::Vis::AnimatorPlugT.
virtual const T & getTypedValue () const
 Returns the typed associated value.
virtual bool isValueChanged () const
 Returns true if the associated value has changed since the last call.

Protected Attributes

_value
 The variable member which stores the value found by the visualisation in the event.

Detailed Description

template<typename T>
class OMK::Vis::AnimatorEventPlugT< T >

The plug to retrieve information the handler needs.

Author:
Benoit Chanclou, Michaël Rouillé, bunraku <bchanclo@irisa.fr> This plug is used to react to an valued event, the animator, owner of this plug, can react to the event to toggle the state of its associated visual object.
The two parameters to create this plug are the id of the event and the name of the sender, see How to create Animators.

Definition at line 44 of file OMKAnimatorEventPlugT.h.


Constructor & Destructor Documentation

template<typename T>
OMK::Vis::AnimatorEventPlugT< T >::AnimatorEventPlugT ( VisBase vis,
const EventIdentifier eventId 
)

Default constructor.

Definition at line 97 of file OMKAnimatorEventPlugT.h.

00097                                                                                         : 
00098         AnimatorPlugT<T>(),
00099         IAnimatorEventPlug( vis, eventId ), 
00100         _value() // default value
00101 {
00102 }

template<typename T>
OMK::Vis::AnimatorEventPlugT< T >::~AnimatorEventPlugT (  )  [virtual]

Destructor.

Definition at line 108 of file OMKAnimatorEventPlugT.h.

00109 {
00110 }

template<typename T>
OMK::Vis::AnimatorEventPlugT< T >::AnimatorEventPlugT ( VisBase vis,
const EventIdentifier eventId 
)

Default constructor.

Definition at line 97 of file OMKAnimatorEventPlugT.h.

00097                                                                                         : 
00098         AnimatorPlugT<T>(),
00099         IAnimatorEventPlug( vis, eventId ), 
00100         _value() // default value
00101 {
00102 }

template<typename T>
OMK::Vis::AnimatorEventPlugT< T >::~AnimatorEventPlugT (  )  [virtual]

Destructor.

Definition at line 108 of file OMKAnimatorEventPlugT.h.

00109 {
00110 }


Member Function Documentation

template<typename T>
void OMK::Vis::AnimatorEventPlugT< T >::setEvent ( const Event event  )  [virtual]

Sets the associated value.

Called by the visualisation OMK::Vis::VisBase to set the value when the event is recieved.
Stores the value in the variable member _value.

Reimplemented from OMK::Vis::IAnimatorEventPlug.

Definition at line 117 of file OMKAnimatorEventPlugT.h.

References OMK::Vis::IAnimatorEventPlug::_updatedValue, OMK::Vis::AnimatorEventPlugT< T >::_value, OMASSERT, and OMK::ValuedEvent< UserType >::value.

00118 { 
00119         const ValuedEvent< T >* valuedEvent = dynamic_cast< const ValuedEvent< T >* >( event ) ;
00120         OMASSERT( valuedEvent && "Bad type cast for the event" ) ;
00121         // Copy the value
00122         _value = valuedEvent->value ;
00123         _updatedValue = true ; 
00124 }

template<typename T>
const T & OMK::Vis::AnimatorEventPlugT< T >::getTypedValue (  )  const [virtual]

Returns the typed associated value.

Returns:
A constant pointer to the typed associated value retrieved in the valued event.
Called by sons of OMK::Vis::Animator to retrieve the value.

Implements OMK::Vis::AnimatorPlugT< T >.

Definition at line 131 of file OMKAnimatorEventPlugT.h.

References OMK::Vis::AnimatorEventPlugT< T >::_value.

00132 {
00133         return _value ;
00134 }

template<typename T>
virtual bool OMK::Vis::AnimatorEventPlugT< T >::isValueChanged (  )  const [inline, virtual]

Returns true if the associated value has changed since the last call.

Returns true if the value has changed.

Implements OMK::Vis::AnimatorPlug.

Definition at line 78 of file OMKAnimatorEventPlugT.h.

References OMK::Vis::IAnimatorEventPlug::_updatedValue.

00079   { 
00080           bool tmp = _updatedValue ; 
00081           _updatedValue = false ;
00082           return tmp ;
00083   }


Member Data Documentation

template<typename T>
T OMK::Vis::AnimatorEventPlugT< T >::_value [protected]

The variable member which stores the value found by the visualisation in the event.

Definition at line 90 of file OMKAnimatorEventPlugT.h.

Referenced by OMK::Vis::AnimatorEventPlugT< T >::getTypedValue(), and OMK::Vis::AnimatorEventPlugT< T >::setEvent().


logo OpenMask

Documentation generated on Mon Jun 9 11:46:05 2008

Generated with doxygen by Dimitri van Heesch ,   1997-2007