fbxmarker.h 8.5 KB

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