00001
00004 #ifndef FBXFILESDK_KFBXIO_KFBXREADER_H
00005 #define FBXFILESDK_KFBXIO_KFBXREADER_H
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #include <fbxfilesdk/fbxfilesdk_def.h>
00042
00043 #include <fbxfilesdk/components/kbaselib/klib/kerror.h>
00044 #include <fbxfilesdk/components/kbaselib/kfbx/kfbx.h>
00045
00046 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00047
00048 class KFbxDocument;
00049 class KFbxDocumentInfo;
00050 class KFbxNode;
00051 class KFbxSdkManager;
00052 class KFbxImporter;
00053 class KFbxIOSettings;
00054 class KFbxAxisSystem;
00055 class KFbxSystemUnit;
00056 class KFbxStatistics;
00057 class KFbxTakeInfo;
00058 class KFile;
00059 class KFbxObject;
00060 class KFbxScene;
00061 class KFbxProgress;
00062
00086 class KFBX_DLL KFbxReader
00087 {
00088 public:
00093 KFbxReader(KFbxSdkManager& pManager, int pID);
00094
00097 virtual ~KFbxReader();
00098
00112 typedef enum
00113 {
00114 eFILE_CORRUPTED,
00115 eFILE_VERSION_NOT_SUPPORTED_YET,
00116 eFILE_VERSION_NOT_SUPPORTED_ANYMORE,
00117 eFILE_NOT_OPENED,
00118 eFILE_NOT_CREATED,
00119 eWRONG_PASSWORD,
00120 eINVALID_DOCUMENT_HANDLE,
00121 eDOCUMENT_NOT_SUPPORTED,
00122 eUNRESOLVED_EXTERNAL_REFERENCES,
00123 eUNIDENTIFIED_ERROR,
00124 eERROR_COUNT
00125 } EError;
00126
00133 enum KInfoRequest {
00134 eInfoExtension,
00135 eInfoDescriptions,
00136 eReserved1 = 0xFBFB,
00137 };
00138
00144 enum EFileOpenSpecialFlags {
00145 ParseForGlobalSettings = 1,
00146 ParseForStatistics = 2
00147 };
00148
00150 typedef KFbxReader* (*CreateFuncType)(KFbxSdkManager& pManager, KFbxImporter& pImporter, int pSubID, int pPluginID);
00151
00153 typedef void (*IOSettingsFillerFuncType)(KFbxIOSettings& pIOS);
00154
00156 typedef void* (*GetInfoFuncType)(KInfoRequest pRequest, int pReaderTypeId);
00157
00163 virtual void GetVersion(int& pMajor, int& pMinor, int& pRevision){ pMajor = pMinor = pRevision = 0; }
00164
00169 virtual bool FileOpen(char* pFileName) = 0;
00170
00175 virtual bool FileOpen(KFile * pFile);
00176
00180 virtual bool FileClose() = 0;
00181
00185 virtual bool IsFileOpen() = 0;
00186
00191 virtual bool GetReadOptions(bool pParseFileAsNeeded = true) = 0;
00192
00197 virtual bool Read(KFbxDocument* pDocument) = 0;
00198
00207 virtual void PluginReadParameters(KFbxObject& pParams);
00208
00214 virtual bool FileOpen(char* pFileName, EFileOpenSpecialFlags pFlags){ return FileOpen(pFileName); }
00215
00221 virtual bool GetAxisInfo(KFbxAxisSystem* pAxisSystem, KFbxSystemUnit* pSystemUnits){ return false; }
00222
00227 virtual bool GetStatistics(KFbxStatistics* pStats){ return false; }
00228
00232 virtual KFbxDocumentInfo* GetSceneInfo(){return NULL;}
00233
00237 virtual KArrayTemplate<KFbxTakeInfo*>* GetTakeInfo(){return NULL;}
00238
00246 virtual bool GetDefaultRenderResolution(KString& pCamName, KString& pResolutionMode, double& pW, double& pH);
00247
00252 bool IsGenuine();
00253
00257 KError& GetError();
00258
00262 EError GetLastErrorID() const;
00263
00267 const char* GetLastErrorString() const;
00268
00272 void GetMessage(KString& pMessage) const;
00273
00277 KString& GetMessage();
00278
00281 void ClearMessage();
00282
00287 virtual KFbxIOSettings * GetIOSettings();
00288
00292 virtual void SetIOSettings(KFbxIOSettings * pIOSettings);
00293
00297 virtual void SetProgressHandler(KFbxProgress *pProgress){}
00298
00299 protected:
00300 void SetDefaultRenderResolution(const char* pCamName, const char* pResolutionMode, double pW, double pH);
00301
00302 void PluginsReadBegin(KFbxScene& pScene);
00303 void PluginsRead(const char* pName, const char* pVersion);
00304 void PluginsReadEnd(KFbxScene& pScene);
00305
00306 KFbxReader& operator=(KFbxReader const&) { return *this; }
00307 virtual bool CheckDuplicateNodeNames(KFbxNode* pRootNode, KString& pDuplicateNodeNameList);
00308
00309 KFbxSdkManager& mManager;
00310 KDefaultRenderResolution* mData;
00311
00312 private:
00313 KError mError;
00314 KString mMessage;
00315 int mInternalID;
00316 KFbxIOSettings * mIOSettings;
00317
00318 friend struct KFbxReaderFbx7Impl;
00319 };
00320
00322 #define IOS_REF (*GetIOSettings())
00323
00324 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00325
00326 #endif // FBXFILESDK_KFBXIO_KFBXREADER_H
00327