fbxsdk/fileio/fbxiosettings.h Source File

fbxiosettings.h
Go to the documentation of this file.
1 /****************************************************************************************
2 
3  Copyright (C) 2015 Autodesk, Inc.
4  All rights reserved.
5 
6  Use of this software is subject to the terms of the Autodesk license agreement
7  provided at the time of installation or download, or which otherwise accompanies
8  this software in either electronic or hard copy form.
9 
10 ****************************************************************************************/
11 
13 #ifndef _FBXSDK_FILEIO_IO_SETTINGS_H_
14 #define _FBXSDK_FILEIO_IO_SETTINGS_H_
15 
16 #include <fbxsdk/fbxsdk_def.h>
17 
18 #include <fbxsdk/core/fbxobject.h>
20 
21 #include <fbxsdk/fbxsdk_nsbegin.h>
22 
23 //Undefine the macro mkdir, since it conflict with function mkdir in Qt\4.2.3\src\corelib\io\qdir.h
24 #if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(mkdir)
25  #undef mkdir
26 #endif
27 
28 #define IOSVisible true
29 #define IOSHidden false
30 
31 #define IOSSavable true
32 #define IOSNotSavable false
33 
34 #define IOSEnabled true
35 #define IOSDisabled false
36 
37 #define IOSBinary 0
38 #define IOSASCII 1
39 
40 class FbxManager;
41 class FbxIOSettings;
42 
43 /*****************************************************************************************************************************
44 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
45 *****************************************************************************************************************************/
46 #ifndef DOXYGEN_SHOULD_SKIP_THIS
47 class FbxIOPropInfo
48 {
49 public:
50  FbxIOPropInfo();
51  ~FbxIOPropInfo();
52 
53  void* UIWidget; // UI widget for showing the property
54  void* cbValueChanged; // call back when value changed
55  void* cbDirty; // call back when value changed
56  FbxStringList labels; // list of labels in many languages
57 };
58 
59 class FBXSDK_DLL FbxIOInfo
60 {
61 public:
62  enum EImpExp {eImport, eExport};
63 
64  FbxIOInfo();
65 
66  void Reset(EImpExp pImpExp);
67  void SetTimeMode(FbxTime::EMode pTimeMode, double pCustomFrameRate = 0.0);
68  FbxTime::EMode GetTimeMode(){ return mTimeMode; }
69  FbxTime GetFramePeriod();
70  void SetASFScene(FbxObject* pASFScene, bool pASFSceneOwned = false);
71  FbxObject* GetASFScene(){ return mASFScene; }
72  void Set_IOS(FbxIOSettings* pIOS){ios = pIOS;}
73  void SetImportExportMode(EImpExp pImpExp){mImpExp = pImpExp;}
74 
75 private:
76  FbxTime::EMode mTimeMode;
77  FbxObject* mASFScene;
78  EImpExp mImpExp;
79  FbxIOSettings* ios;
80 };
81 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
82 
208 {
210 
211 public:
214  {
221  eLanguageCount
222  };
223 
230  FbxProperty AddPropertyGroup(const char* pName, const FbxDataType& pDataType=FbxDataType(), const char* pLabel="");
231 
242  FbxProperty AddPropertyGroup(const FbxProperty& pParentProperty, const char* pName, const FbxDataType& pDataType = FbxDataType(),
243  const char* pLabel = "", bool pVisible = true, bool pSavable = true, bool pEnabled = true );
244 
256  FbxProperty AddProperty(const FbxProperty& pParentProperty, const char* pName, const FbxDataType& pDataType = FbxDataType(),
257  const char* pLabel = "", const void* pValue = NULL, bool pVisible = true,
258  bool pSavable = true, bool pEnabled = true );
259 
274  FbxProperty AddPropertyMinMax(const FbxProperty& pParentProperty, const char* pName, const FbxDataType& pDataType = FbxDataType(),
275  const char* pLabel = "", const void* pValue = NULL, const double* pMinValue = NULL, const double* pMaxValue = NULL,
276  bool pVisible = true, bool pSavable = true, bool pEnabled = true );
277 
278 
285  FbxProperty GetProperty(const char* pName) const;
286 
293  FbxProperty GetProperty(const FbxProperty& pParentProperty, const char* pName) const;
294 
300  bool GetBoolProp(const char* pName, bool pDefValue) const;
301 
306  void SetBoolProp(const char* pName, bool pValue);
307 
313  double GetDoubleProp(const char* pName, double pDefValue) const;
314 
319  void SetDoubleProp(const char* pName, double pValue);
320 
326  int GetIntProp(const char* pName, int pDefValue) const;
327 
332  void SetIntProp(const char* pName, int pValue);
333 
338  FbxTime GetTimeProp(const char* pName, FbxTime pDefValue) const;
339 
345  void SetTimeProp(const char* pName, FbxTime pValue);
346 
365 
371  FbxString GetEnumProp(const char* pName, FbxString pDefValue) const;
372 
378  int GetEnumProp(const char* pName, int pDefValue) const;
379 
385  int GetEnumIndex(const char* pName, FbxString pValue) const;
386 
392  void SetEnumProp(const char* pName, FbxString pValue);
393 
399  void SetEnumProp(const char* pName, int pValue);
400 
408  void RemoveEnumPropValue(const char* pName, FbxString pValue);
409 
413  void EmptyEnumProp(const char* pName);
414 
420  bool IsEnumExist(FbxProperty& pProp, const FbxString& enumString) const;
421 
428  int GetEnumIndex(FbxProperty& pProp, const FbxString& enumString, bool pNoCase = false) const;
430 
437  bool SetFlag(const char* pName, FbxPropertyFlags::EFlags propFlag, bool pValue);
438 
444  FbxString GetStringProp(const char* pName, FbxString pDefValue) const;
445 
450  void SetStringProp(const char* pName, FbxString pValue);
451 
454 
459  virtual bool ReadXMLFile(const FbxString& path);
460 
466  virtual bool WriteXMLFile(const FbxString& path);
467 
474  bool WriteXmlPropToFile(const FbxString& pFullPath, const FbxString& propPath);
476 
477 /*****************************************************************************************************************************
478 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
479 *****************************************************************************************************************************/
480 #ifndef DOXYGEN_SHOULD_SKIP_THIS
481  FbxIOPropInfo* GetPropInfo(FbxProperty &pProp);
482 
483  ELanguage UILanguage;
484  FbxString GetLanguageLabel(FbxProperty& pProp);
485  void SetLanguageLabel(FbxProperty& pProp, FbxString& pLabel);
486  ELanguage Get_Max_Runtime_Language(FbxString pRegLocation);
487 
488  FbxIOInfo impInfo;
489  FbxIOInfo expInfo;
490 
491  static FbxString GetUserMyDocumentDir();
492  void SetPropVisible(FbxProperty& pProp, bool pWithChildren, bool pVisible);
493 
494  // Read an XML file from MyDocument dir
495  bool ReadXmlPropFromMyDocument(const FbxString& subDir, const FbxString& filename);
496 
497  // Write property branch to an XML file in MyDocument dir
498  bool WriteXmlPropToMyDocument(const FbxString& subDir, const FbxString& filename, const FbxString& propPath);
499 
500  static const char* GetFileMergeDescription(int pIndex);
501 
502  enum ELoadMode
503  {
504  eCreate,
505  eMerge,
506  eExclusiveMerge
507  };
508 
509 
510  enum EQuaternionMode { eAsQuaternion, eAsEuler, eResample };
511  enum EObjectDerivation { eByLayer, eByEntity, eByBlock };
512 
513  enum ESysUnits
514  {
515  eUnitsUser,
516  eUnitsInches,
517  eUnitsFeet,
518  eUnitYards,
519  eUnitsMiles,
520  eUnitsMillimeters,
521  eUnitsCentimeters,
522  eUnitsMeters,
523  eUnitsKilometers
524  };
525 
526  enum ESysFrameRate
527  {
528  eFrameRateUser,
529  eFrameRateHours,
530  eFrameRateMinutes,
531  eFrameRateSeconds,
532  eFrameRateMilliseconds,
533  eFrameRateGames15,
534  eFrameRateFilm24,
535  eFrameRatePAL25,
536  eFrameRateNTSC30,
537  eFrameRateShowScan48,
538  eFrameRatePALField50,
539  eFrameRateNTSCField60
540  };
541 
542 // Max
543  enum EEnveloppeSystem
544  {
545  eSkinModifier,
546  ePhysic,
547  eBonePro,
548  eEnveloppeSystemCount
549  };
550 
551 // Max
552  enum EGeometryType
553  {
554  eTriangle,
555  eSimplifiedPoly,
556  ePolygon,
557  eNurbs,
558  ePatch,
559  eGeometryTypeCount
560  };
561 
562 // Maya IK type
563  enum EIKType
564  {
565  eNone,
566  eFBIK,
567  eHumanIK
568  };
569 
570 protected:
571  virtual void Construct(const FbxObject* pFrom);
572  virtual void ConstructProperties(bool pForceSet);
573  virtual void Destruct(bool pRecursive);
574 
575 private:
576  void AddNewPropInfo(FbxProperty& pProp);
577  void DeletePropInfo(FbxProperty& pProp);
578  void DeleteAllPropInfo(FbxProperty& pProp);
579 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
580 };
581 
582 #include <fbxsdk/fbxsdk_nsend.h>
583 
584 #endif /* _FBXSDK_FILEIO_IO_SETTINGS_H_ */
#define FBXSDK_OBJECT_DECLARE(Class, Parent)
Macro used to declare a new class derived from FbxObject.
Definition: fbxobject.h:61
FBX SDK environment definition.
SDK object manager.
Definition: fbxmanager.h:56
No flags.
Definition: fbxobject.h:205
EFlags
Property flags that affect their behaviors.
#define NULL
Definition: fbxarch.h:210
Array that stores pairs of FbxString and a pointer.
Utility class to manipulate strings.
Definition: fbxstring.h:66
FBX SDK data type class.
Definition: fbxdatatypes.h:26
409 English - United States
411 Japanese - Japan
FbxIOSettings is a collection of properties, arranged as a tree, that can be used by FBX file readers...
412 Korean(Extended Wansung) - Korea
407 German - Germany
Class to encapsulate time units.
Definition: fbxtime.h:44
The base class of most FBX objects.
Definition: fbxobject.h:157
804 Chinese - PRC
virtual void Construct(const FbxObject *pFrom)
Optional constructor override, automatically called by default constructor.
EMode
Time modes.
Definition: fbxtime.h:90
40c French - France
Class to hold user properties.
Definition: fbxproperty.h:37
ELanguage
Supported languages enumeration list.
#define FBXSDK_DLL
Definition: fbxarch.h:173
virtual void Destruct(bool pRecursive)
Optional destructor override, automatically called by default destructor.
virtual void ConstructProperties(bool pForceSet)
Optional property constructor override, automatically called by default constructor.