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_;
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 void removeAnimation(std::string _name)
Removes an animation from the list.
Iterator class for the skeleton.
Iterator & operator++()
Increase the iterator.
unsigned int child(unsigned int _joint, unsigned int _child)
Returns the child with the given index.
std::vector< Animation * > animations_
Animations defined on the skeleton.
bool operator!=(const Iterator &other) const
Compares the iterators.
Represents a single joint in the skeleton.
std::map< std::string, unsigned int > names_
Binds a name to each animation.
unsigned int childCount(unsigned int _joint)
Returns the number of children of the given node.
unsigned int jointCount()
Returns the number of joints.
Iterator begin()
Iterator over joints of the skeletal tree in TOP-DOWN order (from root to leafs)
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.
The header for the properties, one file for all objects.
Iterator()
Default constructor.
std::vector< Joint * > joints_
Joints of the skeleton.
A general pose, used to store the frames of the animation.
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.
void insertJoint(typename SkeletonT< PointT >::Joint *_pChild, typename SkeletonT< PointT >::Joint *_pInsert)
insert a Joint given its future child joint
void replaceAnimationName(const std::string &_strOld, const std::string &_strNew)
Returns a pointer to the pose with the given animation handle.
A handle used to refer to an animation or to a specific frame in an animation.
AnimationIterator animationsBegin()
Iterator over the animations.
The properties storage class.
Pose referencePose_
The skeletons reference pose.
AnimationHandle animationHandle(std::string _name)
Get an AnimationHandle to the animation with the given name.
Iterator & operator=(const Iterator &other)
Assignment Operator.
AnimationHandle cloneAnimation(std::string _name, const AnimationHandle &_hAni)
Creates a new animation by cloning an existing one.
Joint * operator->() const
Returns a pointer to the current joint.
Iterator end()
Compare an iterator with the return value of this method to test if it is done.
void addJoint(typename SkeletonT< PointT >::Joint *_pParent, typename SkeletonT< PointT >::Joint *_pJoint)
Adds a joint as child of a given parent joint.
unsigned int animationCount()
Returns the number of animations stored in this skeleton.
Stores a single animation.
int parent(unsigned int _joint)
Returns the parents id of the given node.
void clearAnimations()
Removes all animations.
Pose * pose(const AnimationHandle &_hAni)
Returns a pointer to the pose with the given animation handle.
bool operator==(const Iterator &other) const
Compares the iterators.
Iterator class for the animations attached to a skeleton.
void clear()
Removes all joints from the skeleton.
SkeletonT()
Default constructor.
Joint * joint(const unsigned int &_index)
Returns the joint with the given index.
AnimationHandle addAnimation(std::string _name, Animation *_animation)
Adds a new animation to the list.
void updateFromGlobal(unsigned int _idJoint)
update the structure when parent changes for a joint
void removeJoint(typename SkeletonT< PointT >::Joint *_pJoint)
Remove the given joint from the tree.
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.