60 #include "Animation/AnimationT.hh"
65 template <
class Po
intT>
73 typedef typename Point::value_type Scalar;
103 operator bool()
const;
106 Joint *
nextSibling(Joint *_pParent, Joint *_pJoint);
112 std::stack<Joint*> stJoints_;
123 AnimationIterator(std::vector<Animation*>& _animations,
unsigned int _animationIndex );
129 operator bool()
const;
132 unsigned int currentIndex_;
134 std::vector<Animation*>& animations_;
165 inline Joint *
root();
167 inline Joint *
joint(
const unsigned int &_index);
168 int parent(
unsigned int _joint);
170 unsigned int child(
unsigned int _joint,
unsigned int _child);
197 std::map<std::string,unsigned int>::iterator f =
names_.find(_strOld);
199 unsigned int c = f->second;
224 std::map<std::string, unsigned int>
names_;
234 #if defined(INCLUDE_TEMPLATES) && !defined(SKELETON_C)
235 #define SKELETONT_TEMPLATES
236 #include "SkeletonT.cc"
239 #endif // SKELETONT_HH defined
unsigned int child(unsigned int _joint, unsigned int _child)
Returns the child with the given index.
unsigned int childCount(unsigned int _joint)
Returns the number of children of the given node.
AnimationIterator(std::vector< Animation * > &_animations)
Default constructor.
std::vector< Joint * > joints_
Joints of the skeleton.
int parent(unsigned int _joint)
Returns the parents id of the given node.
Iterator class for the animations attached to a skeleton.
void addJoint(typename SkeletonT< PointT >::Joint *_pParent, typename SkeletonT< PointT >::Joint *_pJoint)
Adds a joint as child of a given parent joint.
void clearAnimations()
Removes all animations.
bool operator==(const Iterator &other) const
Compares the iterators.
Pose referencePose_
The skeletons reference pose.
The properties storage class.
Pose * pose(const AnimationHandle &_hAni)
Returns a pointer to the pose with the given animation handle.
Joint * root()
Returns the root joint.
AnimationIterator animationsEnd()
Returns an iterator pointing behind the last animation.
Pose * referencePose()
Returns a pointer to the reference pose.
Joint * nextSibling(Joint *_pParent, Joint *_pJoint)
Given a parent and one of its child nodes this method finds and returns the next sibling.
Animation * animation(std::string _name)
Returns a pointer to the animation to the given name.
Iterator & operator=(const Iterator &other)
Assignment Operator.
void removeAnimation(std::string _name)
Removes an animation from the list.
A general pose, used to store the frames of the animation.
unsigned int jointCount()
Returns the number of joints.
Iterator end()
Compare an iterator with the return value of this method to test if it is done.
Iterator class for the skeleton.
Iterator()
Default constructor.
Joint * joint(const unsigned int &_index)
Returns the joint with the given index.
void removeJoint(typename SkeletonT< PointT >::Joint *_pJoint)
Remove the given joint from the tree.
AnimationHandle animationHandle(std::string _name)
Get an AnimationHandle to the animation with the given name.
AnimationHandle cloneAnimation(std::string _name, const AnimationHandle &_hAni)
Creates a new animation by cloning an existing one.
AnimationIterator & operator=(const AnimationIterator &other)
Operator =.
Iterator begin()
Iterator over joints of the skeletal tree in TOP-DOWN order (from root to leafs)
The header for the properties, one file for all objects.
AnimationIterator & operator++()
Increase the iterator.
void replaceAnimationName(const std::string &_strOld, const std::string &_strNew)
Returns a pointer to the pose with the given animation handle.
std::map< std::string, unsigned int > names_
Binds a name to each animation.
unsigned int animationCount()
Returns the number of animations stored in this skeleton.
Joint * operator->() const
Returns a pointer to the current joint.
void updateFromGlobal(unsigned int _idJoint)
update the structure when parent changes for a joint
bool operator!=(const Iterator &other) const
Compares the iterators.
void insertJoint(typename SkeletonT< PointT >::Joint *_pChild, typename SkeletonT< PointT >::Joint *_pInsert)
insert a Joint given its future child joint
Iterator & operator++()
Increase the iterator.
AnimationHandle operator*() const
Get an animation handle for the current animation.
A handle used to refer to an animation or to a specific frame in an animation.
SkeletonT & operator=(const SkeletonT< PointT > &_other)
Assignment operator.
Stores a single animation.
Joint * operator*() const
Returns a pointer to the current joint.
const std::string & animationName(unsigned int _index)
Returns the name of the animation with the given index.
AnimationHandle addAnimation(std::string _name, Animation *_animation)
Adds a new animation to the list.
Represents a single joint in the skeleton.
std::vector< Animation * > animations_
Animations defined on the skeleton.
AnimationIterator animationsBegin()
Iterator over the animations.
void clear()
Removes all joints from the skeleton.
SkeletonT()
Default constructor.