fbxpropertydef.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /****************************************************************************************
  2. Copyright (C) 2015 Autodesk, Inc.
  3. All rights reserved.
  4. Use of this software is subject to the terms of the Autodesk license agreement
  5. provided at the time of installation or download, or which otherwise accompanies
  6. this software in either electronic or hard copy form.
  7. ****************************************************************************************/
  8. //! \file fbxpropertydef.h
  9. #ifndef _FBXSDK_CORE_PROPERTY_DEFINITION_H_
  10. #define _FBXSDK_CORE_PROPERTY_DEFINITION_H_
  11. #include <fbxsdk/fbxsdk_def.h>
  12. #include <fbxsdk/core/fbxpropertytypes.h>
  13. #include <fbxsdk/fbxsdk_nsbegin.h>
  14. #define FBXSDK_PROPERTY_ID_NULL -1
  15. #define FBXSDK_PROPERTY_ID_ROOT 0
  16. class FbxPropertyPage;
  17. class FBXSDK_DLL FbxPropertyFlags
  18. {
  19. public:
  20. //! Property inherit types
  21. enum EInheritType
  22. {
  23. eOverride, //!< Property override this flag from its reference property.
  24. eInherit, //!< Property inherit this flag from its reference property.
  25. eDeleted //!< Property has been deleted, so inheritance is invalid.
  26. };
  27. //! Property flags that affect their behaviors
  28. enum EFlags
  29. {
  30. eNone = 0, //!< No flag.
  31. eStatic = 1 << 0, //!< Property is defined in the class declaration, so it wasn't created dynamically.
  32. eAnimatable = 1 << 1, //!< Property can be animated, thus is can have am animation curve node connected.
  33. eAnimated = 1 << 2, //!< Property is animated, so it also has an animation curve node connected.
  34. eImported = 1 << 3, //!< Property has been created during import process when reading FBX file.
  35. eUserDefined = 1 << 4, //!< Property has been defined by user, not by the FBX SDK.
  36. eHidden = 1 << 5, //!< Property should not be displayed on user interface.
  37. eNotSavable = 1 << 6, //!< Property value must not be exported when writing FBX files.
  38. eLockedMember0 = 1 << 7, //!< This property has its member #0 locked.
  39. eLockedMember1 = 1 << 8, //!< This property has its member #1 locked.
  40. eLockedMember2 = 1 << 9, //!< This property has its member #2 locked.
  41. eLockedMember3 = 1 << 10, //!< This property has its member #3 locked.
  42. eLockedAll = eLockedMember0 | eLockedMember1 | eLockedMember2 | eLockedMember3,
  43. eMutedMember0 = 1 << 11, //!< This property has its member #0 muted.
  44. eMutedMember1 = 1 << 12, //!< This property has its member #1 muted.
  45. eMutedMember2 = 1 << 13, //!< This property has its member #2 muted.
  46. eMutedMember3 = 1 << 14, //!< This property has its member #3 muted.
  47. eMutedAll = eMutedMember0 | eMutedMember1 | eMutedMember2 | eMutedMember3,
  48. //Private flags
  49. eUIDisabled = 1 << 15, //!< Private flag for dynamic UI in FBX plug-ins.
  50. eUIGroup = 1 << 16, //!< Private flag for dynamic UI in FBX plug-ins.
  51. eUIBoolGroup = 1 << 17, //!< Private flag for dynamic UI in FBX plug-ins.
  52. eUIExpanded = 1 << 18, //!< Private flag for dynamic UI in FBX plug-ins.
  53. eUINoCaption = 1 << 19, //!< Private flag for dynamic UI in FBX plug-ins.
  54. eUIPanel = 1 << 20, //!< Private flag for dynamic UI in FBX plug-ins.
  55. eUILeftLabel = 1 << 21, //!< Private flag for dynamic UI in FBX plug-ins.
  56. eUIHidden = 1 << 22, //!< Private flag for dynamic UI in FBX plug-ins.
  57. eCtrlFlags = eStatic | eAnimatable | eAnimated | eImported | eUserDefined | eHidden | eNotSavable | eLockedAll | eMutedAll,
  58. eUIFlags = eUIDisabled | eUIGroup | eUIBoolGroup | eUIExpanded | eUINoCaption | eUIPanel | eUILeftLabel | eUIHidden,
  59. eAllFlags = eCtrlFlags | eUIFlags,
  60. eFlagCount = 23,
  61. };
  62. bool SetFlags(FbxPropertyFlags::EFlags pMask, FbxPropertyFlags::EFlags pFlags);
  63. FbxPropertyFlags::EFlags GetFlags() const;
  64. FbxPropertyFlags::EFlags GetMergedFlags(FbxPropertyFlags::EFlags pFlags) const;
  65. bool ModifyFlags(FbxPropertyFlags::EFlags pFlags, bool pValue);
  66. FbxPropertyFlags::EInheritType GetFlagsInheritType(FbxPropertyFlags::EFlags pFlags) const;
  67. bool SetMask(FbxPropertyFlags::EFlags pFlags);
  68. bool UnsetMask(FbxPropertyFlags::EFlags pFlags);
  69. FbxPropertyFlags::EFlags GetMask() const;
  70. bool Equal(const FbxPropertyFlags& pOther, FbxPropertyFlags::EFlags pFlags) const;
  71. /*****************************************************************************************************************************
  72. ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
  73. *****************************************************************************************************************************/
  74. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  75. FbxPropertyFlags();
  76. explicit FbxPropertyFlags(FbxPropertyFlags::EFlags pFlags);
  77. FbxPropertyFlags Clone(FbxPropertyPage* pPage);
  78. static const int sLockedMembersMax = 4; //Maximum number of property sub-member that can be locked.
  79. static const int sLockedMembersBitOffset = 7; //Number of bits to shift to get to the first locked member flag.
  80. static const int sMutedMembersMax = 4; //Maximum number of property sub-member that can be muted.
  81. static const int sMutedMembersBitOffset = 11; //Number of bits to shift to get to the first muted member flag.
  82. private:
  83. FbxUInt32 mFlagData, mMaskData;
  84. FBX_ASSERT_STATIC(sizeof(FbxUInt32) * 8 >= FbxPropertyFlags::eFlagCount);
  85. #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
  86. };
  87. class FBXSDK_DLL FbxPropertyValue
  88. {
  89. public:
  90. static FbxPropertyValue* Create(void* pData, EFbxType pType);
  91. void Destroy();
  92. FbxPropertyValue* Clone(FbxPropertyPage*);
  93. bool Get(void* pValue, EFbxType pValueType);
  94. bool Set(const void* pValue, EFbxType pValueType);
  95. size_t GetSizeOf() const;
  96. size_t GetComponentCount() const;
  97. void IncRef();
  98. void DecRef();
  99. int GetRef();
  100. /*****************************************************************************************************************************
  101. ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
  102. *****************************************************************************************************************************/
  103. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  104. FbxPropertyValue();
  105. private:
  106. FbxPropertyValue(void* pValue, EFbxType pType);
  107. ~FbxPropertyValue();
  108. int mRef;
  109. EFbxType mType;
  110. void* mValue;
  111. FBXSDK_FRIEND_NEW();
  112. #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
  113. };
  114. #include <fbxsdk/fbxsdk_nsend.h>
  115. #endif /* _FBXSDK_CORE_PROPERTY_DEFINITION_H_ */