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