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