SkeletonNode Class Reference

A skeleton node. More...

#include <common/common.hh>

Public Types

enum  SkeletonNodeType { NODE, JOINT }
 enumeration of node types More...
 

Public Member Functions

 SkeletonNode (SkeletonNode *_parent)
 Constructor. More...
 
 SkeletonNode (SkeletonNode *_parent, std::string _name, std::string _id, SkeletonNodeType _type=JOINT)
 Constructor. More...
 
virtual ~SkeletonNode ()
 Destructor. More...
 
void AddChild (SkeletonNode *_child)
 Add a new child. More...
 
void AddRawTransform (NodeTransform _t)
 Add a raw transform. More...
 
SkeletonNodeGetChild (unsigned int _index)
 Find a child by index. More...
 
SkeletonNodeGetChildById (std::string _id)
 Get child by string id. More...
 
SkeletonNodeGetChildByName (std::string _name)
 Get child by name. More...
 
unsigned int GetChildCount ()
 Returns the children count. More...
 
unsigned int GetHandle ()
 Get the handle index. More...
 
std::string GetId ()
 Returns the index. More...
 
std::string GetName ()
 Returns the name. More...
 
unsigned int GetNumRawTrans ()
 Return the raw transformations count. More...
 
SkeletonNodeGetParent ()
 Returns the parent node. More...
 
NodeTransform GetRawTransform (unsigned int _i)
 Find a raw transformation. More...
 
std::vector< NodeTransformGetRawTransforms ()
 Retrieve the raw transformations. More...
 
std::vector< NodeTransformGetTransforms ()
 Returns a copy of the array of transformations. More...
 
ignition::math::Matrix4d InverseBindTransform ()
 Retrieve the inverse of the bind pose skeletal transform. More...
 
bool IsJoint ()
 Is a joint query. More...
 
bool IsRootNode ()
 Queries wether a node has no parent parent. More...
 
ignition::math::Matrix4d ModelTransform () const
 Retrieve the model transform. More...
 
void Reset (bool _resetChildren)
 Reset the transformation to the initial transformation. More...
 
void SetHandle (unsigned int _h)
 Assign a handle number. More...
 
void SetId (std::string _id)
 Change the id string. More...
 
void SetInitialTransform (const ignition::math::Matrix4d &_tras)
 Sets the initial transformation. More...
 
void SetInverseBindTransform (const ignition::math::Matrix4d &_invBM)
 Assign the inverse of the bind pose skeletal transform. More...
 
void SetModelTransform (const ignition::math::Matrix4d &_trans, bool _updateChildren=true)
 Set the model transformation. More...
 
void SetName (std::string _name)
 Change the name. More...
 
void SetParent (SkeletonNode *_parent)
 Set the parent node. More...
 
void SetTransform (const ignition::math::Matrix4d &_trans, bool _updateChildren=true)
 Set a transformation. More...
 
void SetType (SkeletonNodeType _type)
 Change the skeleton node type. More...
 
ignition::math::Matrix4d Transform ()
 Get transform relative to parent. More...
 
void UpdateChildrenTransforms ()
 Apply model transformations in order for each node in the tree. More...
 

Protected Attributes

std::vector< SkeletonNode * > children
 the children nodes More...
 
unsigned int handle
 handle index number More...
 
std::string id
 a string identifier More...
 
ignition::math::Matrix4d initialTransform
 the initial transformation More...
 
ignition::math::Matrix4d invBindTransform
 the inverse of the bind pose skeletal transform More...
 
ignition::math::Matrix4d modelTransform
 the model transformation More...
 
std::string name
 the name of the skeletal node More...
 
SkeletonNodeparent
 the parent node More...
 
std::vector< NodeTransformrawTransforms
 the raw transformation More...
 
ignition::math::Matrix4d transform
 the transform More...
 
SkeletonNodeType type
 the type fo node More...
 

Detailed Description

A skeleton node.

Member Enumeration Documentation

◆ SkeletonNodeType

enumeration of node types

Enumerator
NODE 
JOINT 

Constructor & Destructor Documentation

◆ SkeletonNode() [1/2]

SkeletonNode ( SkeletonNode _parent)
explicit

Constructor.

Parameters
[in]_parentThe parent node

◆ SkeletonNode() [2/2]

SkeletonNode ( SkeletonNode _parent,
std::string  _name,
std::string  _id,
SkeletonNodeType  _type = JOINT 
)

Constructor.

Parameters
[in]_parentthe parent node
[in]_namename of node
[in]_idId of node
[in]_typeThe type of this node

◆ ~SkeletonNode()

virtual ~SkeletonNode ( )
virtual

Destructor.

Member Function Documentation

◆ AddChild()

void AddChild ( SkeletonNode _child)

Add a new child.

Parameters
[in]_childa child

◆ AddRawTransform()

void AddRawTransform ( NodeTransform  _t)

Add a raw transform.

Parameters
[in]_tthe transform

◆ GetChild()

SkeletonNode* GetChild ( unsigned int  _index)

Find a child by index.

Parameters
[in]_indexthe index
Returns
the child skeleton. NO BOUNDS CHECKING

◆ GetChildById()

SkeletonNode* GetChildById ( std::string  _id)

Get child by string id.

Parameters
[in]_idthe string id
Returns
the child skeleton or nullptr if not found

◆ GetChildByName()

SkeletonNode* GetChildByName ( std::string  _name)

Get child by name.

Parameters
[in]_namethe name of the child skeleton
Returns
the skeleton, or nullptr if not found

◆ GetChildCount()

unsigned int GetChildCount ( )

Returns the children count.

Returns
the count

◆ GetHandle()

unsigned int GetHandle ( )

Get the handle index.

Returns
the handle index

◆ GetId()

std::string GetId ( )

Returns the index.

Returns
the id string

◆ GetName()

std::string GetName ( )

Returns the name.

Returns
the name

◆ GetNumRawTrans()

unsigned int GetNumRawTrans ( )

Return the raw transformations count.

Returns
the count

◆ GetParent()

SkeletonNode* GetParent ( )

Returns the parent node.

Returns
the parent

◆ GetRawTransform()

NodeTransform GetRawTransform ( unsigned int  _i)

Find a raw transformation.

Parameters
[in]_ithe index of the transformation
Returns
the node transform. NO BOUNDS CHECKING PERFORMED

◆ GetRawTransforms()

std::vector<NodeTransform> GetRawTransforms ( )

Retrieve the raw transformations.

Returns
an array of transformations

◆ GetTransforms()

std::vector<NodeTransform> GetTransforms ( )

Returns a copy of the array of transformations.

Returns
the array of transform (These are the same as the raw trans)

◆ InverseBindTransform()

ignition::math::Matrix4d InverseBindTransform ( )

Retrieve the inverse of the bind pose skeletal transform.

Returns
the transform

◆ IsJoint()

bool IsJoint ( )

Is a joint query.

Returns
true if the skeleton type is a joint, false otherwise

◆ IsRootNode()

bool IsRootNode ( )

Queries wether a node has no parent parent.

Returns
true if the node has no parent, fasle otherwise

◆ ModelTransform()

ignition::math::Matrix4d ModelTransform ( ) const

Retrieve the model transform.

Returns
the transform

◆ Reset()

void Reset ( bool  _resetChildren)

Reset the transformation to the initial transformation.

Parameters
[in]_resetChildrenwhen true, performs the operation for every node in the tree

◆ SetHandle()

void SetHandle ( unsigned int  _h)

Assign a handle number.

Parameters
[in]_hthe handle

◆ SetId()

void SetId ( std::string  _id)

Change the id string.

Parameters
[in]_idthe new id string

◆ SetInitialTransform()

void SetInitialTransform ( const ignition::math::Matrix4d &  _tras)

Sets the initial transformation.

Parameters
[in]_trasthe transfromation matrix

◆ SetInverseBindTransform()

void SetInverseBindTransform ( const ignition::math::Matrix4d &  _invBM)

Assign the inverse of the bind pose skeletal transform.

Parameters
[in]_invBMthe transform

◆ SetModelTransform()

void SetModelTransform ( const ignition::math::Matrix4d &  _trans,
bool  _updateChildren = true 
)

Set the model transformation.

Parameters
[in]_transthe transformation
[in]_updateChildrenwhen true the UpdateChildrenTransforms operation is performed

◆ SetName()

void SetName ( std::string  _name)

Change the name.

Parameters
[in]_namethe new name

◆ SetParent()

void SetParent ( SkeletonNode _parent)

Set the parent node.

Parameters
[in]_parentthe new parent

◆ SetTransform()

void SetTransform ( const ignition::math::Matrix4d &  _trans,
bool  _updateChildren = true 
)

Set a transformation.

Parameters
[in]_transthe transformation
[in]_updateChildrenwhen true the UpdateChildrenTransforms operation is performed

◆ SetType()

void SetType ( SkeletonNodeType  _type)

Change the skeleton node type.

Parameters
[in]_typethe new type

◆ Transform()

ignition::math::Matrix4d Transform ( )

Get transform relative to parent.

Returns
Transform relative to parent

◆ UpdateChildrenTransforms()

void UpdateChildrenTransforms ( )

Apply model transformations in order for each node in the tree.

Member Data Documentation

◆ children

std::vector<SkeletonNode*> children
protected

the children nodes

◆ handle

unsigned int handle
protected

handle index number

◆ id

std::string id
protected

a string identifier

◆ initialTransform

ignition::math::Matrix4d initialTransform
protected

the initial transformation

◆ invBindTransform

ignition::math::Matrix4d invBindTransform
protected

the inverse of the bind pose skeletal transform

◆ modelTransform

ignition::math::Matrix4d modelTransform
protected

the model transformation

◆ name

std::string name
protected

the name of the skeletal node

◆ parent

SkeletonNode* parent
protected

the parent node

◆ rawTransforms

std::vector<NodeTransform> rawTransforms
protected

the raw transformation

◆ transform

ignition::math::Matrix4d transform
protected

the transform

◆ type

SkeletonNodeType type
protected

the type fo node


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