00001 
00004 #ifndef FBXFILESDK_KFBXIO_KFBXIMPORTER_H
00005 #define FBXFILESDK_KFBXIO_KFBXIMPORTER_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/kfbxio/kfbxio.h>
00044 #include <fbxfilesdk/kfbxevents/kfbxevents.h>
00045 
00046 #include <fbxfilesdk/kfbxio/kfbxiosettings.h>
00047 #include <fbxfilesdk/kfbxio/kfbxprogress.h>
00048 
00049 #include <fbxfilesdk/components/kbaselib/klib/kstring.h>
00050 #include <fbxfilesdk/components/kbaselib/klib/karrayul.h>
00051 
00052 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00053 
00054 class KFbxDocument;
00055 class KFbxImporterImp;
00056 class KFbxTakeInfo;
00057 class KFbxDocumentInfo;
00058 class KFbxAxisSystem;
00059 class KFbxSystemUnit;
00060 class KFbxStatistics;
00061 class KFile;
00062 class KFbxFileHeaderInfo;
00063 
00065 class KFBX_DLL KFbxEventPreImport : public KFbxEvent<KFbxEventPreImport>
00066 {
00067     KFBXEVENT_DECLARE(KFbxEventPreImport);
00068 public:
00069     inline KFbxEventPreImport( KFbxDocument* pDocument ) : mDocument(pDocument) {};
00070 
00072     KFbxDocument* mDocument; 
00073 };
00074 
00076 class KFBX_DLL KFbxEventPostImport : public KFbxEvent<KFbxEventPostImport>
00077 {
00078     KFBXEVENT_DECLARE(KFbxEventPostImport);
00079 public:
00080     inline KFbxEventPostImport( KFbxDocument* pDocument ) : mDocument(pDocument) {};
00081 
00083     KFbxDocument* mDocument; 
00084 };
00085 
00139 class KFBX_DLL KFbxImporter : public KFbxIO
00140 {
00141     KFBXOBJECT_DECLARE(KFbxImporter,KFbxIO);
00142 public:
00147 
00157     virtual bool Initialize(const char* pFileName, const int pFileFormat=-1, KFbxIOSettings * pIOSettings=NULL);
00158 
00168     virtual bool Initialize(KFile* pFile, const int pFileFormat=-1, KFbxIOSettings* pIOSettings=NULL);
00169 
00173     virtual KFile * GetFile();
00174 
00182     void GetFileVersion(int& pMajor, int& pMinor, int& pRevision);
00183 
00192     bool GetDefaultRenderResolution(KString& pCamName, KString& pResolutionMode, double& pW, double& pH);
00193 
00197     KFbxFileHeaderInfo* GetFileHeaderInfo();
00198 
00204     typedef enum 
00205     {
00206         eSTREAMOPTIONS_PARSE_FILE,  
00207         eSTREAMOPTIONS_FAST,        
00208         eSTREAMOPTIONS_COUNT
00209     } EStreamOptionsGeneration;
00210 
00216       bool GetImportOptions(EStreamOptionsGeneration pStreamOptionsGeneration = eSTREAMOPTIONS_PARSE_FILE); 
00217 
00224       bool GetImportOptions(KFbx* pFbxObject);
00225 
00236       bool Import(KFbxDocument* pDocument, bool pNonBlocking=false);
00237 
00246       bool IsImporting(bool& pImportResult);
00247 
00252       float GetProgress(KString &pStatus);
00253 
00257       void SetProgressCallback(KFbxProgressCallback pHandler);
00258 
00262       KFbxIOSettings* GetIOSettings();
00263 
00267       void SetIOSettings(KFbxIOSettings* pIOSettings);
00268 
00273       void SetPassword(char* pPassword);
00274 
00280     
00286       K_DEPRECATED int GetTakeCount();
00287 
00292       int GetAnimStackCount();
00293 
00300       KFbxTakeInfo* GetTakeInfo(int pIndex);
00301 
00307       K_DEPRECATED char* GetCurrentTakeName();
00308 
00313       KString GetActiveAnimStackName();
00314 
00316 
00321 
00326     KFbxDocumentInfo* GetSceneInfo();
00327 
00329 
00333 
00342     int GetFileFormat ();
00343 
00346     bool IsFBX();
00348 
00350 
00351 
00352 
00353 
00354 
00355 
00357 
00363     void ParseForGlobalSettings(bool pState);
00364 
00370     void ParseForStatistics(bool pState);
00371 
00378     bool GetAxisInfo(KFbxAxisSystem* pAxisSystem, KFbxSystemUnit* pSystemUnits);
00379 
00386     bool GetStatistics(KFbxStatistics* pStatistics);
00387 
00388 
00389 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00390     
00391     bool Import(KFbxDocument* pDocument, KFbx* pFbxObject);
00392 
00393 private:
00394     friend void ImportThread(void*);
00395     bool ImportProcess(KFbxDocument* pDocument);
00396 
00397 protected:
00398     void GetImportOptionsInfo();
00399     
00400     KFbxImporter(KFbxSdkManager& pManager,char const* pName);
00401     virtual void Destruct(bool pRecursive, bool pDependents);
00402 
00403     void Reset();
00404 
00405     bool FileOpen(KFile* pFile = NULL);
00406     void FileClose();
00407     
00408     bool IsNativeExtension ();
00409 
00410     KFbxImporterImp*                mImp;
00411     KFile*                          mFile;
00412     bool                            mImportOptionsDone;
00413     KArrayTemplate<KFbxTakeInfo*>   mTakeInfo;
00414     KFbxDocumentInfo*               mSceneInfo;
00415     KString                         mActiveAnimStackName;
00416     int                             mMajorVersion;
00417     int                             mMinorVersion;
00418     int                             mRevisionVersion;
00419     KFbxFileHeaderInfo              *mHeaderInfo;
00420     KFbxIOSettings*                 mIOSettings;
00421     bool                            mClientIOSettings;
00422 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00423 };
00424 
00425 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00426 
00427 #endif // FBXFILESDK_KFBXIO_KFBXIMPORTER_H
00428