aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/irrlicht-1.8.1/include/ISceneUserDataSerializer.h
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/irrlicht-1.8.1/include/ISceneUserDataSerializer.h')
-rw-r--r--libraries/irrlicht-1.8.1/include/ISceneUserDataSerializer.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/libraries/irrlicht-1.8.1/include/ISceneUserDataSerializer.h b/libraries/irrlicht-1.8.1/include/ISceneUserDataSerializer.h
new file mode 100644
index 0000000..309443b
--- /dev/null
+++ b/libraries/irrlicht-1.8.1/include/ISceneUserDataSerializer.h
@@ -0,0 +1,51 @@
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_USER_DATA_SERIALIZER_H_INCLUDED__
6#define __I_SCENE_USER_DATA_SERIALIZER_H_INCLUDED__
7
8#include "IReferenceCounted.h"
9
10namespace irr
11{
12namespace io
13{
14 class IAttributes;
15} // end namespace io
16namespace scene
17{
18 class ISceneNode;
19
20//! Interface to read and write user data to and from .irr files.
21/** This interface is to be implemented by the user, to make it possible to read
22and write user data when reading or writing .irr files via ISceneManager.
23To be used with ISceneManager::loadScene() and ISceneManager::saveScene() */
24class ISceneUserDataSerializer
25{
26public:
27
28 virtual ~ISceneUserDataSerializer() {}
29
30 //! Called when the scene manager create a scene node while loading a file.
31 virtual void OnCreateNode(ISceneNode* node) = 0;
32
33 //! Called when the scene manager read a scene node while loading a file.
34 /** The userData pointer contains a list of attributes with userData which
35 were attached to the scene node in the read scene file.*/
36 virtual void OnReadUserData(ISceneNode* forSceneNode, io::IAttributes* userData) = 0;
37
38 //! Called when the scene manager is writing a scene node to an xml file for example.
39 /** Implement this method and return a list of attributes containing the user data
40 you want to be saved together with the scene node. Return 0 if no user data should
41 be added. Please note that the scene manager will call drop() to the returned pointer
42 after it no longer needs it, so if you didn't create a new object for the return value
43 and returning a longer existing IAttributes object, simply call grab() before returning it. */
44 virtual io::IAttributes* createUserData(ISceneNode* forSceneNode) = 0;
45};
46
47} // end namespace scene
48} // end namespace irr
49
50#endif
51