- Main Page
- Classes
- Files
- Directories

- File List
- File Members

# fbxiosettings.h

Go to the documentation of this file.

    00001 /****************************************************************************************
    00002
    00003    Copyright (C) 2013 Autodesk, Inc.
    00004    All rights reserved.
    00005
    00006    Use of this software is subject to the terms of the Autodesk license agreement
    00007    provided at the time of installation or download, or which otherwise accompanies
    00008    this software in either electronic or hard copy form.
    00009
    00010 ****************************************************************************************/
    00011
    00013 #ifndef _FBXSDK_FILEIO_IO_SETTINGS_H_
    00014 #define _FBXSDK_FILEIO_IO_SETTINGS_H_
    00015
    00016 #include <fbxsdk/fbxsdk_def.h>
    00017
    00018 #include <fbxsdk/core/fbxobject.h>
    00019 #include <fbxsdk/fileio/fbxiosettingspath.h>
    00020
    00021 #include <fbxsdk/fbxsdk_nsbegin.h>
    00022
    00023 //Undefine the macro mkdir, since it conflict with function mkdir in Qt\4.2.3\src\corelib\io\qdir.h
    00024 #if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(mkdir)
    00025     #undef mkdir
    00026 #endif
    00027
    00028 #define IOSVisible    true
    00029 #define IOSHidden     false
    00030
    00031 #define IOSSavable    true
    00032 #define IOSNotSavable false
    00033
    00034 #define IOSEnabled    true
    00035 #define IOSDisabled   false
    00036
    00037 #define IOSBinary     0
    00038 #define IOSASCII      1
    00039
    00040 class FbxManager;
    00041 class FbxIOSettings;
    00042
    00043 /*****************************************************************************************************************************
    00044 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
    00045 *****************************************************************************************************************************/
    00046 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00047 class FbxIOPropInfo
    00048 {
    00049 public:
    00050     FbxIOPropInfo();
    00051     ~FbxIOPropInfo();
    00052
    00053     void*           UIWidget;            // UI widget for showing the property
    00054     void*           cbValueChanged;      // call back when value changed
    00055     void*           cbDirty;             // call back when value changed
    00056     FbxStringList   labels;              // list of labels in many languages
    00057 };
    00058
    00059 class FBXSDK_DLL FbxIOInfo
    00060 {
    00061 public:
    00062     enum EImpExp {eImport, eExport};
    00063
    00064     FbxIOInfo();
    00065
    00066     void Reset(EImpExp pImpExp);
    00067     void SetTimeMode(FbxTime::EMode pTimeMode, double pCustomFrameRate = 0.0);
    00068     FbxTime::EMode GetTimeMode(){ return mTimeMode; }
    00069     FbxTime GetFramePeriod();
    00070     void SetASFScene(FbxObject* pASFScene, bool pASFSceneOwned = false);
    00071     FbxObject* GetASFScene(){ return mASFScene; }
    00072     void Set_IOS(FbxIOSettings* pIOS){ios = pIOS;}
    00073     void SetImportExportMode(EImpExp pImpExp){mImpExp = pImpExp;}
    00074
    00075 private:
    00076     FbxTime::EMode  mTimeMode;
    00077     FbxObject*      mASFScene;
    00078     EImpExp         mImpExp;
    00079     FbxIOSettings*  ios;
    00080 };
    00081 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
    00082
    00207 class FBXSDK_DLL FbxIOSettings : public FbxObject
    00208 {
    00209     FBXSDK_OBJECT_DECLARE(FbxIOSettings, FbxObject);
    00210
    00211 public:
    00213     enum ELanguage
    00214     {
    00215         eENU,
    00216         eDEU,
    00217         eFRA,
    00218         eJPN,
    00219         eKOR,
    00220         eCHS,
    00221         eLanguageCount
    00222     };
    00223
    00230     FbxProperty AddPropertyGroup(const char* pName, const FbxDataType& pDataType=FbxDataType(), const char* pLabel="");
    00231
    00242     FbxProperty AddPropertyGroup(const FbxProperty& pParentProperty, const char* pName, const FbxDataType& pDataType = FbxDataType(),
    00243                                   const char* pLabel  = "", bool pVisible = true, bool pSavable = true, bool pEnabled = true );
    00244
    00256     FbxProperty AddProperty(const FbxProperty& pParentProperty, const char* pName, const FbxDataType& pDataType = FbxDataType(),
    00257                              const char* pLabel = "", const void* pValue = NULL, bool pVisible = true,
    00258                              bool pSavable = true, bool pEnabled = true );
    00259
    00275     FbxProperty AddPropertyMinMax(const FbxProperty& pParentProperty, const char* pName, const FbxDataType& pDataType = FbxDataType(),
    00276                                    const char* pLabel = "", const void* pValue = NULL, const double* pMinValue = NULL, const double* pMaxValue = NULL,
    00277                                    bool pVisible = true, bool pSavable = true, bool pEnabled = true );
    00278
    00279
    00286     FbxProperty GetProperty(const char* pName) const;
    00287
    00294     FbxProperty GetProperty(const FbxProperty& pParentProperty, const char* pName) const;
    00295
    00301     bool GetBoolProp(const char* pName, bool pDefValue) const;
    00302
    00307     void SetBoolProp(const char* pName, bool pValue);
    00308
    00314     double GetDoubleProp(const char* pName, double pDefValue) const;
    00315
    00320     void   SetDoubleProp(const char* pName, double pValue);
    00321
    00327     int    GetIntProp(const char* pName, int pDefValue) const;
    00328
    00333     void   SetIntProp(const char* pName, int pValue);
    00334
    00339     FbxTime  GetTimeProp(const char* pName, FbxTime pDefValue) const;
    00340
    00346     void   SetTimeProp(const char* pName, FbxTime pValue);
    00347
    00366
    00372     FbxString GetEnumProp(const char* pName, FbxString pDefValue) const;
    00373
    00379     int     GetEnumProp(const char* pName, int pDefValue) const;
    00380
    00386     int     GetEnumIndex(const char* pName, FbxString pValue) const;
    00387
    00393     void    SetEnumProp(const char* pName, FbxString pValue);
    00394
    00400     void    SetEnumProp(const char* pName, int pValue);
    00401
    00409     void    RemoveEnumPropValue(const char* pName, FbxString pValue);
    00410
    00414     void    EmptyEnumProp(const char* pName);
    00415
    00421     bool    IsEnumExist(FbxProperty& pProp, const FbxString& enumString) const;
    00422
    00429     int     GetEnumIndex(FbxProperty& pProp, const FbxString& enumString, bool pNoCase = false) const;
    00431
    00438     bool    SetFlag(const char* pName, FbxPropertyAttr::EFlags propFlag, bool pValue);
    00439
    00445     FbxString GetStringProp(const char* pName, FbxString pDefValue) const;
    00446
    00451     void    SetStringProp(const char* pName, FbxString pValue);
    00452
    00455
    00460     virtual bool ReadXMLFile(const FbxString& path);
    00461
    00467     virtual bool WriteXMLFile(const FbxString& path);
    00468
    00475     bool WriteXmlPropToFile(const FbxString& pFullPath, const FbxString& propPath);
    00477
    00478 /*****************************************************************************************************************************
    00479 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
    00480 *****************************************************************************************************************************/
    00481 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00482     FbxIOPropInfo* GetPropInfo(FbxProperty &pProp);
    00483
    00484     ELanguage UILanguage;
    00485     FbxString GetLanguageLabel(FbxProperty& pProp);
    00486     void SetLanguageLabel(FbxProperty& pProp, FbxString& pLabel);
    00487     ELanguage Get_Max_Runtime_Language(FbxString pRegLocation);
    00488
    00489     FbxIOInfo impInfo;
    00490     FbxIOInfo expInfo;
    00491
    00492     static FbxString GetUserMyDocumentDir();
    00493     void SetPropVisible(FbxProperty& pProp, bool pWithChildren, bool pVisible);
    00494
    00495             // Read an XML file from MyDocument dir
    00496     bool ReadXmlPropFromMyDocument(const FbxString& subDir, const FbxString& filename);
    00497
    00498             // Write property branch to an XML file in MyDocument dir
    00499     bool WriteXmlPropToMyDocument(const FbxString& subDir, const FbxString& filename, const FbxString& propPath);
    00500
    00501     static const char* GetFileMergeDescription(int pIndex);
    00502
    00503     enum ELoadMode
    00504     {
    00505         eCreate,
    00506         eMerge,
    00507         eExclusiveMerge
    00508     };
    00509
    00510
    00511     enum EQuaternionMode   { eAsQuaternion, eAsEuler, eResample };
    00512     enum EObjectDerivation { eByLayer, eByEntity, eByBlock };
    00513
    00514     enum ESysUnits
    00515     {
    00516         eUnitsUser,
    00517         eUnitsInches,
    00518         eUnitsFeet,
    00519         eUnitYards,
    00520         eUnitsMiles,
    00521         eUnitsMillimeters,
    00522         eUnitsCentimeters,
    00523         eUnitsMeters,
    00524         eUnitsKilometers
    00525     };
    00526
    00527     enum ESysFrameRate
    00528     {
    00529         eFrameRateUser,
    00530         eFrameRateHours,
    00531         eFrameRateMinutes,
    00532         eFrameRateSeconds,
    00533         eFrameRateMilliseconds,
    00534         eFrameRateGames15,
    00535         eFrameRateFilm24,
    00536         eFrameRatePAL25,
    00537         eFrameRateNTSC30,
    00538         eFrameRateShowScan48,
    00539         eFrameRatePALField50,
    00540         eFrameRateNTSCField60
    00541     };
    00542
    00543 // Max
    00544     enum EEnveloppeSystem
    00545     {
    00546         eSkinModifier,
    00547         ePhysic,
    00548         eBonePro,
    00549         eEnveloppeSystemCount
    00550     };
    00551
    00552 // Max
    00553     enum EGeometryType
    00554     {
    00555         eTriangle,
    00556         eSimplifiedPoly,
    00557         ePolygon,
    00558         eNurbs,
    00559         ePatch,
    00560         eGeometryTypeCount
    00561     };
    00562
    00563 // Maya IK type
    00564     enum EIKType
    00565     {
    00566         eNone,
    00567         eFBIK,
    00568         eHumanIK
    00569     };
    00570
    00571 protected:
    00572     virtual void Construct(const FbxIOSettings* pFrom);
    00573     virtual void ConstructProperties(bool pForceSet);
    00574     virtual void Destruct(bool pRecursive);
    00575
    00576 private:
    00577     void AddNewPropInfo(FbxProperty& pProp);
    00578     void DeletePropInfo(FbxProperty& pProp);
    00579     void DeleteAllPropInfo(FbxProperty& pProp);
    00580 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
    00581 };
    00582
    00583 #include <fbxsdk/fbxsdk_nsend.h>
    00584
    00585 #endif /* _FBXSDK_FILEIO_IO_SETTINGS_H_ */