Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes

OpenTissue::skeleton::Skeleton< types > Class Template Reference

#include <skeleton_skeleton.h>

List of all members.

Public Types

typedef types::math_types math_types
typedef types::bone_traits bone_traits
typedef types::bone_type bone_type
typedef types::skeleton_type skeleton_type
typedef bone_container::iterator bone_iterator
typedef
bone_container::const_iterator 
const_bone_iterator

Public Member Functions

 Skeleton ()
bone_iterator begin ()
const_bone_iterator begin () const
bone_iterator end ()
const_bone_iterator end () const
bone_typeroot ()
bone_type const * root () const
size_t size () const
bone_typeget_bone (size_t const &number)
bone_type const * get_bone (size_t const &number) const
bone_iterator get_bone_iterator (size_t const &number)
bone_typeget_bone (std::string const &name)
bool rename_bone (bone_type *bone, std::string const &name)
bone_typecreate_bone ()
bone_typecreate_bone (bone_type *parent)
void clear ()
void compute_pose ()
void clear_pose ()
void set_bind_pose ()
void clear_weights ()

Protected Types

typedef math_types::value_traits value_traits
typedef math_types::vector3_type vector3_type
typedef math_types::quaternion_type quaternion_type
typedef math_types::real_type real_type
typedef std::list< bone_typebone_container
typedef std::map< std::string,
size_t > 
bone_number_lut_container
typedef std::vector< bone_type * > bone_ptr_lut_container
typedef
bone_number_lut_container::iterator 
lut_iterator

Protected Member Functions

bone_typefind_bone (size_t const &number) const
bone_typeregister_bone ()

Protected Attributes

bone_container m_bones
 All bones in skeleton.
bone_number_lut_container m_bone_number_lut
 Lookup table to get bone number from bone name.
bone_ptr_lut_container m_bone_ptr_lut
 Lookup table to get bone pointer from bone number.
bone_typem_root
 Pointer to root bone.

Detailed Description

template<typename types>
class OpenTissue::skeleton::Skeleton< types >

A Skeleton Class. A skeleton is a collection of bones. One bone is designated as the root bone, all other bones are connected such that they form a recursive tree structure with the root bone as the root.

This class provides an interface for building up the skeleton in a consistent manner. While during so bones are assigned unique numbers identifying their placement in the hierarchical tree structure. It is ensured that parents always have a bone number less than their children or any descendents.

The class also provides internal book-keeping which provides the means for accessing bones either by their names or by their bone number.


Member Typedef Documentation

template<typename types >
typedef std::list<bone_type> OpenTissue::skeleton::Skeleton< types >::bone_container [protected]
template<typename types >
typedef bone_container::iterator OpenTissue::skeleton::Skeleton< types >::bone_iterator
template<typename types >
typedef std::map<std::string,size_t> OpenTissue::skeleton::Skeleton< types >::bone_number_lut_container [protected]
template<typename types >
typedef std::vector<bone_type*> OpenTissue::skeleton::Skeleton< types >::bone_ptr_lut_container [protected]
template<typename types >
typedef types::bone_traits OpenTissue::skeleton::Skeleton< types >::bone_traits
template<typename types >
typedef types::bone_type OpenTissue::skeleton::Skeleton< types >::bone_type
template<typename types >
typedef bone_container::const_iterator OpenTissue::skeleton::Skeleton< types >::const_bone_iterator
template<typename types >
typedef bone_number_lut_container::iterator OpenTissue::skeleton::Skeleton< types >::lut_iterator [protected]
template<typename types >
typedef types::math_types OpenTissue::skeleton::Skeleton< types >::math_types
template<typename types >
typedef math_types::quaternion_type OpenTissue::skeleton::Skeleton< types >::quaternion_type [protected]
template<typename types >
typedef math_types::real_type OpenTissue::skeleton::Skeleton< types >::real_type [protected]
template<typename types >
typedef math_types::value_traits OpenTissue::skeleton::Skeleton< types >::value_traits [protected]
template<typename types >
typedef math_types::vector3_type OpenTissue::skeleton::Skeleton< types >::vector3_type [protected]

Constructor & Destructor Documentation

template<typename types >
OpenTissue::skeleton::Skeleton< types >::Skeleton (  )  [inline]

Member Function Documentation

template<typename types >
bone_iterator OpenTissue::skeleton::Skeleton< types >::begin (  )  [inline]
Returns:
An iterator to the position of the first bone in skeleton (this is actually always the root).
template<typename types >
const_bone_iterator OpenTissue::skeleton::Skeleton< types >::begin (  )  const [inline]
template<typename types >
void OpenTissue::skeleton::Skeleton< types >::clear ( void   )  [inline]

Clear all content in skeleton.

template<typename types >
void OpenTissue::skeleton::Skeleton< types >::clear_pose (  )  [inline]

Clear all relative transforms to the identity transformation and sets the bone weights to zero. This method is usefull to invoke prior to doing animation blending.

template<typename types >
void OpenTissue::skeleton::Skeleton< types >::clear_weights (  )  [inline]

This method sets all bone weights to zero.

template<typename types >
void OpenTissue::skeleton::Skeleton< types >::compute_pose (  )  [inline]

Compute Pose of Skeleton. This method computes the absolute bone transformation of each bone and updates the bone space transformation of each bone.

template<typename types >
bone_type* OpenTissue::skeleton::Skeleton< types >::create_bone (  )  [inline]

Create new bone. This method should only be used when inserting the first bone into the skeleton. This bone will automatically become the root bone.

Returns:
A pointer to the newly added bone.
template<typename types >
bone_type* OpenTissue::skeleton::Skeleton< types >::create_bone ( bone_type parent  )  [inline]

Add new bone. This method should be used to add bones as children of already added bones in the skeleton.

Parameters:
parent A pointer to the parent bone. Must already have been added to the skeleton.
Returns:
A pointer to the newly added bone.
template<typename types >
const_bone_iterator OpenTissue::skeleton::Skeleton< types >::end (  )  const [inline]
template<typename types >
bone_iterator OpenTissue::skeleton::Skeleton< types >::end (  )  [inline]
Returns:
An iterator to a position one past the last bone in the skeleton (this is one of perhaps several end-effctors).
template<typename types >
bone_type* OpenTissue::skeleton::Skeleton< types >::find_bone ( size_t const &  number  )  const [inline, protected]

Find Bone.

Parameters:
number The bone number of the sought bone.
Returns:
A pointer to the bone with the specified number or null if it does not exist.
template<typename types >
bone_type* OpenTissue::skeleton::Skeleton< types >::get_bone ( size_t const &  number  )  [inline]

Get Bone.

Parameters:
number The bone number of the sought bone.
Returns:
A reference to the bone with the specified number.
template<typename types >
bone_type const* OpenTissue::skeleton::Skeleton< types >::get_bone ( size_t const &  number  )  const [inline]

Get Bone.

Parameters:
number The bone number of the sought bone.
Returns:
A reference to the bone with the specified number.
template<typename types >
bone_type* OpenTissue::skeleton::Skeleton< types >::get_bone ( std::string const &  name  )  [inline]

Get Bone.

Parameters:
name The name of the sought bone.
Returns:
A reference to the bone with the specified name.
template<typename types >
bone_iterator OpenTissue::skeleton::Skeleton< types >::get_bone_iterator ( size_t const &  number  )  [inline]

Get Bone.

Parameters:
number The bone number of the sought bone.
Returns:
An iterator to the bone with the specified number.
template<typename types >
bone_type* OpenTissue::skeleton::Skeleton< types >::register_bone (  )  [inline, protected]

Register new Bone in Skeleton.

Returns:
A pointer to the newly inserted bone.
template<typename types >
bool OpenTissue::skeleton::Skeleton< types >::rename_bone ( bone_type bone,
std::string const &  name 
) [inline]

Bone Renaming Method.

Parameters:
bone a pointer to the bone that should be renamed.
name The new name of the bone.
Returns:
If the rename is succesfull then the return value is true otherwise it is false.
template<typename types >
bone_type* OpenTissue::skeleton::Skeleton< types >::root (  )  [inline]

Get Root Bone.

Returns:
A pointer to the root bone of the skeleton or null if none exist
template<typename types >
bone_type const* OpenTissue::skeleton::Skeleton< types >::root (  )  const [inline]

Get Root Bone.

Returns:
A pointer to the root bone of the skeleton or null if none exist
template<typename types >
void OpenTissue::skeleton::Skeleton< types >::set_bind_pose (  )  [inline]

Thie method sets the relative bone transforms to the bind pose and compute the absolute bone transformation of each bone. Also all bone weights are set to zero.

template<typename types >
size_t OpenTissue::skeleton::Skeleton< types >::size (  )  const [inline]

Skeleton Size.

Returns:
The number of bones in the skeleton.

Member Data Documentation

Lookup table to get bone number from bone name.

Lookup table to get bone pointer from bone number.

template<typename types >
bone_container OpenTissue::skeleton::Skeleton< types >::m_bones [protected]

All bones in skeleton.

template<typename types >
bone_type* OpenTissue::skeleton::Skeleton< types >::m_root [protected]

Pointer to root bone.


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