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