Ignition Common

API Reference

3.5.0
SkeletonNode Class Reference

A skeleton node. More...

#include <ignition/common/SkeletonNode.hh>

Public Types

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

Public Member Functions

 SkeletonNode (SkeletonNode *_parent)
 Constructor. More...
 
 SkeletonNode (SkeletonNode *_parent, const std::string &_name, const std::string &_id, const SkeletonNodeType _type=JOINT)
 Constructor. More...
 
virtual ~SkeletonNode ()
 Destructor. More...
 
void AddChild (SkeletonNode *_child)
 Add a new child. More...
 
void AddRawTransform (const NodeTransform &_t)
 Add a raw transform. More...
 
SkeletonNodeChild (const unsigned int _index) const
 Find a child by index. More...
 
SkeletonNodeChildById (const std::string &_id) const
 Get child by string id. More...
 
SkeletonNodeChildByName (const std::string &_name) const
 Get child by name. More...
 
unsigned int ChildCount () const
 Returns the children count. More...
 
void Handle (const unsigned int _h)
 Assign a handle number. More...
 
unsigned int Handle () const
 Get the handle index. More...
 
bool HasInvBindTransform () const
 Returns true if the node has inv bind transform. to keep ABI compatibility, it checks if the inv bind transform is the default value of zero. More...
 
void Id (const std::string &_id)
 Change the id string. More...
 
std::string Id () const
 Returns the index. More...
 
math::Matrix4d InverseBindTransform () const
 Retrieve the inverse of the bind pose skeletal transform. More...
 
bool IsJoint () const
 Is a joint query. More...
 
bool IsRootNode () const
 Queries wether a node has no parent parent. More...
 
math::Matrix4d ModelTransform () const
 Retrieve the model transform. More...
 
void Name (const std::string &_name)
 Change the name. More...
 
std::string Name () const
 Returns the name. More...
 
SkeletonNodeParent () const
 Returns the parent node. More...
 
NodeTransform RawTransform (const unsigned int _i) const
 Find a raw transformation. More...
 
unsigned int RawTransformCount () const
 Return the raw transformations count. More...
 
std::vector< NodeTransformRawTransforms () const
 Retrieve the raw transformations. More...
 
void Reset (const bool _resetChildren)
 Reset the transformation to the initial transformation. More...
 
void SetInitialTransform (const math::Matrix4d &_trans)
 Sets the initial transformation. More...
 
void SetInverseBindTransform (const math::Matrix4d &_invBM)
 Assign the inverse of the bind pose skeletal transform. More...
 
void SetModelTransform (const math::Matrix4d &_trans, const bool _updateChildren=true)
 Set the model transformation. More...
 
void SetParent (SkeletonNode *_parent)
 Set the parent node. More...
 
void SetTransform (const math::Matrix4d &_trans, const bool _updateChildren=true)
 Set a transformation. More...
 
void SetType (const SkeletonNodeType _type)
 Change the skeleton node type. More...
 
math::Matrix4d Transform () const
 Get transform relative to parent. More...
 
std::vector< NodeTransformTransforms () const
 Returns a copy of the array of transformations. More...
 
void UpdateChildrenTransforms ()
 Apply model transformations in order for each node in the tree. 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,
const std::string _name,
const std::string _id,
const 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 ( const NodeTransform _t)

Add a raw transform.

Parameters
[in]_tthe transform

◆ Child()

SkeletonNode* Child ( const unsigned int  _index) const

Find a child by index.

Parameters
[in]_indexthe index
Returns
the child skeleton.

◆ ChildById()

SkeletonNode* ChildById ( const std::string _id) const

Get child by string id.

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

◆ ChildByName()

SkeletonNode* ChildByName ( const std::string _name) const

Get child by name.

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

◆ ChildCount()

unsigned int ChildCount ( ) const

Returns the children count.

Returns
the count

◆ Handle() [1/2]

void Handle ( const unsigned int  _h)

Assign a handle number.

Parameters
[in]_hthe handle

◆ Handle() [2/2]

unsigned int Handle ( ) const

Get the handle index.

Returns
the handle index

◆ HasInvBindTransform()

bool HasInvBindTransform ( ) const

Returns true if the node has inv bind transform. to keep ABI compatibility, it checks if the inv bind transform is the default value of zero.

Returns
true if the node has inv bind transform

◆ Id() [1/2]

void Id ( const std::string _id)

Change the id string.

Parameters
[in]_idthe new id string

◆ Id() [2/2]

std::string Id ( ) const

Returns the index.

Returns
the id string

◆ InverseBindTransform()

math::Matrix4d InverseBindTransform ( ) const

Retrieve the inverse of the bind pose skeletal transform.

Returns
the transform

◆ IsJoint()

bool IsJoint ( ) const

Is a joint query.

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

◆ IsRootNode()

bool IsRootNode ( ) const

Queries wether a node has no parent parent.

Returns
true if the node has no parent, fasle otherwise

◆ ModelTransform()

math::Matrix4d ModelTransform ( ) const

Retrieve the model transform.

Returns
the transform

◆ Name() [1/2]

void Name ( const std::string _name)

Change the name.

Parameters
[in]_namethe new name

◆ Name() [2/2]

std::string Name ( ) const

Returns the name.

Returns
the name

◆ Parent()

SkeletonNode* Parent ( ) const

Returns the parent node.

Returns
the parent

◆ RawTransform()

NodeTransform RawTransform ( const unsigned int  _i) const

Find a raw transformation.

Parameters
[in]_ithe index of the transformation
Returns
the node transform.

◆ RawTransformCount()

unsigned int RawTransformCount ( ) const

Return the raw transformations count.

Returns
the count

◆ RawTransforms()

std::vector<NodeTransform> RawTransforms ( ) const

Retrieve the raw transformations.

Returns
an array of transformations

◆ Reset()

void Reset ( const bool  _resetChildren)

Reset the transformation to the initial transformation.

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

◆ SetInitialTransform()

void SetInitialTransform ( const math::Matrix4d _trans)

Sets the initial transformation.

Parameters
[in]_transthe transfromation matrix

◆ SetInverseBindTransform()

void SetInverseBindTransform ( const math::Matrix4d _invBM)

Assign the inverse of the bind pose skeletal transform.

Parameters
[in]_invBMthe transform

◆ SetModelTransform()

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

Set the model transformation.

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

◆ SetParent()

void SetParent ( SkeletonNode _parent)

Set the parent node.

Parameters
[in]_parentthe new parent

◆ SetTransform()

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

Set a transformation.

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

◆ SetType()

void SetType ( const SkeletonNodeType  _type)

Change the skeleton node type.

Parameters
[in]_typethe new type

◆ Transform()

math::Matrix4d Transform ( ) const

Get transform relative to parent.

◆ Transforms()

std::vector<NodeTransform> Transforms ( ) const

Returns a copy of the array of transformations.

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

◆ UpdateChildrenTransforms()

void UpdateChildrenTransforms ( )

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


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