FBX SDK Reference Guide: kfbxcontrolset.h Source File
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 © 2001 - 2008 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 
00042 #include <fbxfilesdk/components/kbaselib/kaydaradef_h.h>
00043 #include <fbxfilesdk/components/kbaselib/kaydara.h>
00044 
00045 #include <fbxfilesdk/kfbxcharacter/kfbxcharacter.h>
00046 
00047 #include <fbxfilesdk/kfbxmath/kfbxxmatrix.h>
00048 
00049 #include <fbxfilesdk/components/kbaselib/klib/kstring.h>
00050 
00051 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00052 
00053 class KFbxNode;
00054 class KFbxSdkManager;
00055 class KFbxControlSetPlug;
00056 class KFbxControlSetPlug_internal;
00057 
00058 typedef enum
00059 {
00060     eEffectorHips = 0,
00061     eEffectorLeftAnkle,
00062     eEffectorRightAnkle,
00063     eEffectorLeftWrist,
00064     eEffectorRightWrist,
00065     eEffectorLeftKnee,
00066     eEffectorRightKnee,
00067     eEffectorLeftElbow,
00068     eEffectorRightElbow,
00069     eEffectorChestOrigin,
00070     eEffectorChestEnd,
00071     eEffectorLeftFoot,
00072     eEffectorRightFoot,
00073     eEffectorLeftShoulder,
00074     eEffectorRightShoulder,
00075     eEffectorHead,
00076     eEffectorLeftHip,
00077     eEffectorRightHip,
00078 
00079     // Added for 4.5
00080 
00081     eEffectorLeftHand,
00082     eEffectorRightHand,
00083 
00084     eEffectorLeftHandThumb,
00085     eEffectorLeftHandIndex,
00086     eEffectorLeftHandMiddle,
00087     eEffectorLeftHandRing,
00088     eEffectorLeftHandPinky,
00089     eEffectorLeftHandExtraFinger,
00090 
00091     eEffectorRightHandThumb,
00092     eEffectorRightHandIndex,
00093     eEffectorRightHandMiddle,
00094     eEffectorRightHandRing,
00095     eEffectorRightHandPinky,
00096     eEffectorRightHandExtraFinger,
00097 
00098     eEffectorLeftFootThumb,
00099     eEffectorLeftFootIndex,
00100     eEffectorLeftFootMiddle,
00101     eEffectorLeftFootRing,
00102     eEffectorLeftFootPinky,
00103     eEffectorLeftFootExtraFinger,
00104 
00105     eEffectorRightFootThumb,
00106     eEffectorRightFootIndex,
00107     eEffectorRightFootMiddle,
00108     eEffectorRightFootRing,
00109     eEffectorRightFootPinky,
00110     eEffectorRightFootExtraFinger,
00111 
00112     eEffectorLastNodeId
00113 } EEffectorNodeId;
00114 
00115 typedef enum
00116 {
00117     eEffectorSetDefault = 0,
00118     eEffectorSetAux1,
00119     eEffectorSetAux2,
00120     eEffectorSetAux3,
00121     eEffectorSetAux4,
00122     eEffectorSetAux5,
00123     eEffectorSetAux6,
00124     eEffectorSetAux7,
00125     eEffectorSetAux8,
00126     eEffectorSetAux9,
00127     eEffectorSetAux10,
00128     eEffectorSetAux11,
00129     eEffectorSetAux12,
00130     eEffectorSetAux13,
00131     eEffectorSetAux14,
00132     eLastEffectorSetId
00133 } EEffectorSetId;
00134 
00135 
00141 class KFBX_DLL KFbxControlSetLink
00142 {
00143 
00144 public:
00145 
00147     KFbxControlSetLink();
00148 
00152     KFbxControlSetLink(const KFbxControlSetLink& pControlSetLink);
00156     KFbxControlSetLink& operator=(const KFbxControlSetLink& pControlSetLink);
00157 
00162     void Reset();
00163 
00165     KFbxNode* mNode;
00166 
00169     KString mTemplateName;
00170 };
00171 
00177 class KFBX_DLL KFbxEffector
00178 {
00179 
00180 public:
00181 
00183     KFbxEffector();
00187     KFbxEffector& operator=(KFbxEffector& pEffector);
00188 
00194     void Reset();
00195 
00197     KFbxNode* mNode;
00198 
00200     bool mShow;
00201 
00202     // These members are for backward compatibility and should not be used. These properties are now published through class KFbxControlSetPlug.
00203 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00204     bool mTActive;
00205     bool mRActive;
00206     bool mCandidateTActive;
00207     bool mCandidateRActive;
00208 #endif
00209 };
00210 
00225 class KFBX_DLL KFbxControlSet
00226 {
00227 
00228 public:
00229 
00233     void Reset();
00234 
00240     enum EType
00241     {
00242         eNone,
00243         eFkIk,
00244         eIkOnly
00245     };
00246 
00250     void SetType(EType pType);
00251 
00255     EType GetType();
00256 
00260     void SetUseAxis(bool pUseAxis);
00261 
00265     bool GetUseAxis();
00266 
00270     void SetLockTransform(bool pLockTransform);
00271 
00275     bool GetLockTransform();
00276 
00280     void SetLock3DPick(bool pLock3DPick);
00281 
00285     bool GetLock3DPick();
00286 
00296     bool SetControlSetLink(ECharacterNodeId pCharacterNodeId, const KFbxControlSetLink& pControlSetLink);
00297 
00307     bool GetControlSetLink(ECharacterNodeId pCharacterNodeId, KFbxControlSetLink* pControlSetLink = NULL);
00308 
00314     bool SetEffector(EEffectorNodeId pEffectorNodeId, KFbxEffector pEffector);
00315 
00321     bool GetEffector(EEffectorNodeId pEffectorNodeId, KFbxEffector* pEffector = NULL);
00322 
00329     bool SetEffectorAux(EEffectorNodeId pEffectorNodeId, KFbxNode* pNode,EEffectorSetId pEffectorSetId = eEffectorSetAux1);
00330 
00337     bool GetEffectorAux(EEffectorNodeId pEffectorNodeId, KFbxNode** pNode = NULL,EEffectorSetId pEffectorSetId = eEffectorSetAux1);
00338 
00343     static char* GetEffectorNodeName(EEffectorNodeId pEffectorNodeId);
00344 
00350     static EEffectorNodeId GetEffectorNodeId(char* pEffectorNodeName);
00351 
00352 
00354 //
00355 //  WARNING!
00356 //
00357 //  Anything beyond these lines may not be documented accurately and is
00358 //  subject to change without notice.
00359 //
00361 
00362 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00363 
00364 private:
00365 
00366     KFbxControlSet();
00367     ~KFbxControlSet();
00368 
00369     KFbxCharacter* mCharacter;
00370     EType mType;
00371     bool mUseAxis;
00372     bool mLockTransform;
00373     bool mLock3DPick;
00374     KFbxControlSetLink mControlSetLink[eCharacterLastNodeId]; // Except floor node IDs!
00375     KFbxEffector mEffector[eEffectorLastNodeId];
00376     KFbxNode* mEffectorAux[eEffectorLastNodeId][eLastEffectorSetId-1];
00377 
00378     friend class KFbxCharacter;
00379     friend class KFbxNode;
00380 
00381 public:
00382 
00383     void FromPlug(KFbxControlSetPlug *pPlug);
00384     void ToPlug(KFbxControlSetPlug *pPlug);
00385 
00386 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00387 
00388 };
00389 
00393 class KFBX_DLL KFbxControlSetPlug : public KFbxTakeNodeContainer
00394 {
00395     KFBXOBJECT_DECLARE(KFbxControlSetPlug,KFbxTakeNodeContainer);
00396 public:
00397 
00399         KFbxTypedProperty<KFbxControlSet::EType>    ControlSetType;
00401         KFbxTypedProperty<bool>                     UseAxis;
00403         KFbxTypedProperty<fbxReference*>            Character;
00404 
00410 
00414         KError& GetError();
00415 
00417         typedef enum
00418         {
00419             eERROR,
00420             eERROR_COUNT
00421         } EError;
00422 
00426         EError GetLastErrorID() const;
00427 
00431         const char* GetLastErrorString() const;
00432 
00434 
00440         virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType) const;
00441 
00442     protected:
00443         KFbxControlSetPlug(KFbxSdkManager& pManager, char const* pName);
00444         virtual ~KFbxControlSetPlug();
00445 
00446         virtual void Construct(const KFbxControlSetPlug* pFrom);
00447         virtual void Destruct(bool pRecursive, bool pDependents);
00448 
00449     public:
00450         virtual KString     GetTypeName() const;
00451         virtual KStringList GetTypeFlags() const;
00452 
00453     protected:
00454         KArrayTemplate<KFbxProperty>    mFKBuf;
00455         KArrayTemplate<KFbxProperty>    mIKBuf;
00456 
00457         KError mError;
00458 
00459         friend class KFbxScene;
00460         friend class KFbxControlSet;
00461 };
00462 
00463 typedef KFbxControlSetPlug* HKFbxControlSetPlug;
00464 inline EFbxType FbxTypeOf( KFbxControlSet::EType const &pItem ) { return eENUM; }
00465 
00466 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00467 
00468 #endif // FBXFILESDK_KFBXCHARACTER_KFBXCONTROLSET_H
00469