00001 
00004 #ifndef _FBXSDK_READER_H_
00005 #define _FBXSDK_READER_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 
00042 #include <kaydaradef.h>
00043 
00044 #ifndef KFBX_DLL
00045     #define KFBX_DLL K_DLLIMPORT
00046 #endif
00047 
00048 #include <klib/kerror.h>
00049 
00050 
00051 #include <kbaselib_forward.h>
00052 #ifndef MB_FBXSDK
00053 #include <kbaselib_nsuse.h>
00054 #endif
00055 
00056 #include <kfcurve/kfcurve_forward.h>
00057 #ifndef MB_FBXSDK
00058 #include <kfcurve/kfcurve_nsuse.h>
00059 #endif
00060 
00061 #include <fbxfilesdk_nsbegin.h>
00062 
00063 class KFbxDocument;
00064 class KFbxNode;
00065 class KFbxSdkManager;
00066 class KFbxImporter;
00067 class KFbxStreamOptions;
00068 class KFbxIOSettings;
00069 class KFbxAxisSystem;
00070 class KFbxSystemUnit;
00071 class KFbxStatistics;
00072 class KFile;
00073 
00074 class KFBX_DLL KFbxReader
00075 {
00076 
00077 public:
00078 
00079     KFbxReader(KFbxSdkManager& pManager);
00080     virtual ~KFbxReader();
00081 
00082     virtual void GetVersion(int& pMajor, int& pMinor, int& pRevision) const;
00083 
00084     virtual bool FileOpen(char* pFileName) = 0;
00085     virtual bool FileOpen(KFile * pFile);
00086     virtual bool FileClose() = 0;
00087     virtual bool IsFileOpen() = 0;
00088 
00089     virtual KFbxStreamOptions* GetReadOptions(bool pParseFileAsNeeded = true) = 0;
00090     virtual bool Read(KFbxDocument* pDocument, KFbxStreamOptions* pStreamOptions) = 0;
00091 
00093     typedef enum
00094     {
00095         eFILE_CORRUPTED,
00096         eFILE_VERSION_NOT_SUPPORTED_YET,
00097         eFILE_VERSION_NOT_SUPPORTED_ANYMORE,
00098         eFILE_NOT_OPENED,
00099         eFILE_NOT_CREATED,
00100         eWRONG_PASSWORD,
00101         eSTREAM_OPTIONS_NOT_SET,
00102         eINVALID_DOCUMENT_HANDLE,
00103         eDOCUMENT_NOT_SUPPORTED,
00104         eUNRESOLVED_EXTERNAL_REFERENCES, 
00105         eUNIDENTIFIED_ERROR,
00106         eERROR_COUNT
00107     } EError;
00108 
00109     KError&  GetError();
00110     EError   GetLastErrorID() const;
00111     const char* GetLastErrorString() const;
00112 
00113     void     GetMessage(KString &pMessage) const;
00114     void     ClearMessage();
00115 
00116     typedef KFbxReader* (*CreateFuncType)(KFbxSdkManager& pManager,
00117                                           KFbxImporter& pImporter,
00118                                           int pID);
00119 
00120     typedef void (*IOSettingsFillerFuncType)(KFbxIOSettings& pIOS);
00121 
00122     enum KInfoRequest {
00123         eInfoExtension, 
00124         eInfoDescriptions, 
00125         eReserved1 = 0xFBFB,
00126     };
00127 
00128     typedef void* (*GetInfoFuncType)(KInfoRequest pRequest, int pReaderTypeId);
00129 
00130 protected:
00131 
00132     KFbxReader& operator=(KFbxReader const&) { return *this; }
00133     virtual bool CheckDuplicateNodeNames(KFbxNode* pRootNode, KString& pDuplicateNodeNameList);
00134 
00135     KFbxSdkManager& mManager;
00136     KError          mError;
00137 
00138     KString         mMessage;
00139 
00140 public:
00141     enum EFileOpenSpecialFlags {
00142         ParseForGlobalSettings = 1,
00143         ParseForStatistics = 2
00144     };
00145 
00146     virtual bool FileOpen(char* pFileName, EFileOpenSpecialFlags pFlags) { return FileOpen(pFileName); };
00147     virtual bool GetAxisInfo(KFbxAxisSystem* pAxisSystem, KFbxSystemUnit* pSystemUnits) { return false; };
00148     virtual bool GetStatistics(KFbxStatistics* pStats) {return false; };
00149 };
00150 
00151 #include <fbxfilesdk_nsend.h>
00152 
00153 #endif // #ifndef _FBXSDK_READER_H_
00154 
00155