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