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 #if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(mkdir)
00055 #undef mkdir
00056 #endif
00057
00058 #include <fbxfilesdk/kfbxplugins/kfbxtypes.h>
00059
00060 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00061
00062 #include <fbxfilesdk/kfbxio/kfbxiosettingspath.h>
00063
00064 #define IOSVisible true
00065 #define IOSHidden false
00066
00067 #define IOSSavable true
00068 #define IOSNotSavable false
00069
00070 #define IOSEnabled true
00071 #define IOSDisabled false
00072
00073 #define IOSBinary 0
00074 #define IOSASCII 1
00075
00076 class KFbxIOSettings;
00077
00078
00079 class KsoInfo
00080 {
00081
00082 public: enum EIMPEXP
00083 {
00084 eIMPORT = 0,
00085 eEXPORT
00086 };
00087
00088 public:
00090 KsoInfo();
00091
00093 void Reset(EIMPEXP pImpExp);
00094
00096 void SetTimeMode(KTime::ETimeMode pTimeMode, double pCustomFrameRate = 0.0);
00097
00099 KTime::ETimeMode GetTimeMode(){ return mTimeMode; }
00100
00102 KTime GetFramePeriod();
00103
00104 void SetASFScene(KFbxObject* pASFScene, bool pASFSceneOwned = false);
00105 KFbxObject* GetASFScene(){ return mASFScene; }
00106
00107 void Set_IOS(KFbxIOSettings *pios){ios = pios;}
00108
00109
00110
00111
00112 private:
00113 KTime::ETimeMode mTimeMode;
00114 KFbxObject * mASFScene;
00115
00116 EIMPEXP mImpExp;
00117
00118 KFbxIOSettings *ios;
00119 };
00120
00121 class KFbxSdkManager;
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135 enum FBXUILANGUAGE
00136 {
00137 eENU = 0,
00138 eDEU,
00139 eFRA,
00140 eJPN,
00141 eKOR,
00142 eCHS,
00143 eFBXUILANGUAGE_COUNT
00144 };
00145
00146
00147 class PropInfo
00148 {
00149 public:
00150 PropInfo();
00151 ~PropInfo();
00152
00153 void * UIWidget;
00154 void * cbValueChanged;
00155 void * cbDirty;
00156 KStringList labels;
00157 };
00158
00165 class KFBX_DLL KFbxIOSettings : public KFbxObject
00166 {
00167 KFBXOBJECT_DECLARE(KFbxIOSettings,KFbxObject);
00168
00169 public:
00170 virtual void Destruct(bool pRecursive, bool pDependents);
00171
00177 KFbxProperty AddPropertyGroup(char const* pName, KFbxDataType const &pDataType=KFbxDataType(), char const* pLabel="");
00178
00188 public: KFbxProperty AddPropertyGroup( KFbxProperty const &pParentProperty,
00189 char const* pName,
00190 KFbxDataType const &pDataType = KFbxDataType(),
00191 char const* pLabel = "",
00192 bool pVisible = true,
00193 bool pSavable = true,
00194 bool pEnabled = true
00195 );
00196
00208 public: KFbxProperty AddProperty( KFbxProperty const &pParentProperty,
00209 char const* pName,
00210 KFbxDataType const &pDataType = KFbxDataType(),
00211 char const* pLabel = "",
00212 void const* pValue = NULL,
00213 EFbxType pValueType = eUNIDENTIFIED,
00214 bool pVisible = true,
00215 bool pSavable = true,
00216 bool pEnabled = true
00217 );
00218
00232 public: KFbxProperty AddPropertyMinMax( KFbxProperty const &pParentProperty,
00233 char const* pName,
00234 KFbxDataType const &pDataType = KFbxDataType(),
00235 char const* pLabel = "",
00236 void const* pValue = NULL,
00237 double const* pMinValue = NULL,
00238 double const* pMaxValue = NULL,
00239 EFbxType pValueType = eUNIDENTIFIED,
00240 bool pVisible = true,
00241 bool pSavable = true,
00242 bool pEnabled = true
00243 );
00244
00245
00249 public: KFbxProperty GetProperty(char const* pName) const;
00250
00255 public: KFbxProperty GetProperty(KFbxProperty const &pParentProperty, char const* pName) const;
00256
00261 public: bool GetBoolProp(char const* pName, bool pDefValue) const;
00262
00267 public: void SetBoolProp(char const* pName, bool pValue);
00268
00273 public: double GetDoubleProp(char const* pName, double pDefValue) const;
00274
00279 public: void SetDoubleProp(char const* pName, double pValue);
00280
00285 public: int GetIntProp(char const* pName, int pDefValue) const;
00286
00291 public: void SetIntProp(char const* pName, int pValue);
00292
00297 public: KTime GetKTimeProp(char const* pName, KTime pDefValue) const;
00298
00303 public: void SetKTimeProp(char const* pName, KTime pValue);
00304
00309 public: KString GetEnumProp(char const* pName, KString pDefValue) const;
00310
00315 public: int GetEnumProp(char const* pName, int pDefValue) const;
00316
00321 public: int GetEnumIndex(char const* pName, KString pValue) const;
00322
00327 public: void SetEnumProp(char const* pName, KString pValue);
00328
00333 public: void SetEnumProp(char const* pName, int pValue);
00334
00339 public: void RemoveEnumPropValue(char const* pName, KString pValue);
00340
00344 public: void EmptyEnumProp(char const* pName);
00345
00350 public: bool IsEnumExist(KFbxProperty& pProp, KString& enumString) const;
00351
00357 public: int GetEnumIndex(KFbxProperty& pProp, KString& enumString, bool pNoCase = false) const;
00358
00364 public: bool SetFlag(char const* pName, FbxPropertyFlags::eFbxPropertyFlags propFlag, bool pValue);
00365
00370 public: KString GetStringProp(char const* pName, KString pDefValue) const;
00371
00376 public: void SetStringProp(char const* pName, KString pValue);
00377
00382 public: virtual bool ReadXMLFile(KString& path);
00383
00388 public: virtual bool WriteXMLFile(KString& path);
00389
00395 public: bool WriteXmlPropToFile(KString& pFullPath, KString& propPath);
00396
00397
00398
00400
00401
00402
00403
00404
00405
00407
00408 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00409
00410
00411 protected: KFbxIOSettings(KFbxSdkManager& pManager,char const* pName);
00412
00413
00414 private: KString* GetAttributeFromXmlNode(xmlNode* node, KString* attName);
00415
00416
00417 private: KString* GetInnerTextXmlNode(xmlNode* node);
00418
00419 private: void CreatePropRecursive(xmlNode* pNode, KFbxProperty& pPropParent);
00420 public: virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pType) const;
00421
00422 private: xmlNode* GetChildXmlNode(xmlNode* parent, KString* nodeName);
00423 private: xmlNode* AddChildXmlNode(xmlNode* parent, KString* nodeName, KString* nodeValue = NULL);
00424 private: xmlAttr* AddAttributeToXmlNode(xmlNode* node, KString* attName, KString* attValue = NULL);
00425
00426 private: void AddNewPropInfo(KFbxProperty &pProp);
00427 private: void DeletePropInfo(KFbxProperty &pProp);
00428 private: void DeleteAllPropInfo(KFbxProperty &pProp);
00429
00430 public: PropInfo * GetPropInfo(KFbxProperty &pProp);
00431
00432 public: FBXUILANGUAGE UILanguage;
00433 public: KString GetLanguageLabel(KFbxProperty &pProp);
00434 public: void SetLanguageLabel(KFbxProperty &pProp, KString &pLabel);
00435 public: FBXUILANGUAGE Get_Max_Runtime_Language(KString regLocation);
00436
00437 public: KsoInfo impInfo;
00438 public: KsoInfo expInfo;
00439
00440
00441 private: void AddXMLProp(KFbxProperty& pProp, xmlNodePtr pParent, xmlDocPtr pXmlDoc);
00442
00443
00444 private: xmlNodePtr GetXMLNode(KFbxProperty& pProp);
00445
00446 public: static KString GetUserMyDocumentDir();
00447 public: void SetPropVisible(KFbxProperty &pProp, bool pWithChildren, bool pVisible);
00448
00449 public: virtual bool ConstructProperties(bool pForceSet);
00450
00451
00452 public: bool ReadXmlPropFromMyDocument(KString& subDir, KString& filename);
00453
00454
00455 public: bool WriteXmlPropToMyDocument(KString& subDir, KString& filename, KString& propPath);
00456
00457 public: enum ELoadMode { eMERGE, eEXCLUSIVE_MERGE, eCREATE };
00458 public: enum EQuaternionMode { eAS_QUATERNION, eAS_EULER, eRESAMPLE };
00459 public: enum EObjectDerivation { eBY_LAYER, eBY_ENTITY, eBY_BLOCK };
00460
00461 public: enum ESysUnits
00462 {
00463 kUNITS_USER,
00464 kUNITS_INCHES,
00465 kUNITS_FEET,
00466 kUNITS_YARDS,
00467 kUNITS_MILES,
00468 kUNITS_MILLIMETERS,
00469 kUNITS_CENTIMETERS,
00470 kUNITS_METERS,
00471 kUNITS_KILOMETERS
00472 };
00473
00474 public: enum ESysFrameRate
00475 {
00476 kFRAMERATE_USER,
00477 kFRAMERATE_HOURS,
00478 kFRAMERATE_MINUTES,
00479 kFRAMERATE_SECONDS,
00480 kFRAMERATE_MILLISECONDS,
00481 kFRAMERATE_GAMES_15,
00482 kFRAMERATE_FILM_24,
00483 kFRAMERATE_PAL_25,
00484 kFRAMERATE_NTSC_30,
00485 kFRAMERATE_SHOWSCAN_48,
00486 kFRAMERATE_PALFIELD_50,
00487 kFRAMERATE_NTSCFIELD_60
00488 };
00489
00490
00491 public: enum EEnveloppeSystem
00492 {
00493 eSKIN_MODIFIER,
00494 ePHYSIQUE,
00495 eBONESPRO,
00496 eENVELOPPE_SYSTEM_COUNT
00497 };
00498
00499
00500 public: enum EGeometryType
00501 {
00502 eTRIANGLE,
00503 eSIMPLIFIED_POLY,
00504 ePOLY,
00505 eNURB,
00506 ePATCH,
00507 eGEOMETRY_TYPE_COUNT
00508 };
00509
00510 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00511
00512 };
00513
00514 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00515
00516 #endif // FBXFILESDK_KFBXIO_KFBXIOSETTINGS_H
00517