1 | /**************************************************************************************** |
2 | |
3 | Copyright (C) 2015 Autodesk, Inc. |
4 | All rights reserved. |
5 | |
6 | Use of this software is subject to the terms of the Autodesk license agreement |
7 | provided at the time of installation or download, or which otherwise accompanies |
8 | this software in either electronic or hard copy form. |
9 | |
10 | ****************************************************************************************/ |
11 | |
12 | //! \file fbxperipheral.h |
13 | #ifndef _FBXSDK_CORE_PERIPHERAL_H_ |
14 | #define _FBXSDK_CORE_PERIPHERAL_H_ |
15 | |
16 | #include <fbxsdk/fbxsdk_def.h> |
17 | |
18 | #include <fbxsdk/fbxsdk_nsbegin.h> |
19 | |
20 | class FbxObject; |
21 | |
22 | /** FbxPeripheral is an interface to load/unload content of FbxObject from memory to |
23 | somewhere you defined, for example, to a temporary file on disk . |
24 | * \nosubgrouping |
25 | * You need to inherited your own peripheral class from this class and overload |
26 | * the functions to control what information of a FbxObject you want to load/unload, |
27 | * and where you are going to load/unload these information to. |
28 | * For example, you can ask an object to dump itself on disk to free some memory and vice-versa |
29 | * when you want to load/unload this object from your scene flexibly. |
30 | */ |
31 | class FBXSDK_DLL FbxPeripheral |
32 | { |
33 | public: |
34 | /** |
35 | * \name Constructor and Destructor |
36 | */ |
37 | //@{ |
38 | |
39 | //!Constructor. |
40 | FbxPeripheral(); |
41 | |
42 | //!Destructor. |
43 | virtual ~FbxPeripheral(); |
44 | //@} |
45 | |
46 | /** Reset the peripheral to its initial state. |
47 | */ |
48 | virtual void Reset() = 0; |
49 | |
50 | /** Unload the content of pObject. |
51 | * \param pObject Object whose content is to be offloaded into |
52 | * the peripheral storage area. |
53 | * \return \c true if the object content has been successfully transferred. |
54 | * \c false otherwise. |
55 | */ |
56 | virtual bool UnloadContentOf(FbxObject* pObject) = 0; |
57 | |
58 | /** Load the content of pObject. |
59 | * \param pObject Object whose content is to be loaded from |
60 | * the peripheral storage area. |
61 | * \return \c true if the object content has been successfully transferred. |
62 | * \c false otherwise. |
63 | */ |
64 | virtual bool LoadContentOf(FbxObject* pObject) = 0; |
65 | |
66 | /** Check if this peripheral can unload the given object content. |
67 | * \param pObject Object whose content has to be transferred. |
68 | * \return \c true if the peripheral can handle this object content and |
69 | * has enough space in its storage area.\c false otherwise. |
70 | */ |
71 | virtual bool CanUnloadContentOf(FbxObject* pObject) = 0; |
72 | |
73 | /** Check if this peripheral can load the given object content. |
74 | * \param pObject Object whose content has to be transferred. |
75 | * \return \c true if the peripheral can handle this object content. |
76 | * \c false otherwise. |
77 | */ |
78 | virtual bool CanLoadContentOf(FbxObject* pObject) = 0; |
79 | |
80 | /** Initialize the connections of an object |
81 | * \param pObject Object on which the request for connection is done. |
82 | */ |
83 | virtual void InitializeConnectionsOf(FbxObject* pObject) = 0; |
84 | |
85 | /** Uninitialize the connections of an object |
86 | * \param pObject Object on which the request for disconnection is done. |
87 | */ |
88 | virtual void UninitializeConnectionsOf(FbxObject* pObject) = 0; |
89 | }; |
90 | |
91 | // predefined offload peripherals |
92 | extern FBXSDK_DLL FbxPeripheral* NULL_PERIPHERAL; |
93 | extern FBXSDK_DLL FbxPeripheral* TMPFILE_PERIPHERAL; |
94 | #include <fbxsdk/fbxsdk_nsend.h> |
95 | |
96 | #endif /* _FBXSDK_CORE_PERIPHERAL_H_ */ |
97 | |