Gazebo Rendering

API Reference

7.4.2

#include <BaseNode.hh>

Public Member Functions

virtual ~BaseNode ()
 
virtual void AddChild (NodePtr _child) override
 Add the given node to this node. If the given node is already a child, no work will be done. More...
 
virtual NodePtr ChildById (unsigned int _id) const override
 Get node with given ID. If no child exists with given ID, NULL will be returned. More...
 
virtual NodePtr ChildByIndex (unsigned int _index) const override
 Get node at given index. If no child exists at given index, NULL will be returned. More...
 
virtual NodePtr ChildByName (const std::string &_name) const override
 Get node with given name. If no child exists with given name, NULL will be returned. More...
 
virtual unsigned int ChildCount () const override
 Get number of child nodes. More...
 
virtual void Destroy () override
 Destroy any resources associated with this object. Invoking any other functions after destroying an object will result in undefined behavior. More...
 
virtual bool HasChild (ConstNodePtr _child) const override
 Determine if given node is an attached child. More...
 
virtual bool HasChildId (unsigned int _id) const override
 Determine if node with given ID is an attached child. More...
 
virtual bool HasChildName (const std::string &_name) const override
 Determine if node with given name is an attached child. More...
 
virtual bool HasUserData (const std::string &_key) const override
 Check if node has custom data. More...
 
virtual bool InheritScale () const override=0
 Determine if this node inherits scale from this parent. More...
 
virtual math::Pose3d InitialLocalPose () const override
 Get the initial local pose. More...
 
virtual math::Pose3d LocalPose () const override
 Get the local pose. More...
 
virtual math::Vector3d LocalPosition () const override
 Get the local position. More...
 
virtual math::Quaterniond LocalRotation () const override
 Get the local rotation. More...
 
virtual math::Vector3d LocalScale () const override=0
 Get the local scale. More...
 
virtual math::Vector3d Origin () const override
 Get position of origin. More...
 
virtual NodePtr Parent () const override=0
 Get the parent Node. More...
 
virtual void PreRender () override
 Prepare this object and any of its children for rendering. This should be called for each object in a scene just before rendering, which can be achieved by a single call to Scene::PreRender. More...
 
virtual NodePtr RemoveChild (NodePtr _child) override
 Remove (detach) the given node from this node. If the given node is not a child of this node, no work will be done. More...
 
virtual NodePtr RemoveChildById (unsigned int _id) override
 Remove (detach) the node with the given ID from this node. If the specified node is not a child of this node, no work will be done. More...
 
virtual NodePtr RemoveChildByIndex (unsigned int _index) override
 Remove (detach) the node at the given index from this node. If the specified node is not a child of this node, no work will be done. More...
 
virtual NodePtr RemoveChildByName (const std::string &_name) override
 Remove (detach) the node with the given name from this node. If the specified node is not a child of this node, no work will be done. More...
 
virtual void RemoveChildren () override
 Remove all child nodes from this node This detaches all the child nodes but does not destroy them. More...
 
virtual void RemoveParent () override
 Detach this Node from its parent. If this Node does not have a parent, no work will be done. More...
 
virtual void Scale (const math::Vector3d &_scale) override
 Scale the current scale by the given scalars. More...
 
virtual void Scale (double _scale) override
 Scale the current scale by the given scalar. The given scalar will be assigned to the x, y, and z coordinates. More...
 
virtual void Scale (double _x, double _y, double _z) override
 Scale the current scale by the given scalars. More...
 
virtual void SetLocalPose (const math::Pose3d &_pose) override
 Set the local pose. More...
 
virtual void SetLocalPosition (const math::Vector3d &_position) override
 Set the local position. More...
 
virtual void SetLocalPosition (double _x, double _y, double _z) override
 Set the local position. More...
 
virtual void SetLocalRotation (const math::Quaterniond &_rotation) override
 Set the local rotation. More...
 
virtual void SetLocalRotation (double _r, double _p, double _y) override
 Set the local rotation. More...
 
virtual void SetLocalRotation (double _w, double _x, double _y, double _z) override
 Set the local rotation. More...
 
virtual void SetLocalScale (const math::Vector3d &_scale) override
 Set the local scale. More...
 
virtual void SetLocalScale (double _scale) override
 Set the local scale. The given scale will be assigned to the x, y, and z coordinates. More...
 
virtual void SetLocalScale (double _x, double _y, double _z) override
 Set the local scale. More...
 
virtual void SetOrigin (const math::Vector3d &_origin) override
 Set position of origin. The position should be relative to the original origin of the geometry. More...
 
virtual void SetOrigin (double _x, double _y, double _z) override
 Set position of origin. The position should be relative to the original origin of the geometry. More...
 
virtual void SetUserData (const std::string &_key, Variant _value) override
 Store any custom data associated with this node. More...
 
virtual void SetWorldPose (const math::Pose3d &_pose) override
 Set the world pose. More...
 
virtual void SetWorldPosition (const math::Vector3d &_position) override
 Set the world position. More...
 
virtual void SetWorldPosition (double _x, double _y, double _z) override
 Set the world position. More...
 
virtual void SetWorldRotation (const math::Quaterniond &_rotation) override
 Set the world rotation. More...
 
virtual void SetWorldRotation (double _r, double _p, double _y) override
 Set the world rotation. More...
 
virtual void SetWorldRotation (double _w, double _x, double _y, double _z) override
 Set the world rotation. More...
 
virtual void SetWorldScale (const math::Vector3d &_scale) override
 Set the world scale. More...
 
virtual void SetWorldScale (double _scale) override
 Set the world scale. The given scale will be assigned to the x, y, and z coordinates. More...
 
virtual void SetWorldScale (double _x, double _y, double _z) override
 Set the world scale. More...
 
virtual Variant UserData (const std::string &_key) const override
 Get custom data stored in this node. More...
 
virtual math::Pose3d WorldPose () const override
 Get the world pose. More...
 
virtual math::Vector3d WorldPosition () const override
 Get the world position. More...
 
virtual math::Quaterniond WorldRotation () const override
 Get the world rotation. More...
 
virtual math::Vector3d WorldScale () const override
 Get the world scale. More...
 
virtual math::Pose3d WorldToLocal (const math::Pose3d &_pose) const override
 Convert given world pose to local pose. More...
 
- Public Member Functions inherited from Node
virtual ~Node ()
 Destructor. More...
 
virtual bool HasParent () const =0
 Determine if this Node is attached to another Node. More...
 
virtual void SetInheritScale (bool _inherit)=0
 Specify if this node inherits scale from its parent. More...
 
- Public Member Functions inherited from Object
virtual ~Object ()
 Destructor. More...
 
virtual unsigned int Id () const =0
 Get the object ID. This ID will be unique across all objects inside a given scene, but necessarily true for objects across different scenes. More...
 
virtual std::string Name () const =0
 Get the object name. This name will be unique across all objects inside a given scene, but necessarily true for objects across different scenes. More...
 
virtual void PostRender ()=0
 Post process this object and any of its children after rendering. More...
 
virtual ScenePtr Scene () const =0
 Get the Scene that created this object. More...
 

Protected Member Functions

 BaseNode ()
 
virtual bool AttachChild (NodePtr _child)=0
 
virtual NodeStorePtr Children () const =0
 
virtual bool DetachChild (NodePtr _child)=0
 
virtual void PreRenderChildren ()
 
virtual math::Pose3d RawLocalPose () const =0
 
virtual void SetLocalScaleImpl (const math::Vector3d &_scale)=0
 Implementation of the SetLocalScale function. More...
 
virtual void SetRawLocalPose (const math::Pose3d &_pose)=0
 

Protected Attributes

gz::math::Pose3d initialLocalPose
 Initial local pose for this node. More...
 
bool initialLocalPoseSet = false
 Flag to indicate whether initial local pose is set for this node. More...
 
math::Vector3d origin
 
std::map< std::string, VariantuserData
 A map of custom key value data. More...
 

Constructor & Destructor Documentation

◆ BaseNode()

BaseNode
protected

◆ ~BaseNode()

~BaseNode
virtual

Member Function Documentation

◆ AddChild()

void AddChild ( NodePtr  _child)
overridevirtual

Add the given node to this node. If the given node is already a child, no work will be done.

Parameters
[in]_childChild node to be added

Implements Node.

◆ AttachChild()

virtual bool AttachChild ( NodePtr  _child)
protectedpure virtual

Implemented in Ogre2Node, and OgreNode.

◆ ChildById()

NodePtr ChildById ( unsigned int  _id) const
overridevirtual

Get node with given ID. If no child exists with given ID, NULL will be returned.

Parameters
[in]_idID of the desired node
Returns
The specified node

Implements Node.

◆ ChildByIndex()

NodePtr ChildByIndex ( unsigned int  _index) const
overridevirtual

Get node at given index. If no child exists at given index, NULL will be returned.

Parameters
[in]_indexIndex of the desired node
Returns
The specified node

Implements Node.

◆ ChildByName()

NodePtr ChildByName ( const std::string _name) const
overridevirtual

Get node with given name. If no child exists with given name, NULL will be returned.

Parameters
[in]_nameName of the desired node
Returns
The specified node

Implements Node.

◆ ChildCount()

unsigned int ChildCount ( ) const
overridevirtual

Get number of child nodes.

Returns
The number of child nodes

Implements Node.

◆ Children()

virtual NodeStorePtr Children ( ) const
protectedpure virtual

◆ Destroy()

◆ DetachChild()

virtual bool DetachChild ( NodePtr  _child)
protectedpure virtual

Implemented in Ogre2Node, and OgreNode.

◆ HasChild()

bool HasChild ( ConstNodePtr  _child) const
overridevirtual

Determine if given node is an attached child.

Returns
True if given node is an attached child

Implements Node.

◆ HasChildId()

bool HasChildId ( unsigned int  _id) const
overridevirtual

Determine if node with given ID is an attached child.

Parameters
[in]_idID of the node in question
Returns
True if node with given ID is an attached child

Implements Node.

◆ HasChildName()

bool HasChildName ( const std::string _name) const
overridevirtual

Determine if node with given name is an attached child.

Parameters
[in]_nameName of the node in question
Returns
True if node with given name is an attached child

Implements Node.

◆ HasUserData()

bool HasUserData ( const std::string _key) const
overridevirtual

Check if node has custom data.

Parameters
[in]_keyUnique key
Returns
True if node has custom data with the specified key

Implements Node.

◆ InheritScale()

virtual bool InheritScale ( ) const
overridepure virtual

Determine if this node inherits scale from this parent.

Returns
True if this node inherits scale from this parent

Implements Node.

◆ InitialLocalPose()

math::Pose3d InitialLocalPose ( ) const
overridevirtual

Get the initial local pose.

Returns
The initial local pose

Implements Node.

◆ LocalPose()

math::Pose3d LocalPose ( ) const
overridevirtual

Get the local pose.

Returns
The local pose

Implements Node.

Reimplemented in BaseVisual< Ogre2Node >, and BaseVisual< OgreNode >.

◆ LocalPosition()

math::Vector3d LocalPosition ( ) const
overridevirtual

Get the local position.

Returns
The local position

Implements Node.

◆ LocalRotation()

math::Quaterniond LocalRotation ( ) const
overridevirtual

Get the local rotation.

Returns
The local rotation

Implements Node.

◆ LocalScale()

virtual math::Vector3d LocalScale ( ) const
overridepure virtual

Get the local scale.

Returns
The local scale

Implements Node.

Implemented in BaseAxisVisual< OgreVisual >, and BaseAxisVisual< Ogre2Visual >.

◆ Origin()

math::Vector3d Origin ( ) const
overridevirtual

Get position of origin.

Returns
The position of the origin

Implements Node.

◆ Parent()

virtual NodePtr Parent ( ) const
overridepure virtual

Get the parent Node.

Returns
the parent Node

Implements Node.

◆ PreRender()

◆ PreRenderChildren()

void PreRenderChildren
protectedvirtual

◆ RawLocalPose()

virtual math::Pose3d RawLocalPose ( ) const
protectedpure virtual

◆ RemoveChild()

NodePtr RemoveChild ( NodePtr  _child)
overridevirtual

Remove (detach) the given node from this node. If the given node is not a child of this node, no work will be done.

Parameters
[in]_childChild node to be removed
Returns
The removed child node

Implements Node.

◆ RemoveChildById()

NodePtr RemoveChildById ( unsigned int  _id)
overridevirtual

Remove (detach) the node with the given ID from this node. If the specified node is not a child of this node, no work will be done.

Parameters
[in]_idID of the child node to be removed
Returns
The removed child node

Implements Node.

◆ RemoveChildByIndex()

NodePtr RemoveChildByIndex ( unsigned int  _index)
overridevirtual

Remove (detach) the node at the given index from this node. If the specified node is not a child of this node, no work will be done.

Parameters
[in]_indexIndex of the child node to be removed
Returns
The removed child node

Implements Node.

◆ RemoveChildByName()

NodePtr RemoveChildByName ( const std::string _name)
overridevirtual

Remove (detach) the node with the given name from this node. If the specified node is not a child of this node, no work will be done.

Parameters
[in]_nameName of the child node to be removed
Returns
The removed child node

Implements Node.

◆ RemoveChildren()

void RemoveChildren ( )
overridevirtual

Remove all child nodes from this node This detaches all the child nodes but does not destroy them.

Implements Node.

◆ RemoveParent()

void RemoveParent ( )
overridevirtual

Detach this Node from its parent. If this Node does not have a parent, no work will be done.

Implements Node.

◆ Scale() [1/3]

void Scale ( const math::Vector3d _scale)
overridevirtual

Scale the current scale by the given scalars.

Parameters
[in]_scaleScalars to alter the current scale

Implements Node.

◆ Scale() [2/3]

void Scale ( double  _scale)
overridevirtual

Scale the current scale by the given scalar. The given scalar will be assigned to the x, y, and z coordinates.

Parameters
[in]_scaleScalar to alter the current scale

Implements Node.

◆ Scale() [3/3]

void Scale ( double  _x,
double  _y,
double  _z 
)
overridevirtual

Scale the current scale by the given scalars.

Parameters
[in]_xScalar to alter the current x-coordinate scale
[in]_yScalar to alter the current y-coordinate scale
[in]_zScalar to alter the current z-coordinate scale

Implements Node.

◆ SetLocalPose()

void SetLocalPose ( const math::Pose3d _pose)
overridevirtual

Set the local pose.

Parameters
[in]_poseNew local pose

Implements Node.

Reimplemented in BaseVisual< Ogre2Node >, and BaseVisual< OgreNode >.

◆ SetLocalPosition() [1/2]

void SetLocalPosition ( const math::Vector3d _position)
overridevirtual

Set the local position.

Parameters
[in]_positionNew local position

Implements Node.

◆ SetLocalPosition() [2/2]

void SetLocalPosition ( double  _x,
double  _y,
double  _z 
)
overridevirtual

Set the local position.

Parameters
[in]_xX-coordinate
[in]_yY-coordinate
[in]_zZ-coordinate

Implements Node.

◆ SetLocalRotation() [1/3]

void SetLocalRotation ( const math::Quaterniond _rotation)
overridevirtual

Set the local rotation.

Parameters
[in]_rotationNew local rotation

Implements Node.

◆ SetLocalRotation() [2/3]

void SetLocalRotation ( double  _r,
double  _p,
double  _y 
)
overridevirtual

Set the local rotation.

Parameters
[in]_rroll
[in]_ppitch
[in]_yyaw

Implements Node.

◆ SetLocalRotation() [3/3]

void SetLocalRotation ( double  _w,
double  _x,
double  _y,
double  _z 
)
overridevirtual

Set the local rotation.

Parameters
[in]_wW-coordinate
[in]_xX-coordinate
[in]_yY-coordinate
[in]_zZ-coordinate

Implements Node.

◆ SetLocalScale() [1/3]

void SetLocalScale ( const math::Vector3d _scale)
overridevirtual

Set the local scale.

Parameters
[in]_scaleNew local scale

Implements Node.

Reimplemented in BaseAxisVisual< OgreVisual >, and BaseAxisVisual< Ogre2Visual >.

◆ SetLocalScale() [2/3]

void SetLocalScale ( double  _scale)
overridevirtual

Set the local scale. The given scale will be assigned to the x, y, and z coordinates.

Parameters
[in]_scaleNew local scale

Implements Node.

◆ SetLocalScale() [3/3]

void SetLocalScale ( double  _x,
double  _y,
double  _z 
)
overridevirtual

Set the local scale.

Parameters
[in]_xNew x-coordinate scale
[in]_yNew y-coordinate scale
[in]_zNew z-coordinate scale

Implements Node.

◆ SetLocalScaleImpl()

virtual void SetLocalScaleImpl ( const math::Vector3d _scale)
protectedpure virtual

Implementation of the SetLocalScale function.

Parameters
[in]_scaleScale to set the visual to

Implemented in Ogre2Node, and OgreNode.

◆ SetOrigin() [1/2]

void SetOrigin ( const math::Vector3d _origin)
overridevirtual

Set position of origin. The position should be relative to the original origin of the geometry.

Parameters
[in]_originNew origin position

Implements Node.

◆ SetOrigin() [2/2]

void SetOrigin ( double  _x,
double  _y,
double  _z 
)
overridevirtual

Set position of origin. The position should be relative to the original origin of the geometry.

Parameters
[in]_xX-coordinate
[in]_yY-coordinate
[in]_zZ-coordinate

Implements Node.

◆ SetRawLocalPose()

virtual void SetRawLocalPose ( const math::Pose3d _pose)
protectedpure virtual

Implemented in Ogre2Node, and OgreNode.

◆ SetUserData()

void SetUserData ( const std::string _key,
Variant  _value 
)
overridevirtual

Store any custom data associated with this node.

Parameters
[in]_keyUnique key
[in]_valueValue in any type

Implements Node.

◆ SetWorldPose()

void SetWorldPose ( const math::Pose3d _pose)
overridevirtual

Set the world pose.

Parameters
[in]_poseNew world pose

Implements Node.

◆ SetWorldPosition() [1/2]

void SetWorldPosition ( const math::Vector3d _position)
overridevirtual

Set the world position.

Parameters
[in]_positionNew world position

Implements Node.

◆ SetWorldPosition() [2/2]

void SetWorldPosition ( double  _x,
double  _y,
double  _z 
)
overridevirtual

Set the world position.

Parameters
[in]_xX-coordinate
[in]_yY-coordinate
[in]_zZ-coordinate

Implements Node.

◆ SetWorldRotation() [1/3]

void SetWorldRotation ( const math::Quaterniond _rotation)
overridevirtual

Set the world rotation.

Parameters
[in]_rotationNew world rotation

Implements Node.

◆ SetWorldRotation() [2/3]

void SetWorldRotation ( double  _r,
double  _p,
double  _y 
)
overridevirtual

Set the world rotation.

Parameters
[in]_rroll
[in]_ppitch
[in]_yyaw

Implements Node.

◆ SetWorldRotation() [3/3]

void SetWorldRotation ( double  _w,
double  _x,
double  _y,
double  _z 
)
overridevirtual

Set the world rotation.

Parameters
[in]_wW-coordinate
[in]_xX-coordinate
[in]_yY-coordinate
[in]_zZ-coordinate

Implements Node.

◆ SetWorldScale() [1/3]

void SetWorldScale ( const math::Vector3d _scale)
overridevirtual

Set the world scale.

Parameters
[in]_scaleNew world scale

Implements Node.

◆ SetWorldScale() [2/3]

void SetWorldScale ( double  _scale)
overridevirtual

Set the world scale. The given scale will be assigned to the x, y, and z coordinates.

Parameters
[in]_scaleNew world scale

Implements Node.

◆ SetWorldScale() [3/3]

void SetWorldScale ( double  _x,
double  _y,
double  _z 
)
overridevirtual

Set the world scale.

Parameters
[in]_xNew x-coordinate scale
[in]_yNew y-coordinate scale
[in]_zNew z-coordinate scale

Implements Node.

◆ UserData()

Variant UserData ( const std::string _key) const
overridevirtual

Get custom data stored in this node.

Parameters
[in]_keyUnique key
Returns
Value in any type. If _key does not exist for the node, an empty variant is returned (i.e., no data).

Implements Node.

◆ WorldPose()

math::Pose3d WorldPose ( ) const
overridevirtual

Get the world pose.

Returns
The world pose

Implements Node.

◆ WorldPosition()

math::Vector3d WorldPosition ( ) const
overridevirtual

Get the world position.

Returns
The world position

Implements Node.

◆ WorldRotation()

math::Quaterniond WorldRotation ( ) const
overridevirtual

Get the world rotation.

Returns
The world rotation

Implements Node.

◆ WorldScale()

math::Vector3d WorldScale ( ) const
overridevirtual

Get the world scale.

Returns
The world scale

Implements Node.

◆ WorldToLocal()

math::Pose3d WorldToLocal ( const math::Pose3d _pose) const
overridevirtual

Convert given world pose to local pose.

Parameters
[in]_poseWorld pose to be converted

Implements Node.

Member Data Documentation

◆ initialLocalPose

gz::math::Pose3d initialLocalPose
protected
Initial value:

Initial local pose for this node.

◆ initialLocalPoseSet

bool initialLocalPoseSet = false
protected

Flag to indicate whether initial local pose is set for this node.

◆ origin

math::Vector3d origin
protected

◆ userData

std::map<std::string, Variant> userData
protected

A map of custom key value data.


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