Go to the
documentation of this file.
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
00159 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00160
00169 virtual bool Initialize(KFile* pFile, const int pFileFormat=-1, KFbxIOSettings* pIOSettings=NULL);
00170
00174 virtual KFile * GetFile();
00175 #endif
00176
00184 void GetFileVersion(int& pMajor, int& pMinor, int& pRevision);
00185
00194 bool GetDefaultRenderResolution(KString& pCamName, KString& pResolutionMode, double& pW, double& pH);
00195
00199 KFbxFileHeaderInfo* GetFileHeaderInfo();
00200
00206 typedef enum
00207 {
00208 eSTREAMOPTIONS_PARSE_FILE,
00209 eSTREAMOPTIONS_FAST,
00210 eSTREAMOPTIONS_COUNT
00211 } EStreamOptionsGeneration;
00212
00218 bool GetImportOptions(EStreamOptionsGeneration pStreamOptionsGeneration = eSTREAMOPTIONS_PARSE_FILE);
00219
00226 bool GetImportOptions(KFbx* pFbxObject);
00227
00238 bool Import(KFbxDocument* pDocument, bool pNonBlocking=false);
00239
00248 bool IsImporting(bool& pImportResult);
00249
00254 float GetProgress(KString &pStatus);
00255
00259 void SetProgressCallback(KFbxProgressCallback pHandler);
00260
00264 void SetEmbeddingExtractionFolder(const char* pExtractFolder);
00265
00268 const char* GetEmbeddingExtractionFolder();
00269
00273 KFbxIOSettings* GetIOSettings();
00274
00278 void SetIOSettings(KFbxIOSettings* pIOSettings);
00279
00284 void SetPassword(char* pPassword);
00285
00291
00296 int GetAnimStackCount();
00297
00304 KFbxTakeInfo* GetTakeInfo(int pIndex);
00305
00310 KString GetActiveAnimStackName();
00311
00313
00318
00323 KFbxDocumentInfo* GetSceneInfo();
00324
00326
00330
00339 int GetFileFormat ();
00340
00343 bool IsFBX();
00345
00347
00348
00349
00350
00351
00352
00354
00360 void ParseForGlobalSettings(bool pState);
00361
00367 void ParseForStatistics(bool pState);
00368
00375 bool GetAxisInfo(KFbxAxisSystem* pAxisSystem, KFbxSystemUnit* pSystemUnits);
00376
00383 bool GetStatistics(KFbxStatistics* pStatistics);
00384
00391 bool GetFrameRate(KTime::ETimeMode &pTimeMode);
00392
00393
00394 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00395
00396 bool Import(KFbxDocument* pDocument, KFbx* pFbxObject);
00397
00398 private:
00399 friend void ImportThread(void*);
00400 bool ImportProcess(KFbxDocument* pDocument);
00401
00402 protected:
00403 void GetImportOptionsInfo();
00404
00405 KFbxImporter(KFbxSdkManager& pManager,char const* pName);
00406 virtual void Destruct(bool pRecursive, bool pDependents);
00407
00408 void Reset();
00409
00410 bool FileOpen(KFile* pFile = NULL);
00411 void FileClose();
00412
00413 bool IsNativeExtension ();
00414
00415 KFbxImporterImp* mImp;
00416 KFile* mFile;
00417 bool mImportOptionsDone;
00418 KArrayTemplate<KFbxTakeInfo*> mTakeInfo;
00419 KFbxDocumentInfo* mSceneInfo;
00420 KString mActiveAnimStackName;
00421 int mMajorVersion;
00422 int mMinorVersion;
00423 int mRevisionVersion;
00424 KFbxFileHeaderInfo *mHeaderInfo;
00425 KFbxIOSettings* mIOSettings;
00426 bool mClientIOSettings;
00427 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00428 };
00429
00430 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00431
00432 #endif // FBXFILESDK_KFBXIO_KFBXIMPORTER_H
00433