Gazebo Common

API Reference

6.0.1
SkeletonNode Class Reference

A skeleton node. More...

#include <gz/common/SkeletonNode.hh>

Public Types

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

Public Member Functions

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

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]

unsigned int Handle ( ) const

Get the handle index.

Returns
the handle index

◆ Handle() [2/2]

void Handle ( const unsigned int  _h)

Assign a handle number.

Parameters
[in]_hthe handle

◆ HasInvBindTransform()

bool HasInvBindTransform ( ) const

Returns true if the node has inv bind transform. \detail 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]

std::string Id ( ) const

Returns the index.

Returns
the id string

◆ Id() [2/2]

void Id ( const std::string _id)

Change the id string.

Parameters
[in]_idthe new 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]

std::string Name ( ) const

Returns the name.

Returns
the name

◆ Name() [2/2]

void Name ( const std::string _name)

Change the name.

Parameters
[in]_namethe new 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: