00001
00004 #ifndef FBXFILESDK_KFBXIO_KFBXWRITER_H
00005 #define FBXFILESDK_KFBXIO_KFBXWRITER_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/klib/kstring.h>
00045 #include <fbxfilesdk/components/kbaselib/klib/karrayul.h>
00046
00047 #include <fbxfilesdk/kfbxplugins/kfbxrenamingstrategy.h>
00048
00049 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00050
00051 class KFbxNode;
00052 class KFbxDocument;
00053 class KFbxScene;
00054 class KFbxSdkManager;
00055 class KFbxExporter;
00056 class KFbxIOSettings;
00057 class KFbxObject;
00058 class KFbx;
00059 class KFbxProgress;
00060
00061 #define IOSP GetIOSettings()
00062
00085 class KFBX_DLL KFbxWriter
00086 {
00087 public:
00092 KFbxWriter(KFbxSdkManager& pManager, int pID);
00095 virtual ~KFbxWriter();
00096
00108 typedef enum
00109 {
00110 eFILE_CORRUPTED,
00111 eFILE_NOT_OPENED,
00112 eFILE_NOT_CREATED,
00113 eOUT_OF_DISK_SPACE,
00114 eINVALID_DOCUMENT_HANDLE,
00115 eDOCUMENT_NOT_SUPPORTED,
00116 eUNIDENTIFIED_ERROR,
00117 eEMBEDDED_OUT_OF_SPACE,
00118 eERROR_COUNT
00119 } EError;
00120
00130 enum KInfoRequest {
00131 eInfoExtension,
00132 eInfoDescriptions,
00133 eInfoVersions,
00134 eInfoCompatibleDesc,
00135 eInfoUILabel,
00136 eReserved1 = 0xFBFB,
00137 };
00138
00140 typedef KFbxWriter* (*CreateFuncType)(KFbxSdkManager& pManager, KFbxExporter& pExporter, int pSubID, int pPluginID);
00141
00143 typedef void (*IOSettingsFillerFuncType)(KFbxIOSettings& pIOS);
00144
00146 typedef void* (*GetInfoFuncType)(KInfoRequest pRequest, int pWriterTypeId);
00147
00151 virtual bool FileCreate(char* pFileName) = 0;
00152
00155 virtual bool FileClose() = 0;
00156
00159 virtual bool IsFileOpen() = 0;
00160
00163 virtual void GetWriteOptions() = 0;
00164
00168 virtual bool Write(KFbxDocument* pDocument) = 0;
00169
00173 virtual bool PreprocessScene(KFbxScene &pScene) = 0;
00174
00178 virtual bool PostprocessScene(KFbxScene &pScene) = 0;
00179
00188 virtual void PluginWriteParameters(KFbxObject& pParams);
00189
00194 virtual KFbxNode* FindRootNode(KFbxScene& pScene);
00195
00203 virtual bool CheckSpaceInNodeNameRecursive(KFbxNode* pNode, KString& pNodeNameList);
00204
00208 bool SetFileExportVersion(KString pVersion);
00209
00213 void SetRenamingMode(KFbxSceneRenamer::ERenamingMode pRenamingMode){mRenamingMode = pRenamingMode;}
00214
00218 inline void SetResamplingRate(double pResamplingRate){mResamplingRate = pResamplingRate;}
00219
00224 bool IsGenuine();
00225
00229 KError& GetError();
00230
00234 EError GetLastErrorID() const;
00235
00239 const char* GetLastErrorString() const;
00240
00244 void GetMessage(KString &pMessage) const;
00245
00249 KString& GetMessage();
00250
00253 void ClearMessage();
00254
00259 virtual KFbxIOSettings * GetIOSettings();
00260
00264 virtual void SetIOSettings(KFbxIOSettings * pIOSettings);
00265
00269 virtual void SetProgressHandler(KFbxProgress *pProgress){}
00270
00271 protected:
00272 void PluginsWriteBegin(KFbxScene& pScene);
00273 void PluginsWrite(KFbx& pFbx, bool pWriteObjectId);
00274 void PluginsWriteEnd(KFbxScene& pScene);
00275
00276 KFbxWriter& operator=(KFbxWriter const&) { return *this; }
00277
00278 KFbxSdkManager& mManager;
00279 KString mFileVersion;
00280 double mResamplingRate;
00281 KFbxSceneRenamer::ERenamingMode mRenamingMode;
00282
00283 private:
00284 KError mError;
00285 KString mMessage;
00286 int mInternalID;
00287 KFbxIOSettings * mIOSettings;
00288
00289 friend struct KFbxWriterFbx7Impl;
00290 };
00291
00293 #define IOS_REF (*GetIOSettings())
00294
00295 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00296
00297 #endif // FBXFILESDK_KFBXIO_KFBXWRITER_H
00298