Developer Documentation
JointT< PointT > Class Template Reference

Represents a single joint in the skeleton. More...

#include <Type-Skeleton/ObjectTypes/Skeleton/JointT.hh>

Public Types

typedef PointT Point
 
typedef Point::value_type Scalar
 
typedef JointT< PointT > Joint
 
typedef std::vector< Joint * >::iterator ChildIter
 

Public Member Functions

 JointT (const Joint &_other)
 Constructor. More...
 
 JointT (Joint *_parent, std::string _name="")
 Default constructor, creates a joint pointing to the origin. More...
 
 ~JointT ()
 Destructor. More...
 
size_t id () const
 returns the joint id More...
 
void setParent (Joint *_newParent, SkeletonT< PointT > &_skeleton)
 access parent of the joint More...
 
Jointparent ()
 Returns the parent joint. More...
 
bool isRoot () const
 
Child access

Use this iterator to access the joints child nodes

ChildIter begin ()
 Returns an iterator on the joints children. More...
 
ChildIter end ()
 Returns the end iterator for the joints children. More...
 
size_t size () const
 Returns the number of children. More...
 
Jointchild (size_t _index)
 Returns the child joint with the given index. More...
 

Friends

template<class >
class SkeletonT
 

Selections

change and access selection state

size_t id_
 An unique identifier, guaranteed to be part of a continuous sequence starting from 0. More...
 
bool selected_
 An unique identifier, guaranteed to be part of a continuous sequence starting from 0. More...
 
Jointparent_
 The parent joint; this joint is in its parents JointT::children_ vector. It's 0 for the root node. More...
 
std::vector< Joint * > children_
 The joints children, use the JointT::getChild method to access them. More...
 
std::string name_
 the name of the joint More...
 
bool selected () const
 Returns the joint's selection state. More...
 
void setSelected (bool _selected)
 Set the joint's selction state. More...
 
std::string name () const
 Access the name of the joint. More...
 
void setName (const std::string &_name)
 An unique identifier, guaranteed to be part of a continuous sequence starting from 0. More...
 
void setId (const size_t _id)
 An unique identifier, guaranteed to be part of a continuous sequence starting from 0. More...
 

Detailed Description

template<class PointT>
class JointT< PointT >

Represents a single joint in the skeleton.

The skeleton is made up by a hierarchical structure of joints. The joints don't store their position themselves. Instead, the joint positions are stored in poses. The poses are managed by the AnimationT class and the skeleton.

Definition at line 60 of file JointT.hh.

Member Typedef Documentation

◆ ChildIter

template<class PointT >
typedef std::vector<Joint*>::iterator JointT< PointT >::ChildIter

Definition at line 69 of file JointT.hh.

◆ Joint

template<class PointT >
typedef JointT<PointT> JointT< PointT >::Joint

Definition at line 68 of file JointT.hh.

◆ Point

template<class PointT >
typedef PointT JointT< PointT >::Point

Definition at line 66 of file JointT.hh.

◆ Scalar

template<class PointT >
typedef Point::value_type JointT< PointT >::Scalar

Definition at line 67 of file JointT.hh.

Constructor & Destructor Documentation

◆ JointT() [1/2]

template<typename PointT >
JointT< PointT >::JointT ( const Joint _other)

Constructor.

Copy constructor, creates an incomplete copy of the given joint.

The parent and children cannot be copied, since they are provided as pointers only. Furthermore, if a skeleton is being cloned the corresponding joints may not yet exist in this skeleton.

Definition at line 73 of file JointT_impl.hh.

◆ JointT() [2/2]

template<class PointT >
JointT< PointT >::JointT ( Joint _parent,
std::string  _name = "" 
)

Default constructor, creates a joint pointing to the origin.

Definition at line 56 of file JointT_impl.hh.

◆ ~JointT()

template<class PointT >
JointT< PointT >::~JointT

Destructor.

Definition at line 84 of file JointT_impl.hh.

Member Function Documentation

◆ begin()

template<class PointT >
JointT< PointT >::ChildIter JointT< PointT >::begin
inline

Returns an iterator on the joints children.

Definition at line 175 of file JointT_impl.hh.

◆ child()

template<typename PointT >
JointT< PointT > * JointT< PointT >::child ( size_t  _index)
inline

Returns the child joint with the given index.

Parameters
_indexThe child nodes index
Returns
A pointer to the child joint or zero if the index was out of range

Definition at line 211 of file JointT_impl.hh.

◆ end()

template<class PointT >
JointT< PointT >::ChildIter JointT< PointT >::end
inline

Returns the end iterator for the joints children.

Definition at line 186 of file JointT_impl.hh.

◆ id()

template<class PointT >
size_t JointT< PointT >::id
inline

returns the joint id

Returns the joints index.

The index is part of a continuous sequence out of the interval [0, number of joints). It is guaranteed not to change, unless joints are deleted from the skeleton.

Definition at line 97 of file JointT_impl.hh.

◆ isRoot()

template<class PointT >
bool JointT< PointT >::isRoot
inline

Definition at line 164 of file JointT_impl.hh.

◆ name()

template<typename PointT >
std::string JointT< PointT >::name ( void  ) const
inline

Access the name of the joint.

Definition at line 247 of file JointT_impl.hh.

◆ parent()

template<class PointT >
JointT< PointT > * JointT< PointT >::parent
inline

Returns the parent joint.

If you want to know the root position of a joint, then just take its parents global position. They always match, since a joint is always directly attached to its parent.

Definition at line 156 of file JointT_impl.hh.

◆ selected()

template<class PointT >
bool JointT< PointT >::selected
inline

Returns the joint's selection state.

Definition at line 227 of file JointT_impl.hh.

◆ setId()

template<class PointT >
void JointT< PointT >::setId ( const size_t  _id)
inlineprotected

An unique identifier, guaranteed to be part of a continuous sequence starting from 0.

Definition at line 105 of file JointT_impl.hh.

◆ setName()

template<typename PointT >
void JointT< PointT >::setName ( const std::string &  _name)
inline

An unique identifier, guaranteed to be part of a continuous sequence starting from 0.

Definition at line 254 of file JointT_impl.hh.

◆ setParent()

template<class PointT >
void JointT< PointT >::setParent ( Joint _newParent,
SkeletonT< PointT > &  _skeleton 
)
inline

access parent of the joint

Replaces this joints parent joint.

After calling this method this joint is child of the given joint. Keep in mind that this will corrupt the joints local matrix in all poses.

Parameters
_newParentThe new parent joint
_skeletonThe skeleton this joint is part of, used to update the poses local matrices

Definition at line 122 of file JointT_impl.hh.

◆ setSelected()

template<class PointT >
void JointT< PointT >::setSelected ( bool  _selected)
inline

Set the joint's selction state.

Definition at line 239 of file JointT_impl.hh.

◆ size()

template<typename PointT >
size_t JointT< PointT >::size
inline

Returns the number of children.

Definition at line 197 of file JointT_impl.hh.

Friends And Related Function Documentation

◆ SkeletonT

template<class PointT >
template<class >
friend class SkeletonT
friend

Definition at line 63 of file JointT.hh.

Member Data Documentation

◆ children_

template<class PointT >
std::vector<Joint*> JointT< PointT >::children_
protected

The joints children, use the JointT::getChild method to access them.

Definition at line 123 of file JointT.hh.

◆ id_

template<class PointT >
size_t JointT< PointT >::id_
private

An unique identifier, guaranteed to be part of a continuous sequence starting from 0.

Definition at line 114 of file JointT.hh.

◆ name_

template<class PointT >
std::string JointT< PointT >::name_
protected

the name of the joint

Definition at line 125 of file JointT.hh.

◆ parent_

template<class PointT >
Joint* JointT< PointT >::parent_
protected

The parent joint; this joint is in its parents JointT::children_ vector. It's 0 for the root node.

Definition at line 121 of file JointT.hh.

◆ selected_

template<class PointT >
bool JointT< PointT >::selected_
private

An unique identifier, guaranteed to be part of a continuous sequence starting from 0.

Definition at line 115 of file JointT.hh.


The documentation for this class was generated from the following files: