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