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 fbxmarker.h |
13 | #ifndef _FBXSDK_SCENE_GEOMETRY_MARKER_H_ |
14 | #define _FBXSDK_SCENE_GEOMETRY_MARKER_H_ |
15 | |
16 | #include <fbxsdk/fbxsdk_def.h> |
17 | |
18 | #include <fbxsdk/scene/geometry/fbxnodeattribute.h> |
19 | |
20 | #include <fbxsdk/fbxsdk_nsbegin.h> |
21 | |
22 | /** This node attribute contains the properties of a marker. |
23 | * A FbxMarker can represent a motion capture marker or a HIK IK/FK effector. |
24 | * \nosubgrouping |
25 | */ |
26 | class FBXSDK_DLL FbxMarker : public FbxNodeAttribute |
27 | { |
28 | FBXSDK_OBJECT_DECLARE(FbxMarker, FbxNodeAttribute); |
29 | |
30 | public: |
31 | //! Return the type of node attribute which is EType::eMarker. |
32 | virtual FbxNodeAttribute::EType GetAttributeType() const; |
33 | |
34 | //! Reset the marker to default values. |
35 | void Reset(); |
36 | |
37 | /** \enum EType Marker types. |
38 | * - \e eStandard |
39 | * - \e eOptical |
40 | * - \e eEffectorFK |
41 | * - \e eEffectorIK |
42 | */ |
43 | enum EType |
44 | { |
45 | eStandard, |
46 | eOptical, |
47 | eEffectorFK, |
48 | eEffectorIK |
49 | }; |
50 | |
51 | /** Set marker type. |
52 | * \param pType The type of marker. |
53 | */ |
54 | void SetType(EType pType); |
55 | |
56 | /** Get marker type. |
57 | * \return The type of the marker. |
58 | */ |
59 | EType GetType() const; |
60 | |
61 | /** \enum ELook Marker look. |
62 | * - \e eCube |
63 | * - \e eHardCross |
64 | * - \e eLightCross |
65 | * - \e eSphere |
66 | * - \e eCapsule |
67 | * - \e eBox |
68 | * - \e eBone |
69 | * - \e eCircle |
70 | * - \e eSquare |
71 | * - \e eStick |
72 | * - \e eNone |
73 | */ |
74 | enum ELook |
75 | { |
76 | eCube, |
77 | eHardCross, |
78 | eLightCross, |
79 | eSphere, |
80 | eCapsule, |
81 | eBox, |
82 | eBone, |
83 | eCircle, |
84 | eSquare, |
85 | eStick, |
86 | eNone |
87 | }; |
88 | |
89 | /** |
90 | * \name Default Animation Values |
91 | * This set of functions provides direct access to default |
92 | * animation values specific to a marker. The default animation |
93 | * values are found in the default take node of the associated node. |
94 | * Hence, these functions only work if the marker has been associated |
95 | * with a node. |
96 | */ |
97 | //@{ |
98 | |
99 | /** Get default occlusion. |
100 | * \return 0.0 if optical marker animation is valid by default, 1.0 if it is occluded by default. |
101 | * \remarks This function only works if marker type is set to FbxMarker::eOptical. |
102 | */ |
103 | double GetDefaultOcclusion() const; |
104 | |
105 | /** Set default occlusion. |
106 | * \param pOcclusion 0.0 if optical marker animation is valid by default, 1.0 if it is occluded by default. |
107 | * \remarks This function only works if marker type is set to FbxMarker::eOptical. |
108 | */ |
109 | void SetDefaultOcclusion(double pOcclusion); |
110 | |
111 | /** Get default IK reach translation. |
112 | * \return A value between 0.0 and 100.0, 100.0 means complete IK reach. |
113 | * \remarks This function only works if marker type is set to FbxMarker::eEffectorIK. |
114 | */ |
115 | double GetDefaultIKReachTranslation() const; |
116 | |
117 | /** Set default IK reach translation. |
118 | * \param pIKReachTranslation A value between 0.0 and 100.0, 100.0 means complete IK reach. |
119 | * \remarks This function only works if marker type is set to FbxMarker::eEffectorIK. |
120 | */ |
121 | void SetDefaultIKReachTranslation(double pIKReachTranslation); |
122 | |
123 | /** Get default IK reach rotation. |
124 | * \return A value between 0.0 and 100.0, 100.0 means complete IK reach. |
125 | * \remarks This function only works if marker type is set to FbxMarker::eEffectorIK. |
126 | */ |
127 | double GetDefaultIKReachRotation() const; |
128 | |
129 | /** Set default IK reach rotation. |
130 | * \param pIKReachRotation A value between 0.0 and 100.0, 100.0 means complete IK reach. |
131 | * \remarks This function only works if marker type is set to FbxMarker::eEffectorIK. |
132 | */ |
133 | void SetDefaultIKReachRotation(double pIKReachRotation); |
134 | |
135 | /** Get default IK pull. |
136 | * \return A value between 0.0 and 100.0, 100.0 means complete IK pull. |
137 | * \remarks This function only works if marker type is set to FbxMarker::eIK_EFFECTOR. |
138 | */ |
139 | double GetDefaultIKPull() const; |
140 | |
141 | /** Set default IK pull. |
142 | * \param pIKPull A value between 0.0 and 100.0, 100.0 means complete IK pull. |
143 | * \remarks This function only works if marker type is set to FbxMarker::eIK_EFFECTOR. |
144 | */ |
145 | void SetDefaultIKPull(double pIKPull); |
146 | |
147 | /** Get default IK pull hips. |
148 | * \return A value between 0.0 and 100.0, 100.0 means complete IK pull. |
149 | * \remarks This function only works if marker type is set to FbxMarker::eIK_EFFECTOR. |
150 | */ |
151 | double GetDefaultIKPullHips() const; |
152 | |
153 | /** Set default IK pull hips. |
154 | * \param pIKPullHips A value between 0.0 and 100.0, 100.0 means complete IK pull. |
155 | * \remarks This function only works if marker type is set to FbxMarker::eIK_EFFECTOR. |
156 | */ |
157 | void SetDefaultIKPullHips(double pIKPullHips); |
158 | |
159 | //@} |
160 | |
161 | /** |
162 | * \name Obsolete functions |
163 | */ |
164 | //@{ |
165 | |
166 | /** Get default color. |
167 | * \param pColor Filled with appropriate data |
168 | * \return Input parameter filled with appropriate data. |
169 | * \remarks Marker color can not be animated anymore. |
170 | */ |
171 | FbxColor& GetDefaultColor(FbxColor& pColor) const; |
172 | |
173 | /** Set default color. |
174 | * \param pColor The marker color to be set. |
175 | * \remarks Marker color can not be animated anymore. |
176 | */ |
177 | void SetDefaultColor(FbxColor& pColor); |
178 | |
179 | //@} |
180 | |
181 | ////////////////////////////////////////////////////////////////////////// |
182 | // |
183 | // Properties |
184 | // |
185 | ////////////////////////////////////////////////////////////////////////// |
186 | |
187 | /** This property handles the marker's look. |
188 | * |
189 | * To access this property do: Look.Get(). |
190 | * To set this property do: Look.Set(ELook). |
191 | * |
192 | * Default value is eCube |
193 | */ |
194 | FbxPropertyT<ELook> Look; |
195 | |
196 | /** This property handles the marker's link visibility. |
197 | * |
198 | * To access this property do: DrawLink.Get(). |
199 | * To set this property do: DrawLink.Set(FbxBool). |
200 | * |
201 | * Default value is true |
202 | */ |
203 | FbxPropertyT<FbxBool> DrawLink; |
204 | |
205 | /** This property handles the marker's size. |
206 | * |
207 | * To access this property do: Size.Get(). |
208 | * To set this property do: Size.Set(FbxDouble). |
209 | * |
210 | * Default value is 100 |
211 | */ |
212 | FbxPropertyT<FbxDouble> Size; |
213 | |
214 | /** This property handles the marker's label visibility. |
215 | * |
216 | * To access this property do: ShowLabel.Get(). |
217 | * To set this property do: ShowLabel.Set(FbxBool). |
218 | * |
219 | * Default value is false |
220 | */ |
221 | FbxPropertyT<FbxBool> ShowLabel; |
222 | |
223 | /** This property handles the marker's pivot position. |
224 | * |
225 | * To access this property do: IKPivot.Get(). |
226 | * To set this property do: IKPivot.Set(FbxDouble3). |
227 | * |
228 | * Default value is (0., 0., 0.) |
229 | */ |
230 | FbxPropertyT<FbxDouble3> IKPivot; |
231 | |
232 | // Dynamic properties |
233 | |
234 | /** This method grants access to the occlusion property. |
235 | * \remarks If the marker is not of type Optical or the property |
236 | * is invalid, return NULL |
237 | */ |
238 | FbxProperty GetOcclusion() const; |
239 | |
240 | /** This method grants access to the IKReachTranslation property. |
241 | * \remarks If the marker is not of type IK Effector or the property |
242 | * is invalid, return NULL |
243 | */ |
244 | FbxProperty GetIKReachTranslation() const; |
245 | |
246 | /** This method grants access to the IKReachRotation property. |
247 | * \remarks If the marker is not of type IK Effector or the property |
248 | * is invalid, return NULL |
249 | */ |
250 | FbxProperty GetIKReachRotation() const; |
251 | |
252 | /** This method grants access to the IKPull property. |
253 | * \remarks If the marker is not of type IK Effector or the property |
254 | * is invalid, return NULL |
255 | */ |
256 | FbxProperty GetIKPull() const; |
257 | |
258 | /** This method grants access to the IKPullHips property. |
259 | * \remarks If the marker is not of type IK Effector or the property |
260 | * is invalid, return NULL |
261 | */ |
262 | FbxProperty GetIKPullHips() const; |
263 | |
264 | /***************************************************************************************************************************** |
265 | ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! ** |
266 | *****************************************************************************************************************************/ |
267 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
268 | virtual FbxObject& Copy(const FbxObject& pObject); |
269 | |
270 | protected: |
271 | virtual void ConstructProperties(bool pForceSet); |
272 | virtual const char* GetTypeName() const; |
273 | virtual FbxStringList GetTypeFlags() const; |
274 | |
275 | EType mType; |
276 | #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/ |
277 | }; |
278 | |
279 | inline EFbxType FbxTypeOf(const FbxMarker::ELook&){ return eFbxEnum; } |
280 | |
281 | #include <fbxsdk/fbxsdk_nsend.h> |
282 | |
283 | #endif /* _FBXSDK_SCENE_GEOMETRY_MARKER_H_ */ |
284 | |