kfbximporter.h

Go to the documentation of this file.
00001 
00004 #ifndef _FBXSDK_IMPORTER_H_
00005 #define _FBXSDK_IMPORTER_H_
00006 
00007 /**************************************************************************************
00008 
00009  Copyright © 2001 - 2007 Autodesk, Inc. and/or its licensors.
00010  All Rights Reserved.
00011 
00012  The coded instructions, statements, computer programs, and/or related material
00013  (collectively the "Data") in these files contain unpublished information
00014  proprietary to Autodesk, Inc. and/or its licensors, which is protected by
00015  Canada and United States of America federal copyright law and by international
00016  treaties.
00017 
00018  The Data may not be disclosed or distributed to third parties, in whole or in
00019  part, without the prior written consent of Autodesk, Inc. ("Autodesk").
00020 
00021  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00022  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
00023  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR ARISING
00024  BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES OF TITLE,
00025  NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR USE.
00026  WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT WARRANT THAT THE OPERATION
00027  OF THE DATA WILL BE UNINTERRUPTED OR ERROR FREE.
00028 
00029  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
00030  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR EXPENSES
00031  OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE DAMAGES OR OTHER
00032  SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS OF PROFITS, REVENUE
00033  OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR DAMAGES OF ANY KIND),
00034  HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF LIABILITY, WHETHER DERIVED
00035  FROM CONTRACT, TORT (INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE), OR OTHERWISE,
00036  ARISING OUT OF OR RELATING TO THE DATA OR ITS USE OR ANY OTHER PERFORMANCE,
00037  WHETHER OR NOT AUTODESK HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS
00038  OR DAMAGE.
00039 
00040 **************************************************************************************/
00041 
00042 
00043 #include <kaydaradef.h>
00044 #ifndef KFBX_DLL 
00045     #define KFBX_DLL K_DLLIMPORT
00046 #endif
00047 
00048 #include <kfbxio/kfbxio.h>
00049             
00050 #include <klib/kstring.h>
00051 #include <klib/karrayul.h>
00052 
00053 #include <kbaselib_forward.h>
00054 #ifndef MB_FBXSDK
00055 #include <kbaselib_nsuse.h>
00056 #endif
00057 
00058 #ifdef KARCH_DEV_MACOSX_CFM
00059     #include <CFURL.h>
00060     #include <Files.h>
00061 #endif
00062 
00063 #include <kfbxobject/kfbxobject_forward.h>
00064 #ifndef MB_FBXSDK
00065 #include <kfbxobject/kfbxobject_nsuse.h>
00066 #endif
00067 
00068 #include <fbxfilesdk_nsbegin.h>
00069 
00070 class KFbxScene;
00071 class KFbxImporterImp;
00072 class KFbxStreamOptionsFbx;
00073 class KFbxTakeInfo;
00074 class KFbxSceneInfo;
00075 class KFbxStreamOptionsFbxReader;
00076 
00077 
00086 class KFBX_DLL KFbxImporter : public KFbxIO
00087 {
00088     KFBXOBJECT_DECLARE(KFbxImporter);
00089 public:
00094 
00100     virtual bool Initialize(const char *pFileName);
00101 
00102 #ifdef KARCH_DEV_MACOSX_CFM
00103     virtual bool Initialize(const FSSpec &pMacFileSpec);
00104     virtual bool Initialize(const FSRef &pMacFileRef);
00105     virtual bool Initialize(const CFURLRef &pMacURL);
00106 #endif
00107 
00115     void GetFileVersion(int& pMajor, int& pMinor, int& pRevision);
00116 
00125     bool GetDefaultRenderResolution(KString& pCamName, KString& pResolutionMode, double& pW, double& pH);
00126 
00132     typedef enum 
00133     {
00134         eSTREAMOPTIONS_PARSE_FILE,
00135         eSTREAMOPTIONS_FAST,        // Do not parse the file
00136         eSTREAMOPTIONS_COUNT
00137     } EStreamOptionsGeneration;
00138 
00144     KFbxStreamOptions* GetImportOptions(EStreamOptionsGeneration pStreamOptionsGeneration = eSTREAMOPTIONS_PARSE_FILE); 
00145 
00151     KFbxStreamOptions* GetImportOptions(IFbxObject* pFbxObject);
00152 
00162     bool Import(KFbxScene& pScene, KFbxStreamOptions* pStreamOptions = NULL);   
00163 
00174     bool Import(KFbxScene& pScene, KFbxStreamOptions* pStreamOptions, IFbxObject* pFbxObject);
00175 
00179     void ReleaseImportOptions(KFbxStreamOptions* pStreamOptions);
00180 
00182 
00187     void SetPassword(char* pPassword);
00188 
00193     
00198     int GetTakeCount();
00199 
00206     KFbxTakeInfo* GetTakeInfo(int pIndex);
00207 
00212     char* GetCurrentTakeName();
00213 
00215 
00220 
00225     KFbxSceneInfo* GetSceneInfo();
00226 
00228 
00232 
00236     void SetFileFormat (int pFileFormat);
00237 
00241     int GetFileFormat ();
00242 
00245     bool IsFBX();
00247 
00249 //
00250 //  WARNING!
00251 //
00252 //  Anything beyond these lines may not be documented accurately and is 
00253 //  subject to change without notice.
00254 //
00256 
00257 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00258 
00259         bool UpdateImportOptions(KFbxStreamOptions* pStreamOptions);
00260 
00261 protected:
00262 
00263 
00264     void SetImportOptionsInfo(KFbxStreamOptionsFbxReader* pStreamOptionsFbx);
00265     void GetImportOptionsInfo(KFbxStreamOptionsFbxReader* pStreamOptionsFbx);
00266 
00267     KFbxImporter(KFbxSdkManager& pManager,char const* pName);
00268     virtual ~KFbxImporter();
00269 
00270     void Reset();
00271 
00272     bool FileOpen();
00273     void FileClose();
00274 
00275 
00276     bool IsNativeExtension ();
00277 
00278     KFbxImporterImp* mImp;
00279 
00280     bool mImportOptionsDone;
00281     KArrayTemplate<KFbxTakeInfo*> mTakeInfo;
00282     KFbxSceneInfo* mSceneInfo;
00283     KString mCurrentTakeName;
00284     int mMajorVersion;
00285     int mMinorVersion;
00286     int mRevisionVersion;
00287 
00288     // Used to retrieve the default render resolution
00289     // stored in the extended header
00290     bool    mDefaultCameraResolutionIsOK;
00291     KString mDefaultCameraName;
00292     KString mDefaultResolutionMode;
00293     double mDefaultResolutionW;
00294     double mDefaultResolutionH;
00295 
00296 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00297 
00298 };
00299 
00300 #include <fbxfilesdk_nsend.h>
00301 
00302 #endif // #ifndef _FBXSDK_IMPORTER_H_
00303 
00304