kfbxcontrolset.h

Go to the documentation of this file.
00001 
00004 #ifndef FBXFILESDK_KFBXCHARACTER_KFBXCONTROLSET_H
00005 #define FBXFILESDK_KFBXCHARACTER_KFBXCONTROLSET_H
00006 
00007 /**************************************************************************************
00008 
00009  Copyright (C) 2001 - 2010 Autodesk, Inc. and/or its licensors.
00010  All Rights Reserved.
00011 
00012  The coded instructions, statements, computer programs, and/or related material 
00013  (collectively the "Data") in these files contain unpublished information 
00014  proprietary to Autodesk, Inc. and/or its licensors, which is protected by 
00015  Canada and United States of America federal copyright law and by international 
00016  treaties. 
00017  
00018  The Data may not be disclosed or distributed to third parties, in whole or in
00019  part, without the prior written consent of Autodesk, Inc. ("Autodesk").
00020 
00021  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00022  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
00023  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR ARISING
00024  BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES OF TITLE, 
00025  NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR USE. 
00026  WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT WARRANT THAT THE OPERATION
00027  OF THE DATA WILL BE UNINTERRUPTED OR ERROR FREE. 
00028  
00029  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
00030  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR EXPENSES
00031  OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE DAMAGES OR OTHER
00032  SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS OF PROFITS, REVENUE
00033  OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR DAMAGES OF ANY KIND),
00034  HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF LIABILITY, WHETHER DERIVED
00035  FROM CONTRACT, TORT (INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE), OR OTHERWISE,
00036  ARISING OUT OF OR RELATING TO THE DATA OR ITS USE OR ANY OTHER PERFORMANCE,
00037  WHETHER OR NOT AUTODESK HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS
00038  OR DAMAGE. 
00039 
00040 **************************************************************************************/
00041 #include <fbxfilesdk/fbxfilesdk_def.h>
00042 
00043 #include <fbxfilesdk/kfbxcharacter/kfbxcharacter.h>
00044 #include <fbxfilesdk/kfbxmath/kfbxxmatrix.h>
00045 #include <fbxfilesdk/components/kbaselib/klib/kstring.h>
00046 
00047 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00048 
00049 class KFbxNode;
00050 class KFbxSdkManager;
00051 class KFbxControlSetPlug;
00052 class KFbxControlSetPlug_internal;
00053 
00054 typedef enum
00055 {
00056     eEffectorHips = 0,
00057     eEffectorLeftAnkle,
00058     eEffectorRightAnkle,
00059     eEffectorLeftWrist,
00060     eEffectorRightWrist,
00061     eEffectorLeftKnee,
00062     eEffectorRightKnee,
00063     eEffectorLeftElbow,
00064     eEffectorRightElbow,
00065     eEffectorChestOrigin,
00066     eEffectorChestEnd,
00067     eEffectorLeftFoot,
00068     eEffectorRightFoot,
00069     eEffectorLeftShoulder,
00070     eEffectorRightShoulder,
00071     eEffectorHead,
00072     eEffectorLeftHip,
00073     eEffectorRightHip,
00074 
00075     // Added for 4.5
00076 
00077     eEffectorLeftHand,
00078     eEffectorRightHand,
00079 
00080     eEffectorLeftHandThumb,
00081     eEffectorLeftHandIndex,
00082     eEffectorLeftHandMiddle,
00083     eEffectorLeftHandRing,
00084     eEffectorLeftHandPinky,
00085     eEffectorLeftHandExtraFinger,
00086 
00087     eEffectorRightHandThumb,
00088     eEffectorRightHandIndex,
00089     eEffectorRightHandMiddle,
00090     eEffectorRightHandRing,
00091     eEffectorRightHandPinky,
00092     eEffectorRightHandExtraFinger,
00093 
00094     eEffectorLeftFootThumb,
00095     eEffectorLeftFootIndex,
00096     eEffectorLeftFootMiddle,
00097     eEffectorLeftFootRing,
00098     eEffectorLeftFootPinky,
00099     eEffectorLeftFootExtraFinger,
00100 
00101     eEffectorRightFootThumb,
00102     eEffectorRightFootIndex,
00103     eEffectorRightFootMiddle,
00104     eEffectorRightFootRing,
00105     eEffectorRightFootPinky,
00106     eEffectorRightFootExtraFinger,
00107 
00108     eEffectorLastNodeId
00109 } EEffectorNodeId;
00110 
00111 typedef enum
00112 {
00113     eEffectorSetDefault = 0,
00114     eEffectorSetAux1,
00115     eEffectorSetAux2,
00116     eEffectorSetAux3,
00117     eEffectorSetAux4,
00118     eEffectorSetAux5,
00119     eEffectorSetAux6,
00120     eEffectorSetAux7,
00121     eEffectorSetAux8,
00122     eEffectorSetAux9,
00123     eEffectorSetAux10,
00124     eEffectorSetAux11,
00125     eEffectorSetAux12,
00126     eEffectorSetAux13,
00127     eEffectorSetAux14,
00128     eLastEffectorSetId
00129 } EEffectorSetId;
00130 
00131 
00137 class KFBX_DLL KFbxControlSetLink
00138 {
00139 
00140 public:
00141 
00143     KFbxControlSetLink();
00144 
00148     KFbxControlSetLink(const KFbxControlSetLink& pControlSetLink);
00152     KFbxControlSetLink& operator=(const KFbxControlSetLink& pControlSetLink);
00153 
00158     void Reset();
00159 
00161     KFbxNode* mNode;
00162 
00165     KString mTemplateName;
00166 };
00167 
00171 class KFBX_DLL KFbxEffector
00172 {
00173 
00174 public:
00175 
00177     KFbxEffector();
00181     KFbxEffector& operator=(const KFbxEffector& pEffector);
00182 
00187     void Reset();
00188 
00190     KFbxNode* mNode;
00191 
00193     bool mShow;
00194 
00195     // These members are for backward compatibility and should not be used. These properties are now published through class KFbxControlSetPlug.
00196 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00197     bool mTActive;
00198     bool mRActive;
00199     bool mCandidateTActive;
00200     bool mCandidateRActive;
00201 #endif
00202 };
00203 
00221 class KFBX_DLL KFbxControlSet
00222 {
00223 
00224 public:
00225     KFBXNEW_DECLARE_FRIEND
00229     void Reset();
00230 
00236     enum EType
00237     {
00238         eNone,
00239         eFkIk,
00240         eIkOnly
00241     };
00242 
00246     void SetType(EType pType);
00247 
00251     EType GetType() const;
00252 
00256     void SetUseAxis(bool pUseAxis);
00257 
00261     bool GetUseAxis() const;
00262 
00266     void SetLockTransform(bool pLockTransform);
00267 
00271     bool GetLockTransform()const;
00272 
00276     void SetLock3DPick(bool pLock3DPick);
00277 
00281     bool GetLock3DPick() const;
00282 
00292     bool SetControlSetLink(ECharacterNodeId pCharacterNodeId, const KFbxControlSetLink& pControlSetLink);
00293 
00303     bool GetControlSetLink(ECharacterNodeId pCharacterNodeId, KFbxControlSetLink* pControlSetLink = NULL) const;
00304 
00310     bool SetEffector(EEffectorNodeId pEffectorNodeId, KFbxEffector pEffector);
00311 
00317     bool GetEffector(EEffectorNodeId pEffectorNodeId, KFbxEffector* pEffector = NULL);
00318 
00325     bool SetEffectorAux(EEffectorNodeId pEffectorNodeId, KFbxNode* pNode,EEffectorSetId pEffectorSetId = eEffectorSetAux1);
00326 
00333     bool GetEffectorAux(EEffectorNodeId pEffectorNodeId, KFbxNode** pNode = NULL,EEffectorSetId pEffectorSetId = eEffectorSetAux1) const;
00334 
00339     static char* GetEffectorNodeName(EEffectorNodeId pEffectorNodeId);
00340 
00346     static EEffectorNodeId GetEffectorNodeId(char* pEffectorNodeName);
00347 
00348 
00350 //
00351 //  WARNING!
00352 //
00353 //  Anything beyond these lines may not be documented accurately and is
00354 //  subject to change without notice.
00355 //
00357 
00358 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00359 
00360 private:
00361 
00362     KFbxControlSet();
00363     ~KFbxControlSet();
00364 
00365     KFbxCharacter* mCharacter;
00366     EType mType;
00367     bool mUseAxis;
00368     bool mLockTransform;
00369     bool mLock3DPick;
00370     KFbxControlSetLink mControlSetLink[eCharacterLastNodeId]; // Except floor node IDs!
00371     KFbxEffector mEffector[eEffectorLastNodeId];
00372     KFbxNode* mEffectorAux[eEffectorLastNodeId][eLastEffectorSetId-1];
00373 
00374     friend class KFbxCharacter;
00375     friend class KFbxNode;
00376 
00377 public:
00378 
00379     void FromPlug(KFbxControlSetPlug *pPlug);
00380     void ToPlug(KFbxControlSetPlug *pPlug);
00381 
00382 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00383 
00384 };
00385 
00389 class KFBX_DLL KFbxControlSetPlug : public KFbxObject
00390 {
00391     KFBXOBJECT_DECLARE(KFbxControlSetPlug,KFbxObject);
00392 public:
00393 
00395         KFbxTypedProperty<KFbxControlSet::EType>    ControlSetType;
00397         KFbxTypedProperty<bool>                     UseAxis;
00399         KFbxTypedProperty<fbxReference*>            Character;
00400 
00406 
00410         KError& GetError();
00411 
00413         typedef enum
00414         {
00415             eERROR,
00416             eERROR_COUNT
00417         } EError;
00418 
00422         EError GetLastErrorID() const;
00423 
00427         const char* GetLastErrorString() const;
00428 
00430 
00431     protected:
00432         KFbxControlSetPlug(KFbxSdkManager& pManager, char const* pName);
00433 
00434         virtual void Construct(const KFbxControlSetPlug* pFrom);
00435 
00436     public:
00437         virtual KStringList GetTypeFlags() const;
00438 
00439     protected:
00440         KArrayTemplate<KFbxProperty>    mFKBuf;
00441         KArrayTemplate<KFbxProperty>    mIKBuf;
00442 
00443         KError mError;
00444 
00445         friend class KFbxScene;
00446         friend class KFbxControlSet;
00447 };
00448 
00449 typedef KFbxControlSetPlug* HKFbxControlSetPlug;
00450 inline EFbxType FbxTypeOf( KFbxControlSet::EType const &pItem ) { return eENUM; }
00451 
00452 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00453 
00454 #endif // FBXFILESDK_KFBXCHARACTER_KFBXCONTROLSET_H
00455