fbxperipheral.h 3.4 KB

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