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
00042 #include <fbxfilesdk/components/kbaselib/kaydaradef_h.h>
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/components/kbaselib/kbaselib_forward.h>
00048 #include <fbxfilesdk/kfbxplugins/kfbxrenamingstrategy.h>
00049
00050 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00051
00052 class KFbxNode;
00053 class KFbxDocument;
00054 class KFbxScene;
00055 class KFbxSdkManager;
00056 class KFbxExporter;
00057 class KFbxStreamOptions;
00058 class KFbxIOSettings;
00059 class KFbxObject;
00060
00061 class KFBX_DLL KFbxWriter
00062 {
00063 public:
00064 KFbxWriter(KFbxSdkManager& pManager, int pID);
00065 virtual ~KFbxWriter();
00066
00068 typedef enum
00069 {
00070 eFILE_CORRUPTED,
00071 eFILE_NOT_OPENED,
00072 eFILE_NOT_CREATED,
00073 eOUT_OF_DISK_SPACE,
00074 eSTREAM_OPTIONS_NOT_SET,
00075 eINVALID_DOCUMENT_HANDLE,
00076 eDOCUMENT_NOT_SUPPORTED,
00077 eUNIDENTIFIED_ERROR,
00078 eEMBEDDED_OUT_OF_SPACE,
00079 eERROR_COUNT
00080 } EError;
00081
00082 enum KInfoRequest {
00083 eInfoExtension,
00084 eInfoDescriptions,
00085 eInfoVersions,
00086 eReserved1 = 0xFBFB,
00087 };
00088
00089 typedef KFbxWriter* (*CreateFuncType)(KFbxSdkManager& pManager, KFbxExporter& pExporter, int pSubID, int pPluginID);
00090 typedef void (*IOSettingsFillerFuncType)(KFbxIOSettings& pIOS);
00091 typedef void* (*GetInfoFuncType)(KInfoRequest pRequest, int pWriterTypeId);
00092
00093 virtual bool FileCreate(char* pFileName) = 0;
00094 virtual bool FileClose() = 0;
00095 virtual bool IsFileOpen() = 0;
00096
00097 virtual KFbxStreamOptions* GetWriteOptions() = 0;
00098 virtual bool Write(KFbxDocument* pDocument, KFbxStreamOptions* pStreamOptions) = 0;
00099
00100 virtual bool PreprocessScene(KFbxScene &pScene) = 0;
00101 virtual bool PostprocessScene(KFbxScene &pScene) = 0;
00102 virtual KFbxNode* FindRootNode(KFbxScene& pScene);
00103 virtual bool CheckSpaceInNodeNameRecursive(KFbxNode* pNode, KString& pNodeNameList);
00104
00105 virtual void PluginWriteSettings(KFbxObject& pSettings){}
00106
00107 bool SetFileExportVersion(KString pVersion);
00108 void SetRenamingMode(KFbxSceneRenamer::ERenamingMode pRenamingMode){mRenamingMode = pRenamingMode;}
00109 inline void SetResamplingRate(double pResamplingRate){mResamplingRate = pResamplingRate;}
00110 bool IsGenuine();
00111
00112 KError& GetError();
00113 EError GetLastErrorID() const;
00114 const char* GetLastErrorString() const;
00115 void GetMessage(KString &pMessage) const;
00116 KString& GetMessage();
00117 void ClearMessage();
00118
00119 protected:
00120 void PluginsWriteBegin(KFbxScene& pScene);
00121 void PluginsWrite(KFbx& pFbx);
00122 void PluginsWriteEnd(KFbxScene& pScene);
00123
00124 KFbxWriter& operator=(KFbxWriter const&) { return *this; }
00125
00126 KFbxSdkManager& mManager;
00127 KString mFileVersion;
00128 double mResamplingRate;
00129 KFbxSceneRenamer::ERenamingMode mRenamingMode;
00130
00131 private:
00132 KError mError;
00133 KString mMessage;
00134 int mInternalID;
00135 };
00136
00137 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00138
00139 #endif // FBXFILESDK_KFBXIO_KFBXWRITER_H
00140