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 
00118     virtual bool Initialize(const char *pFileName, const int pFileFormat = -1);
00119 
00128     virtual bool Initialize(KFile * pFile, const int pFileFormat = -1);
00129 
00130 #ifdef KARCH_DEV_MACOSX_CFM
00131     virtual bool Initialize(const FSSpec &pMacFileSpec);
00132     virtual bool Initialize(const FSRef &pMacFileRef);
00133     virtual bool Initialize(const CFURLRef &pMacURL);
00134 #endif
00135 
00139     virtual KFile * GetFile();
00140 
00148     void GetFileVersion(int& pMajor, int& pMinor, int& pRevision);
00149 
00158     bool GetDefaultRenderResolution(KString& pCamName, KString& pResolutionMode, double& pW, double& pH);
00159 
00163     KFbxFileHeaderInfo* GetFileHeaderInfo();
00164 
00170     typedef enum 
00171     {
00172         eSTREAMOPTIONS_PARSE_FILE,
00173         eSTREAMOPTIONS_FAST,        
00174         eSTREAMOPTIONS_COUNT
00175     } EStreamOptionsGeneration;
00176 
00182     KFbxStreamOptions* GetImportOptions(EStreamOptionsGeneration pStreamOptionsGeneration = eSTREAMOPTIONS_PARSE_FILE); 
00183 
00189     KFbxStreamOptions* GetImportOptions(KFbx* pFbxObject);
00190 
00200     bool Import(KFbxDocument* pDocument, KFbxStreamOptions* pStreamOptions = NULL); 
00201 
00205     void ReleaseImportOptions(KFbxStreamOptions* pStreamOptions);
00206 
00208 
00213     void SetPassword(char* pPassword);
00214 
00219     
00224     int GetTakeCount();
00225 
00232     KFbxTakeInfo* GetTakeInfo(int pIndex);
00233 
00238     char* GetCurrentTakeName();
00239 
00241 
00246 
00251     KFbxDocumentInfo* GetSceneInfo();
00252 
00254 
00258 
00262     K_DEPRECATED void SetFileFormat (int pFileFormat);
00263 
00267     int GetFileFormat ();
00268 
00271     bool IsFBX();
00273 
00275 
00276 
00277 
00278 
00279 
00280 
00282 
00283     void ParseForGlobalSettings(bool pState);
00284     bool GetAxisInfo(KFbxAxisSystem* pAxisSystem, KFbxSystemUnit* pSystemUnits);
00285 
00286     void ParseForStatistics(bool pState);
00287     bool GetStatistics(KFbxStatistics* pStatistics);
00288 
00289 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00290     bool UpdateImportOptions(KFbxStreamOptions* pStreamOptions);
00291 
00292     
00293     bool Import(KFbxDocument* pDocument, KFbxStreamOptions* pStreamOptions, KFbx* pFbxObject);
00294 
00295 protected:
00296     void SetImportOptionsInfo(KFbxStreamOptionsFbxReader* pStreamOptionsFbx);
00297     void GetImportOptionsInfo(KFbxStreamOptionsFbxReader* pStreamOptionsFbx);
00298     
00299     KFbxImporter(KFbxSdkManager& pManager,char const* pName);
00300     virtual void Destruct(bool pRecursive, bool pDependents);
00301 
00302     void Reset();
00303 
00304     bool FileOpen(KFile* pFile = NULL);
00305     void FileClose();
00306     
00307     bool IsNativeExtension ();
00308 
00309     KFbxImporterImp*                mImp;
00310     KFile*                          mFile;
00311     bool                            mImportOptionsDone;
00312     KArrayTemplate<KFbxTakeInfo*>   mTakeInfo;
00313     KFbxDocumentInfo*               mSceneInfo;
00314     KString                         mCurrentTakeName;
00315     int                             mMajorVersion;
00316     int                             mMinorVersion;
00317     int                             mRevisionVersion;
00318     KFbxFileHeaderInfo              *mHeaderInfo;
00319 
00320 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00321 };
00322 
00323 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00324 
00325 #endif // FBXFILESDK_KFBXIO_KFBXIMPORTER_H
00326