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