fbxreaderfbx7.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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 fbxreaderfbx7.h
  9. #ifndef _FBXSDK_FILEIO_FBX_READER_FBX7_H_
  10. #define _FBXSDK_FILEIO_FBX_READER_FBX7_H_
  11. #include <fbxsdk.h>
  12. #include <fbxsdk/fbxsdk_nsbegin.h>
  13. struct FbxReaderFbx7_Impl;
  14. /** \brief This class is the FBX v7 reader.
  15. * The reader provide you the ability to read the global settings, objects and animation information from file.
  16. *
  17. */
  18. class FbxReaderFbx7 : public FbxReader
  19. {
  20. public:
  21. /** \enum EImportMode File import mode.
  22. *
  23. */
  24. typedef enum
  25. {
  26. eASCII, /**< Plain text mode */
  27. eBINARY, /**< Binary mode */
  28. eENCRYPTED /**< Encrypted mode */
  29. } EImportMode;
  30. /** Constructor
  31. * \param pManager the FbxManager Object
  32. * \param pImporter the FbxImporter to import the SDK objects
  33. * \param pID id for current reader
  34. * \param pStatus the FbxStatus object to hold error codes
  35. */
  36. FbxReaderFbx7(FbxManager& pManager, FbxImporter& pImporter, int pID, FbxStatus& pStatus);
  37. /** Destructor
  38. *
  39. */
  40. virtual ~FbxReaderFbx7();
  41. /** Open file with certain EFileOpenSpecialFlags
  42. * \param pFileName name of the File to open
  43. * \param pFlags the EFileOpenSpecialFlags to open with
  44. * \return if the file is open successfully return true, otherwise return false
  45. */
  46. virtual bool FileOpen(char* pFileName, EFileOpenSpecialFlags pFlags);
  47. /** Open file with default flag
  48. * \param pFileName name of the File to open
  49. * \return if the file is open successfully return \c true, otherwise return \c false
  50. */
  51. virtual bool FileOpen(char* pFileName);
  52. /** Open file with default flag
  53. */
  54. virtual bool FileOpen(FbxFile* pFile);
  55. /** Open file from stream
  56. */
  57. virtual bool FileOpen(FbxStream * pStream, void* pStreamData);
  58. /** Close the file stream
  59. * \return if the file is closed successfully return \c true, otherwise return \c false
  60. */
  61. virtual bool FileClose();
  62. /** Check whether the file stream is open.
  63. * \return if the file stream is open return \c true, otherwise return \c false.
  64. */
  65. virtual bool IsFileOpen();
  66. /** Get current Import mode
  67. *
  68. */
  69. EImportMode GetImportMode();
  70. /** Get file version
  71. * \param pMajor Major version
  72. * \param pMinor Minor version
  73. * \param pRevision Revision version
  74. */
  75. virtual void GetVersion(int& pMajor, int& pMinor, int& pRevision);
  76. /** Get axis system information from file
  77. * \param pAxisSystem axis system in file
  78. * \param pSystemUnits system unit in file
  79. * \return if either pAxisSystem or pSystemUnits is \c NULL return \c false, otherwise return \c true.
  80. */
  81. virtual bool GetAxisInfo(FbxAxisSystem* pAxisSystem, FbxSystemUnit* pSystemUnits);
  82. /** Get FBX file time mode read from GlobalSettings in FBX 6.n and FBX 7.n
  83. * \param pTimeMode ref to a FbxTime::EMode enum
  84. * \return \c true on success, \c false otherwise.
  85. * \remarks This function must be called after FbxImporter::Initialize().
  86. * Can be used for statistics (via GlobalSettings) before loading the whole scene from the file.
  87. */
  88. virtual bool GetFrameRate(FbxTime::EMode &pTimeMode);
  89. /** Get the statistics from file
  90. * \param pStats statistics in file
  91. * \return if fetching statistics is successfully return \c true, otherwise return \c false.
  92. */
  93. virtual bool GetStatistics(FbxStatistics* pStats);
  94. /** Get the file stream options
  95. * \param pParseFileAsNeeded Whether to parse file as read options
  96. * \return true on success, otherwise return false.
  97. */
  98. virtual bool GetReadOptions(bool pParseFileAsNeeded = true);
  99. /** Read file with stream options
  100. * \param pDocument FbxDocument to store the file data
  101. * \return if fetching statistics is successful return \c true, otherwise return \c false.
  102. */
  103. virtual bool Read(FbxDocument *pDocument);
  104. /** Reads extension plug-ins name, version and parameters, so that we can remember if a plug-in was used during export.
  105. * This is especially useful for extension plug-ins that modify the scene and also to warn users during import if an
  106. * extension plug-in was used that could be missing.
  107. * \param pParams The parameters of the extension plug-in. The properties of the objects are used
  108. * as the parameters of the extension plug-in.
  109. */
  110. virtual void PluginReadParameters(FbxObject& pParams);
  111. /** Get the file options
  112. * \param pFbx file object to read options
  113. * \param pParseFileAsNeeded Whether to parse file as read options
  114. * \return true on success, otherwise return false.
  115. */
  116. virtual bool GetReadOptions(FbxIO* pFbx, bool pParseFileAsNeeded = true);
  117. /** Read file with stream options
  118. * \param pDocument FbxDocument to store the file data
  119. * \param pFbx file object to read from
  120. * \return if reading the file is successful return \c true, otherwise return \c false.
  121. */
  122. virtual bool Read(FbxDocument *pDocument, FbxIO* pFbx);
  123. /** Returns the scene info from the file.
  124. * \return The pointer to file scene info defined by this reader.
  125. */
  126. virtual FbxDocumentInfo* GetSceneInfo();
  127. /** Returns the pointer to the list of TakeInfo from the file.
  128. * \return NULL
  129. */
  130. virtual FbxArray<FbxTakeInfo*>* GetTakeInfo();
  131. /** Pass a progress handler to the reader
  132. * \param pProgress FbxProgress to store the progress information.
  133. */
  134. virtual void SetProgressHandler(FbxProgress *pProgress);
  135. virtual void SetEmbeddingExtractionFolder(const char* pExtractFolder);
  136. virtual bool SupportsStreams() const { return true; }
  137. private:
  138. // Declared, not defined.
  139. FbxReaderFbx7(const FbxReaderFbx7&);
  140. FbxReaderFbx7& operator=(FbxReaderFbx7 const&);
  141. private:
  142. FbxReaderFbx7_Impl* mImpl;
  143. };
  144. #include <fbxsdk/fbxsdk_nsend.h>
  145. #endif /* _FBXSDK_FILEIO_FBX_READER_FBX7_H_ */