00001
00004 #ifndef _FBXSDK_CONTROL_SET_H_
00005 #define _FBXSDK_CONTROL_SET_H_
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #include <kaydaradef.h>
00043 #ifndef KFBX_DLL
00044 #define KFBX_DLL K_DLLIMPORT
00045 #endif
00046
00047 #include <kaydara.h>
00048
00049 #include <kfbxcharacter/kfbxcharacter.h>
00050
00051 #include <kfbxmath/kfbxxmatrix.h>
00052
00053 #include <klib/kstring.h>
00054
00055 #include <fbxfilesdk_nsbegin.h>
00056
00057 class KFbxNode;
00058 class KFbxSdkManager;
00059 class KFbxControlSetPlug;
00060 class KFbxControlSetPlug_internal;
00061
00062 typedef enum
00063 {
00064 eEffectorHips = 0,
00065 eEffectorLeftAnkle,
00066 eEffectorRightAnkle,
00067 eEffectorLeftWrist,
00068 eEffectorRightWrist,
00069 eEffectorLeftKnee,
00070 eEffectorRightKnee,
00071 eEffectorLeftElbow,
00072 eEffectorRightElbow,
00073 eEffectorChestOrigin,
00074 eEffectorChestEnd,
00075 eEffectorLeftFoot,
00076 eEffectorRightFoot,
00077 eEffectorLeftShoulder,
00078 eEffectorRightShoulder,
00079 eEffectorHead,
00080 eEffectorLeftHip,
00081 eEffectorRightHip,
00082
00083
00084
00085 eEffectorLeftHand,
00086 eEffectorRightHand,
00087
00088 eEffectorLeftHandThumb,
00089 eEffectorLeftHandIndex,
00090 eEffectorLeftHandMiddle,
00091 eEffectorLeftHandRing,
00092 eEffectorLeftHandPinky,
00093 eEffectorLeftHandExtraFinger,
00094
00095 eEffectorRightHandThumb,
00096 eEffectorRightHandIndex,
00097 eEffectorRightHandMiddle,
00098 eEffectorRightHandRing,
00099 eEffectorRightHandPinky,
00100 eEffectorRightHandExtraFinger,
00101
00102 eEffectorLeftFootThumb,
00103 eEffectorLeftFootIndex,
00104 eEffectorLeftFootMiddle,
00105 eEffectorLeftFootRing,
00106 eEffectorLeftFootPinky,
00107 eEffectorLeftFootExtraFinger,
00108
00109 eEffectorRightFootThumb,
00110 eEffectorRightFootIndex,
00111 eEffectorRightFootMiddle,
00112 eEffectorRightFootRing,
00113 eEffectorRightFootPinky,
00114 eEffectorRightFootExtraFinger,
00115
00116 eEffectorLastNodeId
00117 } EEffectorNodeId;
00118
00119 typedef enum
00120 {
00121 eEffectorSetDefault = 0,
00122 eEffectorSetAux1,
00123 eEffectorSetAux2,
00124 eEffectorSetAux3,
00125 eEffectorSetAux4,
00126 eEffectorSetAux5,
00127 eEffectorSetAux6,
00128 eEffectorSetAux7,
00129 eEffectorSetAux8,
00130 eEffectorSetAux9,
00131 eEffectorSetAux10,
00132 eEffectorSetAux11,
00133 eEffectorSetAux12,
00134 eEffectorSetAux13,
00135 eEffectorSetAux14,
00136 eLastEffectorSetId
00137 } EEffectorSetId;
00138
00139
00145 class KFBX_DLL KFbxControlSetLink
00146 {
00147
00148 public:
00149
00151 KFbxControlSetLink();
00152
00156 KFbxControlSetLink(const KFbxControlSetLink& pControlSetLink);
00158 KFbxControlSetLink& operator=(const KFbxControlSetLink& pControlSetLink);
00159
00164 void Reset();
00165
00167 KFbxNode* mNode;
00168
00171 KString mTemplateName;
00172 };
00173
00179 class KFBX_DLL KFbxEffector
00180 {
00181
00182 public:
00183
00185 KFbxEffector();
00187 KFbxEffector& operator=(KFbxEffector& pEffector);
00188
00194 void Reset();
00195
00197 KFbxNode* mNode;
00198
00200 bool mShow;
00201
00202
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
00356
00357
00358
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];
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
00436 virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType) const;
00437
00438 protected:
00439 KFbxControlSetPlug(KFbxSdkManager& pManager, char const* pName);
00440 virtual ~KFbxControlSetPlug();
00441
00442 virtual void Construct(const KFbxControlSetPlug* pFrom);
00443 virtual void Destruct(bool pRecursive, bool pDependents);
00444
00445 virtual KString GetTypeName() const;
00446 virtual KStringList GetTypeFlags() const;
00447
00448 KArrayTemplate<KFbxProperty> mFKBuf;
00449 KArrayTemplate<KFbxProperty> mIKBuf;
00450
00451 KError mError;
00452
00453 friend class KFbxReaderFbx;
00454 friend class KFbxWriterFbx;
00455 friend class KFbxWriterFbx6;
00456 friend class KFbxWriterFbx7;
00457 friend struct KFbxWriterFbx7Impl;
00458 friend class KFbxScene;
00459 friend class KFbxControlSet;
00460 };
00461
00462 typedef KFbxControlSetPlug* HKFbxControlSetPlug;
00463 inline EFbxType FbxTypeOf( KFbxControlSet::EType const &pItem ) { return eENUM; }
00464
00465 #include <fbxfilesdk_nsend.h>
00466
00467 #endif // #ifndef _FBXSDK_CONTROL_SET_H_
00468
00469