OMKOgreAnimatorT.h

Go to the documentation of this file.
00001 /************************************************************************/
00002 /* This file is part of openMask(c) INRIA, CNRS, Universite de Rennes 1 */
00003 /* 1993-2002, thereinafter the Software                                 */
00004 /*                                                                      */
00005 /* The Software has been developped within the Siames Project.          */
00006 /* INRIA, the University of Rennes 1 and CNRS jointly hold intellectual */
00007 /* property rights                                                      */
00008 /*                                                                      */
00009 /* The Software has been registered with the Agence pour la Protection  */
00010 /* des Programmes (APP) under registration number                       */
00011 /* IDDN.FR.001.510008.00.S.P.2001.000.41200                             */
00012 /*                                                                      */
00013 /* This file may be distributed under the terms of the Q Public License */
00014 /* version 1.0 as defined by Trolltech AS of Norway and appearing in    */
00015 /* the file LICENSE.QPL included in the packaging of this file.         */
00016 /*                                                                      */
00017 /* Licensees holding valid specific licenses issued by INRIA, CNRS or   */
00018 /* Universite Rennes 1 for the software may use this file in            */
00019 /* acordance with that specific license                                 */
00020 /************************************************************************/
00021 #ifndef OMK_VIS_OGREANIMATORT_H
00022 #define OMK_VIS_OGREANIMATORT_H
00023 
00024 #include "OMKAnimatorT.h"
00025 #include "OMKOgreObject.h"
00026 #include "OMKParametersAccessor.inl"
00027 
00028 namespace OMK  
00029 {
00030         namespace Vis 
00031         {
00032 class OgreVis ;
00033 
00034 //=========================================================================
00043 class OMKVIS_API OgreAnimatorCommon
00044 {
00045 public:
00046 
00048   virtual ~OgreAnimatorCommon() {}
00049 
00051   const OgreObject& getOgreObject() const { return _ogreObject ; }
00052 
00054         const std::string& getNodeName() const { return _nodeName ; }
00055 
00056 protected:
00057 
00059         OgreAnimatorCommon( VisualObject& visualObject, 
00060                       const std::string& nodeName ) :
00061     _ogreObject( static_cast< const OgreObject& >( visualObject ) ),
00062     _nodeName( nodeName ), 
00063     _node ( 0 ) 
00064   {
00065   }
00066 
00068   OgreAnimatorCommon( VisualObject& visualObject, 
00069                       const ConfigurationParameterDescriptor& node ) :
00070     _ogreObject( static_cast< const OgreObject& >( visualObject ) ),
00071     _nodeName(),
00072     _node( 0 )
00073   {
00074     if( !ParametersAccessor::get( &node, "NodeName", _nodeName ) )
00075       OMTRACEID( OMK_DEBUG_VIS, ">>> :-| no node name provided for the animator" ) ; 
00076   }
00077 
00079         Ogre::Node& getNode() const { return *_node ; }
00080 
00081 protected:
00083  void findOgreNode( Animator* animator, void*& tNode ) ;
00084 
00086         const OgreObject& _ogreObject ;
00087 
00089         std::string _nodeName ;
00090 
00092         Ogre::Node* _node ;
00093 } ;
00094 //=========================================================================
00095 
00096 //=========================================================================
00097 OMKVIS_API class OgreAnimator : public Animator, public OgreAnimatorCommon
00098 {
00099 public:
00100 
00102         virtual ~OgreAnimator() ;
00103 protected:
00104 
00106         OgreAnimator( VisualObject& visualObject, 
00107                        const Name& id,
00108                        const std::string& nodeName,
00109                        AnimatorPlug* plugUpdate ) 
00110   : Animator( visualObject, id ),
00111     OgreAnimatorCommon( visualObject, nodeName )
00112   {
00113     _plugUpdate = plugUpdate ;
00114           findOgreNode( this, _tNode ) ;
00115   }
00116 
00118         OgreAnimator( VisualObject& visualObject, 
00119                        const Name& id, 
00120                        const ConfigurationParameterDescriptor& node ) 
00121   : Animator( visualObject, id, node ),
00122     OgreAnimatorCommon( visualObject, node )
00123   {
00124           findOgreNode( this, _tNode ) ;
00125   }
00126 } ;
00127 //=========================================================================
00128 
00129 
00130 //=========================================================================
00138 template < typename T >
00139 class OgreAnimatorT : public AnimatorT< T >, public OgreAnimatorCommon
00140 {
00141 public:
00142 
00144   virtual ~OgreAnimatorT() {}
00145 protected:
00146 
00148         OgreAnimatorT( VisualObject& visualObject, 
00149                        const Name& id,
00150                        const std::string& nodeName,
00151                        AnimatorPlugT< T >* plugValue )
00152   : AnimatorT<T>( visualObject, id, plugValue ),
00153     OgreAnimatorCommon( visualObject, nodeName )
00154   {
00155           findOgreNode( this, _tNode ) ;
00156   }
00157 
00159         OgreAnimatorT( VisualObject& visualObject, 
00160                        const Name& id, 
00161                        const ConfigurationParameterDescriptor& node ) 
00162   : AnimatorT<T>( visualObject, id, node ),
00163     OgreAnimatorCommon( visualObject, node )
00164   {
00165           findOgreNode( this, _tNode ) ;
00166   }
00167 private:
00168         using Animator::_tNode;
00169 } ;
00170 //=========================================================================
00171 
00172 //=========================================================================
00174 extern OMKVIS_API Ogre::Node* getOgreNode( const Ogre::Node& rootNode, const std::string& nodeName ) ;
00176 extern OMKVIS_API Ogre::Node* getChildWithDelimiterOMK(const Ogre::Node& node, const std::string& name)  ;
00178 extern OMKVIS_API std::string getNameWithoutDelimiterOMK( const std::string& name);
00179 //=========================================================================
00180         }// namespace Vis
00181 }// namespace OMK
00182 
00183 #endif // OMK_VIS_OMKOgreOMKAnimatorT_H

logo OpenMask

Documentation generated on Mon Jun 9 11:45:57 2008

Generated with doxygen by Dimitri van Heesch ,   1997-2007