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
00042
00043 #include <fbxfilesdk/components/kbaselib/kaydaradef_h.h>
00044 #include <fbxfilesdk/kfbxio/kfbxio.h>
00045 #include <fbxfilesdk/kfbxevents/kfbxevents.h>
00046
00047 #include <fbxfilesdk/components/kbaselib/klib/kstring.h>
00048 #include <fbxfilesdk/components/kbaselib/klib/karrayul.h>
00049
00050 #include <fbxfilesdk/components/kbaselib/kbaselib_forward.h>
00051
00052 #ifdef KARCH_DEV_MACOSX_CFM
00053 #include <CFURL.h>
00054 #include <Files.h>
00055 #endif
00056
00057 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00058
00059 class KFbxDocument;
00060 class KFbxImporterImp;
00061 class KFbxStreamOptionsFbx;
00062 class KFbxTakeInfo;
00063 class KFbxDocumentInfo;
00064 class KFbxStreamOptionsFbxReader;
00065 class KFbxAxisSystem;
00066 class KFbxSystemUnit;
00067 class KFbxStatistics;
00068 class KFile;
00069 class KFbxFileHeaderInfo;
00070
00072 class KFBX_DLL KFbxEventPreImport : public KFbxEvent<KFbxEventPreImport>
00073 {
00074 KFBXEVENT_DECLARE(KFbxEventPreImport);
00075 public:
00076 inline KFbxEventPreImport( KFbxDocument* pDocument ) : mDocument(pDocument) {};
00077
00079 KFbxDocument* mDocument;
00080 };
00081
00083 class KFBX_DLL KFbxEventPostImport : public KFbxEvent<KFbxEventPostImport>
00084 {
00085 KFBXEVENT_DECLARE(KFbxEventPostImport);
00086 public:
00087 inline KFbxEventPostImport( KFbxDocument* pDocument ) : mDocument(pDocument) {};
00088
00090 KFbxDocument* mDocument;
00091 };
00092
00101 class KFBX_DLL KFbxImporter : public KFbxIO
00102 {
00103 KFBXOBJECT_DECLARE(KFbxImporter,KFbxIO);
00104 public:
00109
00116 virtual bool Initialize(const char *pFileName);
00117
00124 virtual bool Initialize(KFile * pFile);
00125
00126 #ifdef KARCH_DEV_MACOSX_CFM
00127 virtual bool Initialize(const FSSpec &pMacFileSpec);
00128 virtual bool Initialize(const FSRef &pMacFileRef);
00129 virtual bool Initialize(const CFURLRef &pMacURL);
00130 #endif
00131
00135 virtual KFile * GetFile();
00136
00144 void GetFileVersion(int& pMajor, int& pMinor, int& pRevision);
00145
00154 bool GetDefaultRenderResolution(KString& pCamName, KString& pResolutionMode, double& pW, double& pH);
00155
00159 KFbxFileHeaderInfo* GetFileHeaderInfo();
00160
00166 typedef enum
00167 {
00168 eSTREAMOPTIONS_PARSE_FILE,
00169 eSTREAMOPTIONS_FAST,
00170 eSTREAMOPTIONS_COUNT
00171 } EStreamOptionsGeneration;
00172
00178 KFbxStreamOptions* GetImportOptions(EStreamOptionsGeneration pStreamOptionsGeneration = eSTREAMOPTIONS_PARSE_FILE);
00179
00185 KFbxStreamOptions* GetImportOptions(KFbx* pFbxObject);
00186
00196 bool Import(KFbxDocument* pDocument, KFbxStreamOptions* pStreamOptions = NULL);
00197
00201 void ReleaseImportOptions(KFbxStreamOptions* pStreamOptions);
00202
00204
00209 void SetPassword(char* pPassword);
00210
00215
00220 int GetTakeCount();
00221
00228 KFbxTakeInfo* GetTakeInfo(int pIndex);
00229
00234 char* GetCurrentTakeName();
00235
00237
00242
00247 KFbxDocumentInfo* GetSceneInfo();
00248
00250
00254
00258 void SetFileFormat (int pFileFormat);
00259
00263 int GetFileFormat ();
00264
00267 bool IsFBX();
00269
00271
00272
00273
00274
00275
00276
00278
00279 void ParseForGlobalSettings(bool pState);
00280 bool GetAxisInfo(KFbxAxisSystem* pAxisSystem, KFbxSystemUnit* pSystemUnits);
00281
00282 void ParseForStatistics(bool pState);
00283 bool GetStatistics(KFbxStatistics* pStatistics);
00284
00285 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00286 bool UpdateImportOptions(KFbxStreamOptions* pStreamOptions);
00287
00288
00289 bool Import(KFbxDocument* pDocument, KFbxStreamOptions* pStreamOptions, KFbx* pFbxObject);
00290
00291 protected:
00292 void SetImportOptionsInfo(KFbxStreamOptionsFbxReader* pStreamOptionsFbx);
00293 void GetImportOptionsInfo(KFbxStreamOptionsFbxReader* pStreamOptionsFbx);
00294
00295 KFbxImporter(KFbxSdkManager& pManager,char const* pName);
00296 virtual ~KFbxImporter();
00297
00298 void Reset();
00299
00300 bool FileOpen(KFile* pFile = NULL);
00301 void FileClose();
00302
00303 bool IsNativeExtension ();
00304
00305 KFbxImporterImp* mImp;
00306 KFile* mFile;
00307 bool mImportOptionsDone;
00308 KArrayTemplate<KFbxTakeInfo*> mTakeInfo;
00309 KFbxDocumentInfo* mSceneInfo;
00310 KString mCurrentTakeName;
00311 int mMajorVersion;
00312 int mMinorVersion;
00313 int mRevisionVersion;
00314 KFbxFileHeaderInfo *mHeaderInfo;
00315
00316 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00317 };
00318
00319 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00320
00321 #endif // FBXFILESDK_KFBXIO_KFBXIMPORTER_H
00322