Go to the
documentation of this file.
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00013 #ifndef _FBXSDK_FILEIO_IMPORTER_H_
00014 #define _FBXSDK_FILEIO_IMPORTER_H_
00015
00016 #include <fbxsdk/fbxsdk_def.h>
00017
00018 #include <fbxsdk/core/fbxsystemunit.h>
00019 #include <fbxsdk/core/base/fbxtime.h>
00020 #include <fbxsdk/fileio/fbxiobase.h>
00021 #include <fbxsdk/fileio/fbxprogress.h>
00022 #include <fbxsdk/fileio/fbxiosettings.h>
00023 #include <fbxsdk/fileio/fbxstatistics.h>
00024 #include <fbxsdk/scene/fbxaxissystem.h>
00025
00026 #include <fbxsdk/fbxsdk_nsbegin.h>
00027
00028 class FbxIO;
00029 class FbxIOFileHeaderInfo;
00030 class FbxDocumentInfo;
00031 class FbxTakeInfo;
00032 class FbxReader;
00033 class FbxThread;
00034
00035 struct FbxImportThreadArg;
00036
00090 class FBXSDK_DLL FbxImporter : public FbxIOBase
00091 {
00092 FBXSDK_OBJECT_DECLARE(FbxImporter, FbxIOBase);
00093
00094 public:
00099
00110 virtual bool Initialize(const char* pFileName, const int pFileFormat=-1, FbxIOSettings * pIOSettings=NULL);
00111
00123 virtual bool Initialize(FbxStream* pStream, void* pStreamData=NULL, const int pFileFormat=-1, FbxIOSettings* pIOSettings=NULL);
00124
00132 void GetFileVersion(int& pMajor, int& pMinor, int& pRevision);
00133
00142 bool GetDefaultRenderResolution(FbxString& pCamName, FbxString& pResolutionMode, double& pW, double& pH);
00143
00147 FbxIOFileHeaderInfo* GetFileHeaderInfo();
00148
00153 enum EStreamOptionsGeneration
00154 {
00155 eParseFile,
00156 eDoNotParseFile
00157 };
00158
00164 bool GetImportOptions(EStreamOptionsGeneration pStreamOptionsGeneration = eParseFile);
00165
00171 bool GetImportOptions(FbxIO* pFbxObject);
00172
00184 bool Import(FbxDocument* pDocument, bool pNonBlocking=false);
00185
00186 #ifndef FBXSDK_ENV_WINRT
00187
00195 bool IsImporting(bool& pImportResult);
00196 #endif
00197
00202 float GetProgress(FbxString* pStatus=NULL);
00203
00208 void SetProgressCallback(FbxProgressCallback pCallback, void* pArgs=NULL);
00209
00213 void SetEmbeddingExtractionFolder(const char* pExtractFolder);
00214
00217 const char* GetEmbeddingExtractionFolder();
00218
00222 FbxIOSettings* GetIOSettings();
00223
00227 void SetIOSettings(FbxIOSettings* pIOSettings);
00228
00233 void SetPassword(char* pPassword);
00234
00240
00245 int GetAnimStackCount();
00246
00253 FbxTakeInfo* GetTakeInfo(int pIndex);
00254
00259 FbxString GetActiveAnimStackName();
00260
00262
00267
00272 FbxDocumentInfo* GetSceneInfo();
00273
00275
00279
00288 int GetFileFormat ();
00289
00292 bool IsFBX();
00294
00295
00296
00297
00298 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00299 FbxFile* GetFile();
00300 FbxStream* GetStream();
00301 void* GetStreamData();
00302
00303 void ParseForGlobalSettings(bool pState);
00304 void ParseForStatistics(bool pState);
00305 bool GetAxisInfo(FbxAxisSystem* pAxisSystem, FbxSystemUnit* pSystemUnits);
00306 bool GetStatistics(FbxStatistics* pStatistics);
00307 bool GetFrameRate(FbxTime::EMode &pTimeMode);
00308
00309 protected:
00310 virtual void Construct(const FbxImporter* pFrom);
00311 virtual void Destruct(bool pRecursive);
00312
00313 void Reset();
00314 bool FileOpen(FbxFile* pFile = NULL);
00315 bool FileOpen(FbxStream* pStream, void* pStreamData);
00316 void FileClose();
00317
00318 void GetImportOptionsInfo();
00319 bool IsNativeExtension ();
00320
00321
00322 bool Initialize(FbxFile* pFile, const int pFileFormat=-1, FbxIOSettings* pIOSettings=NULL);
00323 bool Import(FbxDocument* pDocument, FbxIO* pFbxObject);
00324
00325 private:
00326 bool ImportProcess(FbxDocument* pDocument);
00327
00328 int mFileFormat;
00329 FbxReader* mReader;
00330 FbxString mExtractFolder;
00331 bool mParseForGlobalSettings;
00332 FbxAxisSystem mAxisSystem;
00333 FbxSystemUnit mSystemUnits;
00334 FbxTime::EMode mFrameRate;
00335 bool mParseForStatistics;
00336 FbxStatistics mStatistics;
00337 #ifndef FBXSDK_ENV_WINRT
00338 FbxThread* mImportThread;
00339 FbxImportThreadArg* mImportThreadArg;
00340 bool mImportThreadResult;
00341 bool mIsThreadImporting;
00342 #endif
00343 FbxProgress mProgress;
00344 FbxFile* mFile;
00345 FbxStream* mStream;
00346 void* mStreamData;
00347 bool mImportOptionsDone;
00348 FbxArray<FbxTakeInfo*> mTakeInfo;
00349 FbxDocumentInfo* mSceneInfo;
00350 FbxString mActiveAnimStackName;
00351 int mMajorVersion;
00352 int mMinorVersion;
00353 int mRevisionVersion;
00354 FbxIOFileHeaderInfo* mHeaderInfo;
00355 FbxIOSettings* mIOSettings;
00356 bool mClientIOSettings;
00357
00358
00359 friend class FbxReaderFbx5;
00360 friend class FbxReaderFbx6;
00361 friend struct FbxReaderFbx7_Impl;
00362
00363 friend void ImportThread(void*);
00364 #endif
00365 };
00366
00368 class FBXSDK_DLL FbxEventPreImport : public FbxEvent<FbxEventPreImport>
00369 {
00370 FBXSDK_EVENT_DECLARE(FbxEventPreImport);
00371 public:
00372 inline FbxEventPreImport( FbxDocument* pDocument ) : mDocument(pDocument) {};
00373
00375 FbxDocument* mDocument;
00376 };
00377
00379 class FBXSDK_DLL FbxEventPostImport : public FbxEvent<FbxEventPostImport>
00380 {
00381 FBXSDK_EVENT_DECLARE(FbxEventPostImport);
00382 public:
00383 inline FbxEventPostImport( FbxDocument* pDocument ) : mDocument(pDocument) {};
00384
00386 FbxDocument* mDocument;
00387 };
00388
00389 #include <fbxsdk/fbxsdk_nsend.h>
00390
00391 #endif