aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/others/irrlicht-1.8.1/include/ISceneNodeFactory.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/others/irrlicht-1.8.1/include/ISceneNodeFactory.h')
-rw-r--r--src/others/irrlicht-1.8.1/include/ISceneNodeFactory.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/others/irrlicht-1.8.1/include/ISceneNodeFactory.h b/src/others/irrlicht-1.8.1/include/ISceneNodeFactory.h
new file mode 100644
index 0000000..5359d2b
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/include/ISceneNodeFactory.h
@@ -0,0 +1,68 @@
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 __I_SCENE_NODE_FACTORY_H_INCLUDED__
6#define __I_SCENE_NODE_FACTORY_H_INCLUDED__
7
8#include "IReferenceCounted.h"
9#include "ESceneNodeTypes.h"
10
11namespace irr
12{
13
14namespace scene
15{
16 class ISceneNode;
17
18 //! Interface for dynamic creation of scene nodes
19 /** To be able to add custom scene nodes to Irrlicht and to make it possible for the
20 scene manager to save and load those external scene nodes, simply implement this
21 interface and register it in you scene manager via ISceneManager::registerSceneNodeFactory.
22 Note: When implementing your own scene node factory, don't call ISceneNodeManager::grab() to
23 increase the reference counter of the scene node manager. This is not necessary because the
24 scene node manager will grab() the factory anyway, and otherwise cyclic references will
25 be created and the scene manager and all its nodes won't get deallocated.
26 */
27 class ISceneNodeFactory : public virtual IReferenceCounted
28 {
29 public:
30 //! adds a scene node to the scene graph based on its type id
31 /** \param type: Type of the scene node to add.
32 \param parent: Parent scene node of the new node, can be null to add the scene node to the root.
33 \return Returns pointer to the new scene node or null if not successful.
34 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
35 virtual ISceneNode* addSceneNode(ESCENE_NODE_TYPE type, ISceneNode* parent=0) = 0;
36
37 //! adds a scene node to the scene graph based on its type name
38 /** \param typeName: Type name of the scene node to add.
39 \param parent: Parent scene node of the new node, can be null to add the scene node to the root.
40 \return Returns pointer to the new scene node or null if not successful.
41 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
42 virtual ISceneNode* addSceneNode(const c8* typeName, ISceneNode* parent=0) = 0;
43
44 //! returns amount of scene node types this factory is able to create
45 virtual u32 getCreatableSceneNodeTypeCount() const = 0;
46
47 //! returns type of a createable scene node type
48 /** \param idx: Index of scene node type in this factory. Must be a value between 0 and
49 getCreatableSceneNodeTypeCount() */
50 virtual ESCENE_NODE_TYPE getCreateableSceneNodeType(u32 idx) const = 0;
51
52 //! returns type name of a createable scene node type by index
53 /** \param idx: Index of scene node type in this factory. Must be a value between 0 and
54 getCreatableSceneNodeTypeCount() */
55 virtual const c8* getCreateableSceneNodeTypeName(u32 idx) const = 0;
56
57 //! returns type name of a createable scene node type
58 /** \param type: Type of scene node.
59 \return: Returns name of scene node type if this factory can create the type, otherwise 0. */
60 virtual const c8* getCreateableSceneNodeTypeName(ESCENE_NODE_TYPE type) const = 0;
61 };
62
63
64} // end namespace scene
65} // end namespace irr
66
67#endif
68