CDefaultSceneNodeAnimatorFactory.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // Copyright (C) 2002-2012 Nikolaus Gebhardt
  2. // This file is part of the "Irrlicht Engine".
  3. // For conditions of distribution and use, see copyright notice in irrlicht.h
  4. #ifndef __C_DEFAULT_SCENE_NODE_ANIMATOR_FACTORY_H_INCLUDED__
  5. #define __C_DEFAULT_SCENE_NODE_ANIMATOR_FACTORY_H_INCLUDED__
  6. #include "ISceneNodeAnimatorFactory.h"
  7. namespace irr
  8. {
  9. namespace gui
  10. {
  11. class ICursorControl;
  12. }
  13. namespace scene
  14. {
  15. class ISceneNodeAnimator;
  16. class ISceneManager;
  17. //! Interface making it possible to dynamicly create scene nodes animators
  18. class CDefaultSceneNodeAnimatorFactory : public ISceneNodeAnimatorFactory
  19. {
  20. public:
  21. CDefaultSceneNodeAnimatorFactory(ISceneManager* mgr, gui::ICursorControl* crs);
  22. virtual ~CDefaultSceneNodeAnimatorFactory();
  23. //! creates a scene node animator based on its type id
  24. /** \param type: Type of the scene node animator to add.
  25. \param target: Target scene node of the new animator.
  26. \return Returns pointer to the new scene node animator or null if not successful. You need to
  27. drop this pointer after calling this, see IReferenceCounted::drop() for details. */
  28. virtual ISceneNodeAnimator* createSceneNodeAnimator(ESCENE_NODE_ANIMATOR_TYPE type, ISceneNode* target);
  29. //! creates a scene node animator based on its type name
  30. /** \param typeName: Type of the scene node animator to add.
  31. \param target: Target scene node of the new animator.
  32. \return Returns pointer to the new scene node animator or null if not successful. You need to
  33. drop this pointer after calling this, see IReferenceCounted::drop() for details. */
  34. virtual ISceneNodeAnimator* createSceneNodeAnimator(const char* typeName, ISceneNode* target);
  35. //! returns amount of scene node animator types this factory is able to create
  36. virtual u32 getCreatableSceneNodeAnimatorTypeCount() const;
  37. //! returns type of a createable scene node animator type
  38. /** \param idx: Index of scene node animator type in this factory. Must be a value between 0 and
  39. getCreatableSceneNodeTypeCount() */
  40. virtual ESCENE_NODE_ANIMATOR_TYPE getCreateableSceneNodeAnimatorType(u32 idx) const;
  41. //! returns type name of a createable scene node animator type
  42. /** \param idx: Index of scene node animator type in this factory. Must be a value between 0 and
  43. getCreatableSceneNodeAnimatorTypeCount() */
  44. virtual const c8* getCreateableSceneNodeAnimatorTypeName(u32 idx) const;
  45. //! returns type name of a createable scene node animator type
  46. /** \param type: Type of scene node animator.
  47. \return: Returns name of scene node animator type if this factory can create the type, otherwise 0. */
  48. virtual const c8* getCreateableSceneNodeAnimatorTypeName(ESCENE_NODE_ANIMATOR_TYPE type) const;
  49. private:
  50. ESCENE_NODE_ANIMATOR_TYPE getTypeFromName(const c8* name) const;
  51. ISceneManager* Manager;
  52. gui::ICursorControl* CursorControl;
  53. };
  54. } // end namespace scene
  55. } // end namespace irr
  56. #endif