RobWorkProject  23.9.11-
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
GroupNode Class Reference

a SceneNode that has a transformation and 0 to many children. More...

#include <GroupNode.hpp>

Inherits SceneNode.

Public Types

typedef rw::core::Ptr< GroupNodePtr
 smart pointer type of this class
 
- Public Types inherited from SceneNode
enum  AddPolicy { Front , Back }
 Policy for adding parent nodes. More...
 
enum  NodeType { GroupType = 0 , CameraType , DrawableType , UserBeginType = 1024 }
 Node types. More...
 
typedef rw::core::Ptr< SceneNodePtr
 Smart pointer type for SceneNode.
 
typedef std::list< SceneNode::PtrNodeList
 Type for the list of nodes.
 
typedef const std::list< SceneNode::PtrNodeListConst
 Type for a const list of nodes.
 

Public Member Functions

 GroupNode (const std::string &name)
 constructor
 
GroupNodeasGroupNode ()
 Get a pointer to a GroupNode, if this is a GroupNode. More...
 
size_t nrOfChildren ()
 get the number of children
 
void addChild (SceneNode::Ptr node, AddPolicy policy=Back)
 add a child to this group node More...
 
bool hasChild (SceneNode::Ptr node)
 test if this group node has the node node as child More...
 
bool hasChild (const std::string &nodename)
 test if this group node has a child node with name nodename More...
 
void removeChild (SceneNode::Ptr node)
 remove node from the children list of this node AND removes this node from the parent list of node. More...
 
void removeChild (const std::string &name)
 remove node with name name from the children list of this node AND removes this node from the parent list of node. More...
 
void setTransform (const rw::math::Transform3D<> &t3d)
 transform is relative to parent node
 
rw::math::Transform3D getTransform ()
 get transform
 
- Public Member Functions inherited from SceneNode
virtual ~SceneNode ()
 Destructor.
 
void addParent (SceneNode::Ptr node, AddPolicy policy=Back)
 Add a parent node. More...
 
bool hasParent (SceneNode::Ptr parent)
 Check if the given node is a parent node. More...
 
void removeParent (SceneNode::Ptr node)
 erases the parent from the parent list. More...
 
virtual SceneCameraasCameraNode ()
 Get a pointer to a CameraNode, if this is a CameraNode. More...
 
virtual DrawableNodeasDrawableNode ()
 Get a pointer to a DrawableNode, if this is a DrawableNode. More...
 
int getType ()
 Get the NodeType. More...
 
const std::string & getName ()
 Get the name of the node. More...
 
void setName (const std::string &name)
 Set the name of this node. More...
 

Static Public Member Functions

static void addChild (SceneNode::Ptr child, GroupNode::Ptr parent, AddPolicy policy=Back)
 add a child to the groupnode parent More...
 
- Static Public Member Functions inherited from SceneNode
static void removeParent (SceneNode::Ptr node, SceneNode::Ptr parent)
 Remove a parent node. More...
 

Public Attributes

rw::math::Transform3D _t3d
 The transform.
 
std::list< SceneNode::Ptr_childNodes
 List of child nodes.
 
- Public Attributes inherited from SceneNode
std::string _name
 The name of the node.
 
std::list< SceneNode::Ptr_parentNodes
 The list of parent nodes.
 
int _type
 The NodeType.
 

Additional Inherited Members

- Protected Member Functions inherited from SceneNode
 SceneNode (const std::string &name, int type)
 Construct new scene node. More...
 

Detailed Description

a SceneNode that has a transformation and 0 to many children.

Member Function Documentation

◆ addChild() [1/2]

static void addChild ( SceneNode::Ptr  child,
GroupNode::Ptr  parent,
AddPolicy  policy = Back 
)
static

add a child to the groupnode parent

Parameters
child[in] the child to add
parent[in] the parent
policy[in] add it to the front or the back

◆ addChild() [2/2]

void addChild ( SceneNode::Ptr  node,
AddPolicy  policy = Back 
)

add a child to this group node

Parameters
node[in] the child to add
policy[in] add it to the front or the back

◆ asGroupNode()

GroupNode* asGroupNode ( )
virtual

Get a pointer to a GroupNode, if this is a GroupNode.

Returns
a pointer, or NULL if the SceneNode is not of correct type.

Reimplemented from SceneNode.

◆ hasChild() [1/2]

bool hasChild ( const std::string &  nodename)

test if this group node has a child node with name nodename

Parameters
nodename[in] name of child node
Returns
true if nodename is child of this, false otherwise

◆ hasChild() [2/2]

bool hasChild ( SceneNode::Ptr  node)

test if this group node has the node node as child

Parameters
node[in] a scene node
Returns
true if node is child of this, false otherwise

◆ removeChild() [1/2]

void removeChild ( const std::string &  name)

remove node with name name from the children list of this node AND removes this node from the parent list of node.

Parameters
name[in] child node that is to be removed

◆ removeChild() [2/2]

void removeChild ( SceneNode::Ptr  node)

remove node from the children list of this node AND removes this node from the parent list of node.

Parameters
node[in] child node that is to be removed

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