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
00042 #include <fbxfilesdk/components/kbaselib/kaydaradef_h.h>
00043
00044 #ifndef KARCH_ENV_MACOSX_CFM
00045
00046
00047 #include <fbxfilesdk/components/kbaselib/klib/karrayul.h>
00048 #include <fbxfilesdk/components/kbaselib/klib/kstring.h>
00049
00050
00051 #include <fbxfilesdk/kfbxplugins/kfbxobject.h>
00052
00053 #include <fbxfilesdk/components/libxml2-2.6.4/libxml.h>
00054 #include <fbxfilesdk/components/libxml2-2.6.4/include/libxml/parser.h>
00055 #include <fbxfilesdk/components/libxml2-2.6.4/include/libxml/tree.h>
00056 #include <fbxfilesdk/components/libxml2-2.6.4/include/libxml/globals.h>
00057
00058
00059 #include <fbxfilesdk/kfbxplugins/kfbxtypes.h>
00060
00061 #include <fbxfilesdk/components/kbaselib/kbaselib_forward.h>
00062 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00063
00064 #include <fbxfilesdk/kfbxio/kfbxiosettingspath.h>
00065
00066 #define IOSREF KFbxIOSettings::IOSettingsRef()
00067
00068 #define IOSVisible true
00069 #define IOSHidden false
00070
00071 #define IOSSavable true
00072 #define IOSNotSavable false
00073
00074 #define IOSEnabled true
00075 #define IOSDisabled false
00076
00077
00078 #define IOSBinary 0
00079 #define IOSASCII 1
00080
00081
00082 class KsoInfo
00083 {
00084
00085 public: enum EIMPEXP
00086 {
00087 eIMPORT = 0,
00088 eEXPORT
00089 };
00090
00091 public:
00092 KsoInfo();
00093
00095 void Reset(EIMPEXP pImpExp);
00096
00098 void SetTimeMode(KTime::ETimeMode pTimeMode, double pCustomFrameRate = 0.0);
00099
00101 KTime::ETimeMode GetTimeMode(){ return mTimeMode; }
00102
00104 KTime GetFramePeriod();
00105
00106 void SetASFScene(KFbxObject* pASFScene, bool pASFSceneOwned = false);
00107 KFbxObject* GetASFScene(){ return mASFScene; }
00108
00109
00110
00111
00112 private:
00113 KTime::ETimeMode mTimeMode;
00114 KFbxObject * mASFScene;
00115
00116 EIMPEXP mImpExp;
00117 };
00118
00119 class KFbxSdkManager;
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133 enum FBXUILANGUAGE
00134 {
00135 eENU = 0,
00136 eDEU,
00137 eFRA,
00138 eJPN,
00139 eKOR,
00140 eCHS,
00141 eFBXUILANGUAGE_COUNT
00142 };
00143
00144 static const char* XML_LAGUAGE_LABELS[] =
00145 {
00146 "lbENU",
00147 "lbDEU",
00148 "lbFRA",
00149 "lbJPN",
00150 "lbKOR",
00151 "lbCHS"
00152 };
00153
00154 static const char* LAGUAGE_SYMBOLS[] =
00155 {
00156 "ENU",
00157 "DEU",
00158 "FRA",
00159 "JPN",
00160 "KOR",
00161 "CHS"
00162 };
00163
00164
00165 class PropInfo
00166 {
00167 public:
00168 PropInfo();
00169 ~PropInfo();
00170
00171 void * UIWidget;
00172 void * cbValueChanged;
00173 void * cbDirty;
00174 KStringList labels;
00175 };
00176
00177
00178
00185 class KFBX_DLL KFbxIOSettings : public KFbxObject
00186 {
00187
00188 KFBXOBJECT_DECLARE(KFbxIOSettings,KFbxObject);
00189
00191 public: virtual ~KFbxIOSettings();
00192
00196 public: static void AllocateIOSettings(KFbxSdkManager& pManager);
00197
00198 public: static bool IsIOSettingsAllocated();
00199
00201 public: void FreeIOSettings();
00202
00204 public: static KFbxIOSettings& IOSettingsRef();
00205
00207 public: virtual void Clear();
00208
00214 public: KFbxProperty AddPropertyGroup(char const* pName, KFbxDataType const &pDataType=KFbxDataType(), char const* pLabel="");
00215
00225 public: KFbxProperty AddPropertyGroup( KFbxProperty const &pParentProperty,
00226 char const* pName,
00227 KFbxDataType const &pDataType = KFbxDataType(),
00228 char const* pLabel = "",
00229 bool pVisible = true,
00230 bool pSavable = true,
00231 bool pEnabled = true
00232 );
00233
00245 public: KFbxProperty AddProperty( KFbxProperty const &pParentProperty,
00246 char const* pName,
00247 KFbxDataType const &pDataType = KFbxDataType(),
00248 char const* pLabel = "",
00249 void const* pValue = NULL,
00250 EFbxType pValueType = eUNIDENTIFIED,
00251 bool pVisible = true,
00252 bool pSavable = true,
00253 bool pEnabled = true
00254 );
00255
00269 public: KFbxProperty AddPropertyMinMax( KFbxProperty const &pParentProperty,
00270 char const* pName,
00271 KFbxDataType const &pDataType = KFbxDataType(),
00272 char const* pLabel = "",
00273 void const* pValue = NULL,
00274 double const* pMinValue = NULL,
00275 double const* pMaxValue = NULL,
00276 EFbxType pValueType = eUNIDENTIFIED,
00277 bool pVisible = true,
00278 bool pSavable = true,
00279 bool pEnabled = true
00280 );
00281
00282
00286 public: KFbxProperty GetProperty(char const* pName);
00287
00292 public: KFbxProperty GetProperty(KFbxProperty const &pParentProperty, char const* pName);
00293
00298 public: bool GetBoolProp(char const* pName, bool pDefValue);
00299
00304 public: void SetBoolProp(char const* pName, bool pValue);
00305
00310 public: double GetDoubleProp(char const* pName, double pDefValue);
00311
00316 public: void SetDoubleProp(char const* pName, double pValue);
00317
00322 public: int GetIntProp(char const* pName, int pDefValue);
00323
00328 public: void SetIntProp(char const* pName, int pValue);
00329
00334 public: KTime GetKTimeProp(char const* pName, KTime pDefValue);
00335
00340 public: void SetKTimeProp(char const* pName, KTime pValue);
00341
00346 public: KString GetEnumProp(char const* pName, KString pDefValue);
00347
00352 public: int GetEnumProp(char const* pName, int pDefValue);
00353
00358 public: int GetEnumIndex(char const* pName, KString pValue);
00359
00364 public: void SetEnumProp(char const* pName, KString pValue);
00365
00370 public: void SetEnumProp(char const* pName, int pValue);
00371
00372 public: void RemoveEnumPropValue(char const* pName, KString pValue);
00373 public: void EmptyEnumProp(char const* pName);
00374
00380 public: bool SetFlag(char const* pName, FbxPropertyFlags::eFbxPropertyFlags propFlag, bool pValue);
00381
00386 public: KString GetStringProp(char const* pName, KString pDefValue);
00387
00392 public: void SetStringProp(char const* pName, KString pValue);
00393
00394
00399 public: virtual bool ReadXMLFile(KString& path);
00400
00405 public: virtual bool WriteXMLFile(KString& path);
00406
00407 public: bool WriteXmlPropToFile(KString& pFullPath, KString& propPath);
00408
00416 public: bool WriteXmlPropToRegistry(KString& regKeyName, KString& regValueName, KString& propPath, KString& regPath );
00417
00424 public: bool ReadXmlPropFromRegistry(KString& regKeyName, KString& regValueName, KString& regPath);
00425
00431 public: bool ReadXmlPropFromMyDocument(KString& subDir, KString& filename);
00432
00439 public: bool WriteXmlPropToMyDocument(KString& subDir, KString& filename, KString& propPath);
00440
00441 public: static KString GetUserMyDocumentDir();
00442
00443
00444
00445 public: enum ELoadMode { eMERGE, eEXCLUSIVE_MERGE, eCREATE };
00446 public: enum EQuaternionMode { eAS_QUATERNION, eAS_EULER, eRESAMPLE };
00447 public: enum EObjectDerivation { eBY_LAYER, eBY_ENTITY, eBY_BLOCK };
00448
00449 public: enum ESysUnits
00450 {
00451 kUNITS_USER,
00452 kUNITS_INCHES,
00453 kUNITS_FEET,
00454 kUNITS_YARDS,
00455 kUNITS_MILES,
00456 kUNITS_MILLIMETERS,
00457 kUNITS_CENTIMETERS,
00458 kUNITS_METERS,
00459 kUNITS_KILOMETERS
00460 };
00461
00462 public: enum ESysFrameRate
00463 {
00464 kFRAMERATE_USER,
00465 kFRAMERATE_HOURS,
00466 kFRAMERATE_MINUTES,
00467 kFRAMERATE_SECONDS,
00468 kFRAMERATE_MILLISECONDS,
00469 kFRAMERATE_GAMES_15,
00470 kFRAMERATE_FILM_24,
00471 kFRAMERATE_PAL_25,
00472 kFRAMERATE_NTSC_30,
00473 kFRAMERATE_SHOWSCAN_48,
00474 kFRAMERATE_PALFIELD_50,
00475 kFRAMERATE_NTSCFIELD_60
00476 };
00477
00478
00479 public: enum EEnveloppeSystem
00480 {
00481 eSKIN_MODIFIER,
00482 ePHYSIQUE,
00483 eBONESPRO,
00484 eENVELOPPE_SYSTEM_COUNT
00485 };
00486
00487
00488 public: enum EGeometryType
00489 {
00490 eTRIANGLE,
00491 eSIMPLIFIED_POLY,
00492 ePOLY,
00493 eNURB,
00494 ePATCH,
00495 eGEOMETRY_TYPE_COUNT
00496 };
00497
00498
00499
00500
00501
00502 protected: KFbxIOSettings(KFbxSdkManager& pManager,char const* pName);
00503
00504
00505 private: void AddXMLProp(KFbxProperty& pProp, xmlNodePtr pParent, xmlDocPtr pXmlDoc);
00506
00507
00508 private: xmlNodePtr GetXMLNode(KFbxProperty& pProp);
00509
00510 public: KsoInfo impInfo;
00511 public: KsoInfo expInfo;
00512
00513 public: FBXUILANGUAGE UILanguage;
00514
00515 private: void AddNewPropInfo(KFbxProperty &pProp);
00516 private: void DeletePropInfo(KFbxProperty &pProp);
00517 private: void DeleteAllPropInfo(KFbxProperty &pProp);
00518
00519 public: PropInfo * GetPropInfo(KFbxProperty &pProp);
00520 public: KString GetLanguageLabel(KFbxProperty &pProp);
00521 public: void SetLanguageLabel(KFbxProperty &pProp, KString &pLabel);
00522 public: FBXUILANGUAGE Get_Max_Runtime_Language(KString regLocation);
00523
00524 private: xmlNode* GetChildXmlNode(xmlNode* parent, KString* nodeName);
00525 private: xmlNode* AddChildXmlNode(xmlNode* parent, KString* nodeName, KString* nodeValue = NULL);
00526 private: xmlAttr* AddAttributeToXmlNode(xmlNode* node, KString* attName, KString* attValue = NULL);
00527
00528
00529 private: KString* GetAttributeFromXmlNode(xmlNode* node, KString* attName);
00530
00531
00532 private: KString* GetInnerTextXmlNode(xmlNode* node);
00533
00534
00535 public: bool IsEnumExist(KFbxProperty& pProp, KString& enumString);
00536 public: int GetEnumIndex(KFbxProperty& pProp, KString& enumString, bool pNoCase = false);
00537
00538 private: bool WriteXmlDocToRegistry(KString* regPath, KString* regKeyName, KString* regValueName, xmlDocPtr XmlDoc);
00539
00540
00541 private: xmlDocPtr ReadXmlDocFromRegistry(KString* regPath, KString* regKeyName, KString* regValueName );
00542
00543 private: void CreatePropRecursive(xmlNode* pNode, KFbxProperty& pPropParent);
00544
00545 public: virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pType) const;
00546
00547 private: bool UseEnglishLabelOnly;
00548
00549 public: void SetUseEnglishLabelOnly( bool flag=true ){ UseEnglishLabelOnly = flag; }
00550 public: bool GetUseEnglishLabelOnly(){ return UseEnglishLabelOnly; }
00551
00552 };
00553
00554 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00555
00556 #endif // KARCH_ENV_MACOSX_CFM
00557
00558 #endif // FBXFILESDK_KFBXIO_KFBXIOSETTINGS_H
00559