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/components/kbaselib/kfbx/kfbx.h>
00049
00050 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00051
00052 class KFbxDocument;
00053 class KFbxNode;
00054 class KFbxSdkManager;
00055 class KFbxImporter;
00056 class KFbxStreamOptions;
00057 class KFbxIOSettings;
00058 class KFbxAxisSystem;
00059 class KFbxSystemUnit;
00060 class KFbxStatistics;
00061 class KFile;
00062 class KFbxObject;
00063 class KFbxScene;
00064
00065
00070 class KFBX_DLL KFbxReader
00071 {
00072 public:
00077 KFbxReader(KFbxSdkManager& pManager, int pID);
00078
00081 virtual ~KFbxReader();
00082
00083
00098 typedef enum
00099 {
00100 eFILE_CORRUPTED,
00101 eFILE_VERSION_NOT_SUPPORTED_YET,
00102 eFILE_VERSION_NOT_SUPPORTED_ANYMORE,
00103 eFILE_NOT_OPENED,
00104 eFILE_NOT_CREATED,
00105 eWRONG_PASSWORD,
00106 eSTREAM_OPTIONS_NOT_SET,
00107 eINVALID_DOCUMENT_HANDLE,
00108 eDOCUMENT_NOT_SUPPORTED,
00109 eUNRESOLVED_EXTERNAL_REFERENCES,
00110 eUNIDENTIFIED_ERROR,
00111 eERROR_COUNT
00112 } EError;
00113
00114 enum KInfoRequest {
00115 eInfoExtension,
00116 eInfoDescriptions,
00117 eReserved1 = 0xFBFB,
00118 };
00119
00120 enum EFileOpenSpecialFlags {
00121 ParseForGlobalSettings = 1,
00122 ParseForStatistics = 2
00123 };
00124
00125 typedef KFbxReader* (*CreateFuncType)(KFbxSdkManager& pManager, KFbxImporter& pImporter, int pSubID, int pPluginID);
00126 typedef void (*IOSettingsFillerFuncType)(KFbxIOSettings& pIOS);
00127 typedef void* (*GetInfoFuncType)(KInfoRequest pRequest, int pReaderTypeId);
00128
00129
00130
00136 virtual void GetVersion(int& pMajor, int& pMinor, int& pRevision){ pMajor = pMinor = pRevision = 0; }
00137
00142 virtual bool FileOpen(char* pFileName) = 0;
00143
00148 virtual bool FileOpen(KFile * pFile);
00149
00153 virtual bool FileClose() = 0;
00154
00158 virtual bool IsFileOpen() = 0;
00159
00164 virtual KFbxStreamOptions* GetReadOptions(bool pParseFileAsNeeded = true) = 0;
00165
00171 virtual bool Read(KFbxDocument* pDocument, KFbxStreamOptions* pStreamOptions) = 0;
00172
00173
00174
00175
00176
00180 virtual void PluginReadParameters(KFbxObject& pParams){}
00181
00182
00188 virtual bool FileOpen(char* pFileName, EFileOpenSpecialFlags pFlags){ return FileOpen(pFileName); }
00189
00195 virtual bool GetAxisInfo(KFbxAxisSystem* pAxisSystem, KFbxSystemUnit* pSystemUnits){ return false; }
00196
00201 virtual bool GetStatistics(KFbxStatistics* pStats){ return false; }
00202
00210 bool GetDefaultRenderResolution(KString& pCamName, KString& pResolutionMode, double& pW, double& pH);
00211
00215 bool IsGenuine();
00216
00220 KError& GetError();
00224 EError GetLastErrorID() const;
00225
00229 const char* GetLastErrorString() const;
00230
00234 void GetMessage(KString& pMessage) const;
00235
00239 KString& GetMessage();
00240
00243 void ClearMessage();
00244
00245 protected:
00246 void SetDefaultRenderResolution(const char* pCamName, const char* pResolutionMode, double pW, double pH);
00247
00248 void PluginsReadBegin(KFbxScene& pScene);
00249 void PluginsRead(char* pName, char* pVersion);
00250 void PluginsReadEnd(KFbxScene& pScene);
00251
00252 KFbxReader& operator=(KFbxReader const&) { return *this; }
00253 virtual bool CheckDuplicateNodeNames(KFbxNode* pRootNode, KString& pDuplicateNodeNameList);
00254
00255 KFbxSdkManager& mManager;
00256 KDefaultRenderResolution* mData;
00257
00258 private:
00259 KError mError;
00260 KString mMessage;
00261 int mInternalID;
00262 };
00263
00264 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00265
00266 #endif // FBXFILESDK_KFBXIO_KFBXREADER_H
00267