AvogadroLibs  1.93.1
Public Member Functions | Protected Attributes | List of all members
GroupNode Class Reference

The GroupNode class provides common API for grouping child nodes. More...

#include <avogadro/rendering/groupnode.h>

Inheritance diagram for GroupNode:
Node TransformNode

Public Member Functions

 GroupNode (GroupNode *parent=0)
 
void accept (Visitor &) override
 
void addChild (Node *node)
 Add a child node, this node will have its parent set and will be deleted by this node upon destruction. More...
 
bool removeChild (Node *node)
 Remove child node, this node will no longer be deleted. More...
 
Nodechild (size_t index)
 Get the child Node at the specified index. More...
 
size_t childCount () const
 
std::vector< Node * > & children ()
 Get a reference to the child nodes list.
 
const std::vector< Node * > & children () const
 
void clear ()
 Remove all children.
 
- Public Member Functions inherited from Node
const GroupNodeparent () const
 Get a pointer to the node's parent. More...
 
GroupNodeparent ()
 
void setVisible (bool visibility)
 Set the visibility of the node. More...
 
bool isVisible () const
 Get the current visibility of the node. More...
 
template<typename T >
T * cast ()
 Attempt to dynamic_cast to specified node type. More...
 
template<typename T >
const T * cast () const
 

Protected Attributes

std::vector< Node * > m_children
 
- Protected Attributes inherited from Node
GroupNodem_parent
 
bool m_visible
 

Additional Inherited Members

- Protected Member Functions inherited from Node
void setParent (GroupNode *parent)
 Set the parent node for the node. More...
 

Detailed Description

Author
Marcus D. Hanwell

The GroupNode may be used to group items together, but for most other purposes a more derived Node type would be the correct choice.

Member Function Documentation

◆ accept()

void accept ( Visitor )
overridevirtual

Accept a visit from our friendly visitor.

Reimplemented from Node.

◆ addChild()

void addChild ( Node node)
Parameters
nodeNode to be added.

◆ removeChild()

bool removeChild ( Node node)
Parameters
nodeNode to be removed.
Returns
True if the node was removed, false if it was not found.

◆ child()

Node* child ( size_t  index)
Parameters
indexThe index of the child.
Returns
A pointer to the child node, or nullptr if the index is out of range.

◆ childCount()

size_t childCount ( ) const
Returns
The number of child nodes contained by the GroupNode.

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