00001 #ifndef BONE_H
00002 #define BONE_H
00003
00004 #include <vector>
00005 #include "include/IvVector3.h"
00006 #include "Constraint.h"
00007 #include "Mapping.h"
00008
00009 using namespace std;
00010
00011 namespace model {
00012
00030 class Bone {
00031 private:
00032 #ifdef DOXYGEN_SHOULD_SKIP_THIS
00033 Bone* m_vChilds;
00034 Constraint* m_lConstraints;
00035 Mapping* m_lMapping;
00036 #else
00037 vector<Bone*> m_vChilds;
00038 vector<Constraint*> m_lConstraints;
00039 vector<Mapping*> m_lMapping;
00040 #endif
00041 Bone* m_parent;
00042 IvVector3* m_vDirection;
00043 float m_fLength;
00044 string m_sName;
00045
00046
00047 Bone(Bone* parent, IvVector3* vDirection, float fLength, string name);
00048
00064 ~Bone() {};
00065
00066
00067 Bone(const Bone& other);
00068 Bone& operator=(const Bone& other);
00069
00070 void setParent(Bone* bone);
00071
00072 public:
00073 Bone* getParent();
00074 vector<Bone*> getChilds();
00075 IvVector3* getDirection();
00076 float getLength();
00077 vector<Constraint*> getConstraints();
00078 vector<Mapping*> getMapping();
00079
00080 void setDirection(IvVector3* vDirection);
00081 void setLength(float fLength);
00082 void setConstraints(vector<Constraint*> lConstraints);
00083 void setMapping(vector<Mapping*> lMapping);
00084
00085 void addConstraint(Constraint* constraint);
00086 void addMapping(Mapping* mapping);
00087 void addChild(Bone* bone);
00088
00089 void removeConstraint(Constraint* constraint);
00090 void removeMapping(Mapping* mapping);
00091 void removeChild(string name);
00092
00093 void setName(string name);
00094 string getName();
00095
00096
00097 bool operator==( const Bone& other ) const;
00098 bool operator!=( const Bone& other ) const;
00099
00100 friend class Skeleton;
00101 };
00102
00108 }
00109
00110 #endif //BONE_H