All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Attributes | List of all members
gazebo::common::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.
 
 SkeletonNode (SkeletonNode *_parent, std::string _name, std::string _id, SkeletonNodeType _type=JOINT)
 Constructor.
 
virtual ~SkeletonNode ()
 Destructor.
 
void AddChild (SkeletonNode *_child)
 Add a new child.
 
void AddRawTransform (NodeTransform _t)
 Add a raw transform.
 
SkeletonNodeGetChild (unsigned int _index)
 Find a child by index.
 
SkeletonNodeGetChildById (std::string _id)
 Get child by string id.
 
SkeletonNodeGetChildByName (std::string _name)
 Get child by name.
 
unsigned int GetChildCount ()
 Returns the children count.
 
unsigned int GetHandle ()
 Get the handle index.
 
std::string GetId ()
 Returns the index.
 
math::Matrix4 GetInverseBindTransform ()
 Retrieve the inverse of the bind pose skeletal transform.
 
math::Matrix4 GetModelTransform ()
 Retrieve the model transform.
 
std::string GetName ()
 Returns the name.
 
unsigned int GetNumRawTrans ()
 Return the raw transformations count.
 
SkeletonNodeGetParent ()
 Returns the parent node.
 
NodeTransform GetRawTransform (unsigned int _i)
 Find a raw transformation.
 
std::vector< NodeTransformGetRawTransforms ()
 Retrieve the raw transformations.
 
math::Matrix4 GetTransform ()
 Get transform relative to parent.
 
std::vector< NodeTransformGetTransforms ()
 Returns a copy of the array of transformations.
 
bool IsJoint ()
 Is a joint query.
 
bool IsRootNode ()
 Queries wether a node has no parent parent.
 
void Reset (bool _resetChildren)
 Reset the transformation to the initial transformation.
 
void SetHandle (unsigned int _h)
 Assign a handle number.
 
void SetId (std::string _id)
 Change the id string.
 
void SetInitialTransform (math::Matrix4 _tras)
 Sets the initial transformation.
 
void SetInverseBindTransform (math::Matrix4 _invBM)
 Assign the inverse of the bind pose skeletal transform.
 
void SetModelTransform (math::Matrix4 _trans, bool _updateChildren=true)
 Set the model transformation.
 
void SetName (std::string _name)
 Change the name.
 
void SetParent (SkeletonNode *_parent)
 Set the parent node.
 
void SetTransform (math::Matrix4 _trans, bool _updateChildren=true)
 Set a transformation.
 
void SetType (SkeletonNodeType _type)
 Change the skeleton node type.
 
void UpdateChildrenTransforms ()
 Apply model transformations in order for each node in the tree.
 

Protected Attributes

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

Detailed Description

A skeleton node.

Member Enumeration Documentation

enumeration of node types

Enumerator:
NODE 
JOINT 

Constructor & Destructor Documentation

gazebo::common::SkeletonNode::SkeletonNode ( SkeletonNode _parent)

Constructor.

Parameters
[in]_parentThe parent node
gazebo::common::SkeletonNode::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
virtual gazebo::common::SkeletonNode::~SkeletonNode ( )
virtual

Destructor.

Member Function Documentation

void gazebo::common::SkeletonNode::AddChild ( SkeletonNode _child)

Add a new child.

Parameters
[in]_childa child
void gazebo::common::SkeletonNode::AddRawTransform ( NodeTransform  _t)

Add a raw transform.

Parameters
[in]_tthe transform
SkeletonNode* gazebo::common::SkeletonNode::GetChild ( unsigned int  _index)

Find a child by index.

Parameters
[in]_indexthe index
Returns
the child skeleton. NO BOUNDS CHECKING
SkeletonNode* gazebo::common::SkeletonNode::GetChildById ( std::string  _id)

Get child by string id.

Parameters
[in]_idthe string id
Returns
the child skeleton or NULL if not found
SkeletonNode* gazebo::common::SkeletonNode::GetChildByName ( std::string  _name)

Get child by name.

Parameters
[in]_namethe name of the child skeleton
Returns
the skeleton, or NULL if not found
unsigned int gazebo::common::SkeletonNode::GetChildCount ( )

Returns the children count.

Returns
the count
unsigned int gazebo::common::SkeletonNode::GetHandle ( )

Get the handle index.

Returns
the handle index
std::string gazebo::common::SkeletonNode::GetId ( )

Returns the index.

Returns
the id string
math::Matrix4 gazebo::common::SkeletonNode::GetInverseBindTransform ( )

Retrieve the inverse of the bind pose skeletal transform.

Returns
the transform
math::Matrix4 gazebo::common::SkeletonNode::GetModelTransform ( )

Retrieve the model transform.

Returns
the transform
std::string gazebo::common::SkeletonNode::GetName ( )

Returns the name.

Returns
the name
unsigned int gazebo::common::SkeletonNode::GetNumRawTrans ( )

Return the raw transformations count.

Returns
the count
SkeletonNode* gazebo::common::SkeletonNode::GetParent ( )

Returns the parent node.

Returns
the parent
NodeTransform gazebo::common::SkeletonNode::GetRawTransform ( unsigned int  _i)

Find a raw transformation.

Parameters
[in]_ithe index of the transformation
Returns
the node transform. NO BOUNDS CHECKING PERFORMED
std::vector<NodeTransform> gazebo::common::SkeletonNode::GetRawTransforms ( )

Retrieve the raw transformations.

Returns
an array of transformations
math::Matrix4 gazebo::common::SkeletonNode::GetTransform ( )

Get transform relative to parent.

std::vector<NodeTransform> gazebo::common::SkeletonNode::GetTransforms ( )

Returns a copy of the array of transformations.

Returns
the array of transform (These are the same as the raw trans)
bool gazebo::common::SkeletonNode::IsJoint ( )

Is a joint query.

Returns
true if the skeleton type is a joint, false otherwise
bool gazebo::common::SkeletonNode::IsRootNode ( )

Queries wether a node has no parent parent.

Returns
true if the node has no parent, fasle otherwise
void gazebo::common::SkeletonNode::Reset ( bool  _resetChildren)

Reset the transformation to the initial transformation.

Parameters
[in]_resetChildrenwhen true, performs the operation for every node in the tree
void gazebo::common::SkeletonNode::SetHandle ( unsigned int  _h)

Assign a handle number.

Parameters
[in]_hthe handle
void gazebo::common::SkeletonNode::SetId ( std::string  _id)

Change the id string.

Parameters
[in]_idthe new id string
void gazebo::common::SkeletonNode::SetInitialTransform ( math::Matrix4  _tras)

Sets the initial transformation.

Parameters
[in]_trasthe transfromation matrix
void gazebo::common::SkeletonNode::SetInverseBindTransform ( math::Matrix4  _invBM)

Assign the inverse of the bind pose skeletal transform.

Parameters
[in]_invBMthe transform
void gazebo::common::SkeletonNode::SetModelTransform ( math::Matrix4  _trans,
bool  _updateChildren = true 
)

Set the model transformation.

Parameters
[in]_transthe transformation
[in]_updateChildrenwhen true the UpdateChildrenTransforms operation is performed
void gazebo::common::SkeletonNode::SetName ( std::string  _name)

Change the name.

Parameters
[in]_namethe new name
void gazebo::common::SkeletonNode::SetParent ( SkeletonNode _parent)

Set the parent node.

Parameters
[in]_parentthe new parent
void gazebo::common::SkeletonNode::SetTransform ( math::Matrix4  _trans,
bool  _updateChildren = true 
)

Set a transformation.

Parameters
[in]_transthe transformation
[in]_updateChildrenwhen true the UpdateChildrenTransforms operation is performed
void gazebo::common::SkeletonNode::SetType ( SkeletonNodeType  _type)

Change the skeleton node type.

Parameters
[in]_typethe new type
void gazebo::common::SkeletonNode::UpdateChildrenTransforms ( )

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

Member Data Documentation

std::vector<SkeletonNode*> gazebo::common::SkeletonNode::children
protected

the children nodes

unsigned int gazebo::common::SkeletonNode::handle
protected

handle index number

std::string gazebo::common::SkeletonNode::id
protected

a string identifier

math::Matrix4 gazebo::common::SkeletonNode::initialTransform
protected

the initial transformation

math::Matrix4 gazebo::common::SkeletonNode::invBindTransform
protected

the inverse of the bind pose skeletal transform

math::Matrix4 gazebo::common::SkeletonNode::modelTransform
protected

the model transformation

std::string gazebo::common::SkeletonNode::name
protected

the name of the skeletal node

SkeletonNode* gazebo::common::SkeletonNode::parent
protected

the parent node

std::vector<NodeTransform> gazebo::common::SkeletonNode::rawTransforms
protected

the raw transformation

math::Matrix4 gazebo::common::SkeletonNode::transform
protected

the transform

SkeletonNodeType gazebo::common::SkeletonNode::type
protected

the type fo node


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