kfbxexporter.h

Go to the documentation of this file.
00001 
00004 #ifndef FBXFILESDK_KFBXIO_KFBXEXPORTER_H
00005 #define FBXFILESDK_KFBXIO_KFBXEXPORTER_H
00006 
00007 /**************************************************************************************
00008 
00009  Copyright (C) 2001 - 2010 Autodesk, Inc. and/or its licensors.
00010  All Rights Reserved.
00011 
00012  The coded instructions, statements, computer programs, and/or related material 
00013  (collectively the "Data") in these files contain unpublished information 
00014  proprietary to Autodesk, Inc. and/or its licensors, which is protected by 
00015  Canada and United States of America federal copyright law and by international 
00016  treaties. 
00017  
00018  The Data may not be disclosed or distributed to third parties, in whole or in
00019  part, without the prior written consent of Autodesk, Inc. ("Autodesk").
00020 
00021  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00022  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
00023  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR ARISING
00024  BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES OF TITLE, 
00025  NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR USE. 
00026  WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT WARRANT THAT THE OPERATION
00027  OF THE DATA WILL BE UNINTERRUPTED OR ERROR FREE. 
00028  
00029  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
00030  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR EXPENSES
00031  OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE DAMAGES OR OTHER
00032  SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS OF PROFITS, REVENUE
00033  OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR DAMAGES OF ANY KIND),
00034  HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF LIABILITY, WHETHER DERIVED
00035  FROM CONTRACT, TORT (INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE), OR OTHERWISE,
00036  ARISING OUT OF OR RELATING TO THE DATA OR ITS USE OR ANY OTHER PERFORMANCE,
00037  WHETHER OR NOT AUTODESK HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS
00038  OR DAMAGE. 
00039 
00040 **************************************************************************************/
00041 #include <fbxfilesdk/fbxfilesdk_def.h>
00042 
00043 #include <fbxfilesdk/kfbxio/kfbxio.h>
00044 #include <fbxfilesdk/kfbxio/kfbxiosettings.h>
00045 
00046 #include <fbxfilesdk/components/kbaselib/klib/kstring.h>
00047 #include <fbxfilesdk/components/kbaselib/klib/karrayul.h>
00048 #include <fbxfilesdk/kfbxio/kfbxprogress.h>
00049 
00050 #include <fbxfilesdk/kfbxplugins/kfbxrenamingstrategy.h>
00051 #include <fbxfilesdk/kfbxevents/kfbxevents.h>
00052 
00053 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00054 
00055 class KFbxDocument;
00056 class KFbxExporterImp;
00057 class KFbxFileHeaderInfo;
00058 
00060 class KFBX_DLL KFbxEventPreExport : public KFbxEvent<KFbxEventPreExport>
00061 {
00062     KFBXEVENT_DECLARE(KFbxEventPreExport);
00063 public:
00064     inline KFbxEventPreExport( KFbxDocument* pDocument ) : mDocument(pDocument) {};
00065 
00067     KFbxDocument* mDocument;
00068 };
00069 
00071 class KFBX_DLL KFbxEventPostExport : public KFbxEvent<KFbxEventPostExport>
00072 {
00073     KFBXEVENT_DECLARE(KFbxEventPostExport);
00074 public:
00075     inline KFbxEventPostExport( KFbxDocument* pDocument ) : mDocument(pDocument) {};
00076 
00078     KFbxDocument* mDocument;
00079 };
00080 
00136 class KFBX_DLL KFbxExporter : public KFbxIO
00137 {
00138     KFBXOBJECT_DECLARE(KFbxExporter, KFbxIO);
00139 
00140 public:
00141 
00146 
00155     virtual bool Initialize(const char *pFileName, int pFileFormat = -1, KFbxIOSettings * pIOSettings = NULL);
00156 
00160     bool GetExportOptions();
00161 
00165     KFbxIOSettings * GetIOSettings();
00166 
00170     void SetIOSettings(KFbxIOSettings * pIOSettings);
00171 
00172     
00180     bool Export(KFbxDocument* pDocument, bool pNonBlocking=false);
00181 
00190     bool IsExporting(bool& pExportResult);
00191 
00196     float GetProgress(KString &pStatus);
00197 
00201     void SetProgressCallback(KFbxProgressCallback pHandler);
00202     
00204 
00209 
00213     int GetFileFormat();
00214 
00217     bool IsFBX();
00218 
00224     char const* const* GetCurrentWritableVersions();
00225 
00231     bool SetFileExportVersion(KString pVersion, KFbxSceneRenamer::ERenamingMode pRenamingMode);
00232 
00236     inline void SetResamplingRate(double pResamplingRate){mResamplingRate = pResamplingRate;}
00237 
00244     void SetDefaultRenderResolution(KString pCamName, KString pResolutionMode, double pW, double pH);
00245 
00249     KFbxFileHeaderInfo* GetFileHeaderInfo();
00250 
00252 
00253 
00255 //
00256 //  WARNING!
00257 //
00258 //  Anything beyond these lines may not be documented accurately and is 
00259 //  subject to change without notice.
00260 //
00262 
00263 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00264 
00269     bool GetExportOptions(KFbx* pFbxObject);
00270 
00271     //Internal use only, please use the other Export function to do your exports
00272     bool Export(KFbxDocument* pDocument, KFbx* pFbxObject);
00273 private:
00274     friend void ExportThread(void*);
00275     bool ExportProcess(KFbxDocument* pDocument);
00276 
00277 protected:
00278     KFbxExporter(KFbxSdkManager& pManager,char const *pName);
00279     virtual void Destruct(bool pRecursive, bool pDependents);
00280 
00281     void Reset();
00282 
00283     bool FileCreate();
00284     void FileClose();
00285 
00286     KFbxExporterImp* mImp;
00287 
00288     KString mStrFileVersion;
00289     double  mResamplingRate;
00290     KFbxSceneRenamer::ERenamingMode mRenamingMode;
00291     KFbxFileHeaderInfo*             mHeaderInfo;
00292     KFbxIOSettings*                 mIOSettings;
00293     bool                            mClientIOSettings;
00294 
00295 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00296 
00297 };
00298 
00299 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00300 
00301 #endif // FBXFILESDK_KFBXIO_KFBXEXPORTER_H
00302