00001
00004 #ifndef FBXFILESDK_KFBXIO_KFBXIOSETTINGS_H
00005 #define FBXFILESDK_KFBXIO_KFBXIOSETTINGS_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 #include <fbxfilesdk/fbxfilesdk_def.h>
00042
00043 #include <fbxfilesdk/components/kbaselib/klib/karrayul.h>
00044 #include <fbxfilesdk/components/kbaselib/klib/kstring.h>
00045
00046 #include <fbxfilesdk/kfbxplugins/kfbxobject.h>
00047
00048 #include <fbxfilesdk/components/libxml2-2.6.4/libxml.h>
00049 #include <fbxfilesdk/components/libxml2-2.6.4/include/libxml/parser.h>
00050 #include <fbxfilesdk/components/libxml2-2.6.4/include/libxml/tree.h>
00051 #include <fbxfilesdk/components/libxml2-2.6.4/include/libxml/globals.h>
00052
00053
00054
00055 #if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(mkdir)
00056 #undef mkdir
00057 #endif
00058
00059 #include <fbxfilesdk/kfbxplugins/kfbxtypes.h>
00060
00061 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00062
00063 #include <fbxfilesdk/kfbxio/kfbxiosettingspath.h>
00064
00065 #define IOSVisible true
00066 #define IOSHidden false
00067
00068 #define IOSSavable true
00069 #define IOSNotSavable false
00070
00071 #define IOSEnabled true
00072 #define IOSDisabled false
00073
00074 #define IOSBinary 0
00075 #define IOSASCII 1
00076
00077 class KFbxIOSettings;
00078
00079 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00080
00082 class KsoInfo
00083 {
00084
00085 public: enum EIMPEXP
00086 {
00087 eIMPORT = 0,
00088 eEXPORT
00089 };
00090
00091 public:
00093 KsoInfo();
00094
00096 void Reset(EIMPEXP pImpExp);
00097
00099 void SetTimeMode(KTime::ETimeMode pTimeMode, double pCustomFrameRate = 0.0);
00100
00102 KTime::ETimeMode GetTimeMode(){ return mTimeMode; }
00103
00105 KTime GetFramePeriod();
00106
00107 void SetASFScene(KFbxObject* pASFScene, bool pASFSceneOwned = false);
00108 KFbxObject* GetASFScene(){ return mASFScene; }
00109
00110 void Set_IOS(KFbxIOSettings *pios){ios = pios;}
00111
00112
00113 private:
00114
00115 KTime::ETimeMode mTimeMode;
00116 KFbxObject * mASFScene;
00117
00118 EIMPEXP mImpExp;
00119
00120 KFbxIOSettings *ios;
00121 };
00122
00123 #endif // DOXYGEN_SHOULD_SKIP_THIS
00124
00125 class KFbxSdkManager;
00126
00127 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00128
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142 enum FBXUILANGUAGE
00143 {
00144 eENU = 0,
00145 eDEU,
00146 eFRA,
00147 eJPN,
00148 eKOR,
00149 eCHS,
00150 eFBXUILANGUAGE_COUNT
00151 };
00152
00153
00154 class PropInfo
00155 {
00156 public:
00157 PropInfo();
00158 ~PropInfo();
00159
00160 void * UIWidget;
00161 void * cbValueChanged;
00162 void * cbDirty;
00163 KStringList labels;
00164 };
00165 #endif // DOXYGEN_SHOULD_SKIP_THIS
00166
00291 class KFBX_DLL KFbxIOSettings : public KFbxObject
00292 {
00293 KFBXOBJECT_DECLARE(KFbxIOSettings,KFbxObject);
00294
00295 public:
00296
00301 virtual void Destruct(bool pRecursive, bool pDependents);
00302
00309 KFbxProperty AddPropertyGroup(char const* pName, KFbxDataType const &pDataType=KFbxDataType(), char const* pLabel="");
00310
00321 KFbxProperty AddPropertyGroup( KFbxProperty const &pParentProperty,
00322 char const* pName,
00323 KFbxDataType const &pDataType = KFbxDataType(),
00324 char const* pLabel = "",
00325 bool pVisible = true,
00326 bool pSavable = true,
00327 bool pEnabled = true
00328 );
00329
00342 KFbxProperty AddProperty( KFbxProperty const &pParentProperty,
00343 char const* pName,
00344 KFbxDataType const &pDataType = KFbxDataType(),
00345 char const* pLabel = "",
00346 void const* pValue = NULL,
00347 EFbxType pValueType = eUNIDENTIFIED,
00348 bool pVisible = true,
00349 bool pSavable = true,
00350 bool pEnabled = true
00351 );
00352
00368 KFbxProperty AddPropertyMinMax( KFbxProperty const &pParentProperty,
00369 char const* pName,
00370 KFbxDataType const &pDataType = KFbxDataType(),
00371 char const* pLabel = "",
00372 void const* pValue = NULL,
00373 double const* pMinValue = NULL,
00374 double const* pMaxValue = NULL,
00375 EFbxType pValueType = eUNIDENTIFIED,
00376 bool pVisible = true,
00377 bool pSavable = true,
00378 bool pEnabled = true
00379 );
00380
00381
00388 KFbxProperty GetProperty(char const* pName) const;
00389
00396 KFbxProperty GetProperty(KFbxProperty const &pParentProperty, char const* pName) const;
00397
00403 bool GetBoolProp(char const* pName, bool pDefValue) const;
00404
00409 void SetBoolProp(char const* pName, bool pValue);
00410
00416 double GetDoubleProp(char const* pName, double pDefValue) const;
00417
00422 void SetDoubleProp(char const* pName, double pValue);
00423
00429 int GetIntProp(char const* pName, int pDefValue) const;
00430
00435 void SetIntProp(char const* pName, int pValue);
00436
00441 KTime GetKTimeProp(char const* pName, KTime pDefValue) const;
00442
00448 void SetKTimeProp(char const* pName, KTime pValue);
00449
00468
00474 KString GetEnumProp(char const* pName, KString pDefValue) const;
00475
00481 int GetEnumProp(char const* pName, int pDefValue) const;
00482
00488 int GetEnumIndex(char const* pName, KString pValue) const;
00489
00495 void SetEnumProp(char const* pName, KString pValue);
00496
00502 void SetEnumProp(char const* pName, int pValue);
00503
00511 void RemoveEnumPropValue(char const* pName, KString pValue);
00512
00516 void EmptyEnumProp(char const* pName);
00517
00523 bool IsEnumExist(KFbxProperty& pProp, KString& enumString) const;
00524
00531 int GetEnumIndex(KFbxProperty& pProp, KString& enumString, bool pNoCase = false) const;
00533
00540 bool SetFlag(char const* pName, FbxPropertyFlags::eFbxPropertyFlags propFlag, bool pValue);
00541
00547 KString GetStringProp(char const* pName, KString pDefValue) const;
00548
00553 void SetStringProp(char const* pName, KString pValue);
00554
00557
00562 virtual bool ReadXMLFile(KString& path);
00563
00569 virtual bool WriteXMLFile(KString& path);
00570
00577 bool WriteXmlPropToFile(KString& pFullPath, KString& propPath);
00579
00581
00582
00583
00584
00585
00586
00588 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00589 public:
00590 PropInfo * GetPropInfo(KFbxProperty &pProp);
00591
00592 FBXUILANGUAGE UILanguage;
00593 KString GetLanguageLabel(KFbxProperty &pProp);
00594 void SetLanguageLabel(KFbxProperty &pProp, KString &pLabel);
00595 FBXUILANGUAGE Get_Max_Runtime_Language(KString regLocation);
00596
00597 KsoInfo impInfo;
00598 KsoInfo expInfo;
00599
00600 static KString GetUserMyDocumentDir();
00601 void SetPropVisible(KFbxProperty &pProp, bool pWithChildren, bool pVisible);
00602
00603 virtual bool ConstructProperties(bool pForceSet);
00604
00605
00606 bool ReadXmlPropFromMyDocument(KString& subDir, KString& filename);
00607
00608
00609 bool WriteXmlPropToMyDocument(KString& subDir, KString& filename, KString& propPath);
00610
00611 static const char * GetFileMergeDescription(int pIndex);
00612
00613 enum ELoadMode
00614 {
00615 eCREATE,
00616 eMERGE,
00617 eEXCLUSIVE_MERGE
00618 };
00619
00620
00621 enum EQuaternionMode { eAS_QUATERNION, eAS_EULER, eRESAMPLE };
00622 enum EObjectDerivation { eBY_LAYER, eBY_ENTITY, eBY_BLOCK };
00623
00624 enum ESysUnits
00625 {
00626 kUNITS_USER,
00627 kUNITS_INCHES,
00628 kUNITS_FEET,
00629 kUNITS_YARDS,
00630 kUNITS_MILES,
00631 kUNITS_MILLIMETERS,
00632 kUNITS_CENTIMETERS,
00633 kUNITS_METERS,
00634 kUNITS_KILOMETERS
00635 };
00636
00637 enum ESysFrameRate
00638 {
00639 kFRAMERATE_USER,
00640 kFRAMERATE_HOURS,
00641 kFRAMERATE_MINUTES,
00642 kFRAMERATE_SECONDS,
00643 kFRAMERATE_MILLISECONDS,
00644 kFRAMERATE_GAMES_15,
00645 kFRAMERATE_FILM_24,
00646 kFRAMERATE_PAL_25,
00647 kFRAMERATE_NTSC_30,
00648 kFRAMERATE_SHOWSCAN_48,
00649 kFRAMERATE_PALFIELD_50,
00650 kFRAMERATE_NTSCFIELD_60
00651 };
00652
00653
00654 enum EEnveloppeSystem
00655 {
00656 eSKIN_MODIFIER,
00657 ePHYSIQUE,
00658 eBONESPRO,
00659 eENVELOPPE_SYSTEM_COUNT
00660 };
00661
00662
00663 enum EGeometryType
00664 {
00665 eTRIANGLE,
00666 eSIMPLIFIED_POLY,
00667 ePOLY,
00668 eNURB,
00669 ePATCH,
00670 eGEOMETRY_TYPE_COUNT
00671 };
00672
00673
00674 enum EIKType
00675 {
00676 eNONE,
00677 eFBIK,
00678 eHUMANIK
00679 };
00680
00681 protected:
00682 KFbxIOSettings(KFbxSdkManager& pManager,char const* pName);
00683
00684 private:
00685
00686 KString* GetAttributeFromXmlNode(xmlNode* node, KString* attName);
00687
00688
00689 KString* GetInnerTextXmlNode(xmlNode* node);
00690
00691 void CreatePropRecursive(xmlNode* pNode, KFbxProperty& pPropParent);
00692
00693 xmlNode* GetChildXmlNode(xmlNode* parent, KString* nodeName);
00694 xmlNode* AddChildXmlNode(xmlNode* parent, KString* nodeName, KString* nodeValue = NULL);
00695 xmlAttr* AddAttributeToXmlNode(xmlNode* node, KString* attName, KString* attValue = NULL);
00696
00697 void AddNewPropInfo(KFbxProperty &pProp);
00698 void DeletePropInfo(KFbxProperty &pProp);
00699 void DeleteAllPropInfo(KFbxProperty &pProp);
00700
00701
00702 void AddXMLProp(KFbxProperty& pProp, xmlNodePtr pParent, xmlDocPtr pXmlDoc);
00703
00704
00705 xmlNodePtr GetXMLNode(KFbxProperty& pProp);
00706 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00707 };
00708
00709 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00710
00711 #endif // FBXFILESDK_KFBXIO_KFBXIOSETTINGS_H
00712