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. 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... | |
SkeletonNode * | Child (const unsigned int _index) const |
Find a child by index. More... | |
SkeletonNode * | ChildById (const std::string &_id) const |
Get child by string id. More... | |
SkeletonNode * | ChildByName (const std::string &_name) const |
Get child by name. More... | |
unsigned int | ChildCount () const |
Returns the children count. More... | |
unsigned int | Handle () const |
Get the handle index. More... | |
void | Handle (const unsigned int _h) |
Assign a handle number. More... | |
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. More... | |
std::string | Id () const |
Returns the index. More... | |
void | Id (const std::string &_id) |
Change the id string. 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... | |
std::string | Name () const |
Returns the name. More... | |
void | Name (const std::string &_name) |
Change the name. More... | |
SkeletonNode * | Parent () 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< NodeTransform > | RawTransforms () 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< NodeTransform > | Transforms () 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
enum SkeletonNodeType |
Constructor & Destructor Documentation
◆ SkeletonNode() [1/2]
|
explicit |
Constructor.
- Parameters
-
[in] _parent The parent node
◆ SkeletonNode() [2/2]
SkeletonNode | ( | SkeletonNode * | _parent, |
const std::string & | _name, | ||
const std::string & | _id, | ||
const SkeletonNodeType | _type = JOINT |
||
) |
Constructor.
- Parameters
-
[in] _parent the parent node [in] _name name of node [in] _id Id of node [in] _type The type of this node
◆ ~SkeletonNode()
|
virtual |
Destructor.
Member Function Documentation
◆ AddChild()
void AddChild | ( | SkeletonNode * | _child | ) |
Add a new child.
- Parameters
-
[in] _child a child
◆ AddRawTransform()
void AddRawTransform | ( | const NodeTransform & | _t | ) |
Add a raw transform.
- Parameters
-
[in] _t the transform
◆ Child()
SkeletonNode* Child | ( | const unsigned int | _index | ) | const |
Find a child by index.
- Parameters
-
[in] _index the index
- Returns
- the child skeleton.
◆ ChildById()
SkeletonNode* ChildById | ( | const std::string & | _id | ) | const |
Get child by string id.
- Parameters
-
[in] _id the 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] _name the 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] _h the 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] _id the 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] _name the 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] _i the 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] _resetChildren when true, performs the operation for every node in the tree
◆ SetInitialTransform()
void SetInitialTransform | ( | const math::Matrix4d & | _trans | ) |
Sets the initial transformation.
- Parameters
-
[in] _trans the transfromation matrix
◆ SetInverseBindTransform()
void SetInverseBindTransform | ( | const math::Matrix4d & | _invBM | ) |
Assign the inverse of the bind pose skeletal transform.
- Parameters
-
[in] _invBM the transform
◆ SetModelTransform()
void SetModelTransform | ( | const math::Matrix4d & | _trans, |
const bool | _updateChildren = true |
||
) |
Set the model transformation.
- Parameters
-
[in] _trans the transformation [in] _updateChildren when true the UpdateChildrenTransforms operation is performed
◆ SetParent()
void SetParent | ( | SkeletonNode * | _parent | ) |
Set the parent node.
- Parameters
-
[in] _parent the new parent
◆ SetTransform()
void SetTransform | ( | const math::Matrix4d & | _trans, |
const bool | _updateChildren = true |
||
) |
Set a transformation.
- Parameters
-
[in] _trans the transformation [in] _updateChildren when true the UpdateChildrenTransforms operation is performed
◆ SetType()
void SetType | ( | const SkeletonNodeType | _type | ) |
Change the skeleton node type.
- Parameters
-
[in] _type the 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: