diff options
Diffstat (limited to 'libraries/irrlicht-1.8.1/source/Irrlicht/CDefaultSceneNodeFactory.h')
-rw-r--r-- | libraries/irrlicht-1.8.1/source/Irrlicht/CDefaultSceneNodeFactory.h | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/libraries/irrlicht-1.8.1/source/Irrlicht/CDefaultSceneNodeFactory.h b/libraries/irrlicht-1.8.1/source/Irrlicht/CDefaultSceneNodeFactory.h new file mode 100644 index 0000000..5ed2036 --- /dev/null +++ b/libraries/irrlicht-1.8.1/source/Irrlicht/CDefaultSceneNodeFactory.h | |||
@@ -0,0 +1,80 @@ | |||
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 | |||
5 | #ifndef __C_DEFAULT_SCENE_NODE_FACTORY_H_INCLUDED__ | ||
6 | #define __C_DEFAULT_SCENE_NODE_FACTORY_H_INCLUDED__ | ||
7 | |||
8 | #include "ISceneNodeFactory.h" | ||
9 | #include "irrArray.h" | ||
10 | #include "irrString.h" | ||
11 | |||
12 | namespace irr | ||
13 | { | ||
14 | namespace scene | ||
15 | { | ||
16 | class ISceneNode; | ||
17 | class ISceneManager; | ||
18 | |||
19 | //! Interface making it possible to dynamicly create scene nodes and animators | ||
20 | class CDefaultSceneNodeFactory : public ISceneNodeFactory | ||
21 | { | ||
22 | public: | ||
23 | |||
24 | CDefaultSceneNodeFactory(ISceneManager* mgr); | ||
25 | |||
26 | //! adds a scene node to the scene graph based on its type id | ||
27 | /** \param type: Type of the scene node to add. | ||
28 | \param parent: Parent scene node of the new node, can be null to add the scene node to the root. | ||
29 | \return Returns pointer to the new scene node or null if not successful. */ | ||
30 | virtual ISceneNode* addSceneNode(ESCENE_NODE_TYPE type, ISceneNode* parent=0); | ||
31 | |||
32 | //! adds a scene node to the scene graph based on its type name | ||
33 | /** \param typeName: Type name of the scene node to add. | ||
34 | \param parent: Parent scene node of the new node, can be null to add the scene node to the root. | ||
35 | \return Returns pointer to the new scene node or null if not successful. */ | ||
36 | virtual ISceneNode* addSceneNode(const c8* typeName, ISceneNode* parent=0); | ||
37 | |||
38 | //! returns amount of scene node types this factory is able to create | ||
39 | virtual u32 getCreatableSceneNodeTypeCount() const; | ||
40 | |||
41 | //! returns type name of a createable scene node type by index | ||
42 | /** \param idx: Index of scene node type in this factory. Must be a value between 0 and | ||
43 | uetCreatableSceneNodeTypeCount() */ | ||
44 | virtual const c8* getCreateableSceneNodeTypeName(u32 idx) const; | ||
45 | |||
46 | //! returns type of a createable scene node type | ||
47 | /** \param idx: Index of scene node type in this factory. Must be a value between 0 and | ||
48 | getCreatableSceneNodeTypeCount() */ | ||
49 | virtual ESCENE_NODE_TYPE getCreateableSceneNodeType(u32 idx) const; | ||
50 | |||
51 | //! returns type name of a createable scene node type | ||
52 | /** \param idx: Type of scene node. | ||
53 | \return: Returns name of scene node type if this factory can create the type, otherwise 0. */ | ||
54 | virtual const c8* getCreateableSceneNodeTypeName(ESCENE_NODE_TYPE type) const; | ||
55 | |||
56 | private: | ||
57 | |||
58 | ESCENE_NODE_TYPE getTypeFromName(const c8* name) const; | ||
59 | |||
60 | struct SSceneNodeTypePair | ||
61 | { | ||
62 | SSceneNodeTypePair(ESCENE_NODE_TYPE type, const c8* name) | ||
63 | : Type(type), TypeName(name) | ||
64 | {} | ||
65 | |||
66 | ESCENE_NODE_TYPE Type; | ||
67 | core::stringc TypeName; | ||
68 | }; | ||
69 | |||
70 | core::array<SSceneNodeTypePair> SupportedSceneNodeTypes; | ||
71 | |||
72 | ISceneManager* Manager; | ||
73 | }; | ||
74 | |||
75 | |||
76 | } // end namespace scene | ||
77 | } // end namespace irr | ||
78 | |||
79 | #endif | ||
80 | |||