fbxsdk/scene/constraint/fbxcontrolset.h Source File
 
 
 
fbxsdk/scene/constraint/fbxcontrolset.h
Go to the documentation of this file.
00001 /****************************************************************************************
00002  
00003    Copyright (C) 2013 Autodesk, Inc.
00004    All rights reserved.
00005  
00006    Use of this software is subject to the terms of the Autodesk license agreement
00007    provided at the time of installation or download, or which otherwise accompanies
00008    this software in either electronic or hard copy form.
00009  
00010 ****************************************************************************************/
00011 
00013 #ifndef _FBXSDK_SCENE_CONSTRAINT_CONTROL_SET_H_
00014 #define _FBXSDK_SCENE_CONSTRAINT_CONTROL_SET_H_
00015 
00016 #include <fbxsdk/fbxsdk_def.h>
00017 
00018 #include <fbxsdk/scene/constraint/fbxcharacter.h>
00019 
00020 #include <fbxsdk/fbxsdk_nsbegin.h>
00021 
00022 class FbxControlSetPlug;
00023 
00029 class FBXSDK_DLL FbxControlSetLink
00030 {
00031 public:
00033     FbxControlSetLink();
00034 
00038     FbxControlSetLink(const FbxControlSetLink& pControlSetLink);
00039 
00043     FbxControlSetLink& operator=(const FbxControlSetLink& pControlSetLink);
00044 
00049     void Reset();
00050 
00052     FbxNode* mNode;
00053 
00056     FbxString mTemplateName;
00057 };
00058 
00062 class FBXSDK_DLL FbxEffector
00063 {
00064 public:
00065         enum ESetId
00066         {
00067                 eDefaultSet,
00068                 eAux1Set,
00069                 eAux2Set,
00070                 eAux3Set,
00071                 eAux4Set,
00072                 eAux5Set,
00073                 eAux6Set,
00074                 eAux7Set,
00075                 eAux8Set,
00076                 eAux9Set,
00077                 eAux10Set,
00078                 eAux11Set,
00079                 eAux12Set,
00080                 eAux13Set,
00081                 eAux14Set,
00082                 eSetIdCount
00083         };
00084 
00085         enum ENodeId
00086         {
00087                 eHips,
00088                 eLeftAnkle,
00089                 eRightAnkle,
00090                 eLeftWrist,
00091                 eRightWrist,
00092                 eLeftKnee,
00093                 eRightKnee,
00094                 eLeftElbow,
00095                 eRightElbow,
00096                 eChestOrigin,
00097                 eChestEnd,
00098                 eLeftFoot,
00099                 eRightFoot,
00100                 eLeftShoulder,
00101                 eRightShoulder,
00102                 eHead,
00103                 eLeftHip,
00104                 eRightHip,
00105                 eLeftHand,
00106                 eRightHand,
00107                 eLeftHandThumb,
00108                 eLeftHandIndex,
00109                 eLeftHandMiddle,
00110                 eLeftHandRing,
00111                 eLeftHandPinky,
00112                 eLeftHandExtraFinger,
00113                 eRightHandThumb,
00114                 eRightHandIndex,
00115                 eRightHandMiddle,
00116                 eRightHandRing,
00117                 eRightHandPinky,
00118                 eRightHandExtraFinger,
00119                 eLeftFootThumb,
00120                 eLeftFootIndex,
00121                 eLeftFootMiddle,
00122                 eLeftFootRing,
00123                 eLeftFootPinky,
00124                 eLeftFootExtraFinger,
00125                 eRightFootThumb,
00126                 eRightFootIndex,
00127                 eRightFootMiddle,
00128                 eRightFootRing,
00129                 eRightFootPinky,
00130                 eRightFootExtraFinger,
00131                 eNodeIdCount
00132         };
00133 
00135     FbxEffector();
00136 
00140     FbxEffector& operator=(const FbxEffector& pEffector);
00141 
00146     void Reset();
00147 
00149     FbxNode* mNode;
00150 
00152     bool mShow;
00153 
00154 /*****************************************************************************************************************************
00155 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
00156 *****************************************************************************************************************************/
00157 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00158     //These members are for backward compatibility and should not be used.
00159         //These properties are now published through class FbxControlSetPlug.
00160     bool mTActive;
00161     bool mRActive;
00162     bool mCandidateTActive;
00163     bool mCandidateRActive;
00164 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
00165 };
00166 
00184 class FBXSDK_DLL FbxControlSet
00185 {
00186 public:
00190     void Reset();
00191 
00197     enum EType
00198     {
00199         eNone,
00200         eFkIk,
00201         eIkOnly
00202     };
00203 
00207     void SetType(EType pType);
00208 
00212     EType GetType() const;
00213 
00217     void SetUseAxis(bool pUseAxis);
00218 
00222     bool GetUseAxis() const;
00223 
00227     void SetLockTransform(bool pLockTransform);
00228 
00232     bool GetLockTransform()const;
00233 
00237     void SetLock3DPick(bool pLock3DPick);
00238 
00242     bool GetLock3DPick() const;
00243 
00253     bool SetControlSetLink(FbxCharacter::ENodeId pCharacterNodeId, const FbxControlSetLink& pControlSetLink);
00254 
00264     bool GetControlSetLink(FbxCharacter::ENodeId pCharacterNodeId, FbxControlSetLink* pControlSetLink = NULL) const;
00265 
00271     bool SetEffector(FbxEffector::ENodeId pEffectorNodeId, FbxEffector pEffector);
00272 
00278     bool GetEffector(FbxEffector::ENodeId pEffectorNodeId, FbxEffector* pEffector = NULL);
00279 
00286     bool SetEffectorAux(FbxEffector::ENodeId pEffectorNodeId, FbxNode* pNode, FbxEffector::ESetId pEffectorSetId=FbxEffector::eAux1Set);
00287 
00294     bool GetEffectorAux(FbxEffector::ENodeId pEffectorNodeId, FbxNode** pNode=NULL, FbxEffector::ESetId pEffectorSetId=FbxEffector::eAux1Set) const;
00295 
00300     static char* GetEffectorNodeName(FbxEffector::ENodeId pEffectorNodeId);
00301 
00307     static FbxEffector::ENodeId GetEffectorNodeId(char* pEffectorNodeName);
00308 
00309 /*****************************************************************************************************************************
00310 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
00311 *****************************************************************************************************************************/
00312 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00313     void FromPlug(FbxControlSetPlug *pPlug);
00314     void ToPlug(FbxControlSetPlug *pPlug);
00315 
00316 private:
00317     FbxControlSet();
00318     ~FbxControlSet();
00319 
00320     FbxCharacter*               mCharacter;
00321     EType                               mType;
00322     bool                                mUseAxis;
00323     bool                                mLockTransform;
00324     bool                                mLock3DPick;
00325     FbxControlSetLink   mControlSetLink[FbxCharacter::eNodeIdCount]; // Except floor node IDs!
00326     FbxEffector                 mEffector[FbxEffector::eNodeIdCount];
00327     FbxNode*                    mEffectorAux[FbxEffector::eNodeIdCount][FbxEffector::eSetIdCount-1];
00328 
00329     FBXSDK_FRIEND_NEW();
00330     friend class FbxCharacter;
00331     friend class FbxNode;
00332 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
00333 };
00334 
00338 class FBXSDK_DLL FbxControlSetPlug : public FbxObject
00339 {
00340         FBXSDK_OBJECT_DECLARE(FbxControlSetPlug, FbxObject);
00341 
00342 public:
00344         FbxPropertyT<FbxControlSet::EType> ControlSetType;
00345 
00347         FbxPropertyT<FbxBool> UseAxis;
00348 
00350         FbxPropertyT<FbxReference> Character;
00351 
00352 protected:
00353         virtual void Construct(const FbxControlSetPlug* pFrom);
00354         virtual void ConstructProperties(bool pForceSet);
00355         virtual FbxStringList GetTypeFlags() const;
00356 
00357 private:
00358         FbxArray<FbxProperty>    mFKBuf;
00359         FbxArray<FbxProperty>    mIKBuf;
00360 
00361         friend class FbxScene;
00362         friend class FbxControlSet;
00363 };
00364 
00365 inline EFbxType FbxTypeOf(const FbxControlSet::EType&){ return eFbxEnum; }
00366 
00367 #include <fbxsdk/fbxsdk_nsend.h>
00368 
00369 #endif /* _FBXSDK_SCENE_CONSTRAINT_CONTROL_SET_H_ */