- Main Page
- Classes
- Files
- Directories
- Examples

- File List
- File Members

# fbxiosettings.h

Go to the documentation of this file.

    00001 /****************************************************************************************
    00002
    00003    Copyright (C) 2012 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/base/fbxarray.h>
    00019 #include <fbxsdk/core/base/fbxstring.h>
    00020 #include <fbxsdk/core/fbxobject.h>
    00021
    00022 // undef the macro mkdir, since it conflict with function mkdir in Qt\4.2.3\src\corelib\io\qdir.h
    00023 #if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(mkdir)
    00024     #undef mkdir
    00025 #endif
    00026
    00027 #include <fbxsdk/core/fbxpropertytypes.h>
    00028
    00029 #include <fbxsdk/fileio/fbxiosettingspath.h>
    00030
    00031 #include <fbxsdk/fbxsdk_nsbegin.h>
    00032
    00033 #define IOSVisible    true
    00034 #define IOSHidden     false
    00035
    00036 #define IOSSavable    true
    00037 #define IOSNotSavable false
    00038
    00039 #define IOSEnabled    true
    00040 #define IOSDisabled   false
    00041
    00042 #define IOSBinary     0
    00043 #define IOSASCII      1
    00044
    00045 class FbxIOSettings;
    00046
    00047 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00048
    00051 class FBXSDK_DLL FbxIOInfo
    00052 {
    00053 public:
    00054     enum EImpExp
    00055     {
    00056         eImport,
    00057         eExport
    00058     };
    00059
    00060 public:
    00062     FbxIOInfo();
    00063
    00065     void Reset(EImpExp pImpExp);
    00066
    00068     void SetTimeMode(FbxTime::EMode pTimeMode, double pCustomFrameRate = 0.0);
    00069
    00071     FbxTime::EMode GetTimeMode(){ return mTimeMode; }
    00072
    00074     FbxTime GetFramePeriod();
    00075
    00076     void SetASFScene(FbxObject* pASFScene, bool pASFSceneOwned = false);
    00077     FbxObject* GetASFScene(){ return mASFScene; }
    00078
    00079     void Set_IOS(FbxIOSettings* pIOS){ios = pIOS;}
    00080
    00082     void SetImportExportMode(EImpExp pImpExp){mImpExp = pImpExp;}
    00083
    00084 private:
    00085
    00086     FbxTime::EMode mTimeMode;
    00087     FbxObject* mASFScene;
    00088
    00089     EImpExp mImpExp;
    00090
    00091     FbxIOSettings* ios;
    00092 };
    00093
    00094 #endif // DOXYGEN_SHOULD_SKIP_THIS
    00095
    00096 class FbxManager;
    00097
    00098 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00099
    00102 // http://www.microsoft.com/globaldev/reference/winxp/langtla.mspx
    00103
    00104 //  LOCALE                            TLA  LCID
    00105
    00106 //  English - United States           ENU  0409
    00107 //  German - Germany                  DEU  0407
    00108 //  French - France                   FRA  040c
    00109 //  Japanese - Japan                  JPN  0411
    00110 //  Korean(Extended Wansung) - Korea  KOR  0412
    00111 //  Chinese - PRC                     CHS  0804
    00112
    00113 enum EFbxUILanguage
    00114 {
    00115     eENU = 0,                   // MAX 409 English - United States
    00116     eDEU,                       // MAX 407 German - Germany
    00117     eFRA,                       // MAX 40c French - France
    00118     eJPN,                       // MAX 411 Japanese - Japan
    00119     eKOR,                       // MAX 412 Korean(Extended Wansung) - Korea
    00120     eCHS,                       // MAX 804 Chinese - PRC
    00121     eFbxUILanguageCount
    00122 };
    00123
    00124 // this class is located in the UserDataPtr of each FbxIOSettings properties
    00125 class PropInfo
    00126 {
    00127 public:
    00128     PropInfo();
    00129     ~PropInfo();
    00130
    00131     void*           UIWidget;            // UI widget for showing the property
    00132     void*           cbValueChanged;      // call back when value changed
    00133     void*           cbDirty;             // call back when value changed
    00134     FbxStringList   labels;              // list of labels in many languages
    00135 };
    00136 #endif // DOXYGEN_SHOULD_SKIP_THIS
    00137
    00262 class FBXSDK_DLL FbxIOSettings : public FbxObject
    00263 {
    00264     FBXSDK_OBJECT_DECLARE(FbxIOSettings,FbxObject);
    00265
    00266 public:
    00267
    00272     virtual void Destruct(bool pRecursive, bool pDependents);
    00273
    00280     FbxProperty AddPropertyGroup(const char* pName, const FbxDataType& pDataType=FbxDataType(), const char* pLabel="");
    00281
    00292     FbxProperty AddPropertyGroup(const FbxProperty& pParentProperty, const char* pName, const FbxDataType& pDataType = FbxDataType(),
    00293                                   const char* pLabel  = "", bool pVisible = true, bool pSavable = true, bool pEnabled = true );
    00294
    00306     FbxProperty AddProperty(const FbxProperty& pParentProperty, const char* pName, const FbxDataType& pDataType = FbxDataType(),
    00307                              const char* pLabel = "", const void* pValue = NULL, bool pVisible = true,
    00308                              bool pSavable = true, bool pEnabled = true );
    00309
    00325     FbxProperty AddPropertyMinMax(const FbxProperty& pParentProperty, const char* pName, const FbxDataType& pDataType = FbxDataType(),
    00326                                    const char* pLabel = "", const void* pValue = NULL, const double* pMinValue = NULL, const double* pMaxValue = NULL,
    00327                                    bool pVisible = true, bool pSavable = true, bool pEnabled = true );
    00328
    00329
    00336     FbxProperty GetProperty(const char* pName) const;
    00337
    00344     FbxProperty GetProperty(const FbxProperty& pParentProperty, const char* pName) const;
    00345
    00351     bool GetBoolProp(const char* pName, bool pDefValue) const;
    00352
    00357     void SetBoolProp(const char* pName, bool pValue);
    00358
    00364     double GetDoubleProp(const char* pName, double pDefValue) const;
    00365
    00370     void   SetDoubleProp(const char* pName, double pValue);
    00371
    00377     int    GetIntProp(const char* pName, int pDefValue) const;
    00378
    00383     void   SetIntProp(const char* pName, int pValue);
    00384
    00389     FbxTime  GetTimeProp(const char* pName, FbxTime pDefValue) const;
    00390
    00396     void   SetTimeProp(const char* pName, FbxTime pValue);
    00397
    00416
    00422     FbxString GetEnumProp(const char* pName, FbxString pDefValue) const;
    00423
    00429     int     GetEnumProp(const char* pName, int pDefValue) const;
    00430
    00436     int     GetEnumIndex(const char* pName, FbxString pValue) const;
    00437
    00443     void    SetEnumProp(const char* pName, FbxString pValue);
    00444
    00450     void    SetEnumProp(const char* pName, int pValue);
    00451
    00459     void    RemoveEnumPropValue(const char* pName, FbxString pValue);
    00460
    00464     void    EmptyEnumProp(const char* pName);
    00465
    00471     bool    IsEnumExist(FbxProperty& pProp, const FbxString& enumString) const;
    00472
    00479     int     GetEnumIndex(FbxProperty& pProp, const FbxString& enumString, bool pNoCase = false) const;
    00481
    00488     bool    SetFlag(const char* pName, FbxPropertyAttr::EFlags propFlag, bool pValue);
    00489
    00495     FbxString GetStringProp(const char* pName, FbxString pDefValue) const;
    00496
    00501     void    SetStringProp(const char* pName, FbxString pValue);
    00502
    00505
    00510     virtual bool ReadXMLFile(const FbxString& path);
    00511
    00517     virtual bool WriteXMLFile(const FbxString& path);
    00518
    00525     bool WriteXmlPropToFile(const FbxString& pFullPath, const FbxString& propPath);
    00527
    00529 //
    00530 //  WARNING!
    00531 //
    00532 //  Anything beyond these lines may not be documented accurately and is
    00533 //  subject to change without notice.
    00534 //
    00536 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00537 public:
    00538     PropInfo* GetPropInfo(FbxProperty &pProp);
    00539
    00540     EFbxUILanguage UILanguage;
    00541     FbxString GetLanguageLabel(FbxProperty& pProp);
    00542     void SetLanguageLabel(FbxProperty& pProp, FbxString& pLabel);
    00543     EFbxUILanguage Get_Max_Runtime_Language(FbxString pRegLocation);
    00544
    00545     FbxIOInfo impInfo;
    00546     FbxIOInfo expInfo;
    00547
    00548     static FbxString GetUserMyDocumentDir();
    00549     void SetPropVisible(FbxProperty& pProp, bool pWithChildren, bool pVisible);
    00550
    00551     virtual bool ConstructProperties(bool pForceSet);
    00552
    00553             // Read an XML file from MyDocument dir
    00554     bool ReadXmlPropFromMyDocument(const FbxString& subDir, const FbxString& filename);
    00555
    00556             // Write property branch to an XML file in MyDocument dir
    00557     bool WriteXmlPropToMyDocument(const FbxString& subDir, const FbxString& filename, const FbxString& propPath);
    00558
    00559     static const char* GetFileMergeDescription(int pIndex);
    00560
    00561     enum ELoadMode
    00562     {
    00563         eCreate,
    00564         eMerge,
    00565         eExclusiveMerge
    00566     };
    00567
    00568
    00569     enum EQuaternionMode   { eAsQuaternion, eAsEuler, eResample };
    00570     enum EObjectDerivation { eByLayer, eByEntity, eByBlock };
    00571
    00572     enum ESysUnits
    00573     {
    00574         eUnitsUser,
    00575         eUnitsInches,
    00576         eUnitsFeet,
    00577         eUnitYards,
    00578         eUnitsMiles,
    00579         eUnitsMillimeters,
    00580         eUnitsCentimeters,
    00581         eUnitsMeters,
    00582         eUnitsKilometers
    00583     };
    00584
    00585     enum ESysFrameRate
    00586     {
    00587         eFrameRateUser,
    00588         eFrameRateHours,
    00589         eFrameRateMinutes,
    00590         eFrameRateSeconds,
    00591         eFrameRateMilliseconds,
    00592         eFrameRateGames15,
    00593         eFrameRateFilm24,
    00594         eFrameRatePAL25,
    00595         eFrameRateNTSC30,
    00596         eFrameRateShowScan48,
    00597         eFrameRatePALField50,
    00598         eFrameRateNTSCField60
    00599     };
    00600
    00601 // Max
    00602     enum EEnveloppeSystem
    00603     {
    00604         eSkinModifier,
    00605         ePhysic,
    00606         eBonePro,
    00607         eEnveloppeSystemCount
    00608     };
    00609
    00610 // Max
    00611     enum EGeometryType
    00612     {
    00613         eTriangle,
    00614         eSimplifiedPoly,
    00615         ePolygon,
    00616         eNurbs,
    00617         ePatch,
    00618         eGeometryTypeCount
    00619     };
    00620
    00621 // Maya IK type
    00622     enum EIKType
    00623     {
    00624         eNone,
    00625         eFBIK,
    00626         eHumanIK
    00627     };
    00628
    00629 protected:
    00630     FbxIOSettings(FbxManager& pManager,const char* pName);
    00631
    00632 private:
    00633     void AddNewPropInfo(FbxProperty& pProp);
    00634     void DeletePropInfo(FbxProperty& pProp);
    00635     void DeleteAllPropInfo(FbxProperty& pProp);
    00636
    00637 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00638 };
    00639
    00640 #include <fbxsdk/fbxsdk_nsend.h>
    00641
    00642 #endif /* _FBXSDK_FILEIO_IO_SETTINGS_H_ */