Avogadro::Rendering::GroupNode#

class GroupNode : public Node#

The GroupNode class provides common API for grouping child nodes.

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

Author

Marcus D. Hanwell

Subclassed by TransformNode

Public Types

enum NodeType#

Values:

enumerator ALL#
enumerator NONE#
enumerator UI#
enumerator GEOMETRY#

Public Functions

explicit GroupNode(GroupNode *parent = nullptr)#
~GroupNode() override#
virtual void accept(Visitor&) override#

Accept a visit from our friendly visitor.

void addChild(Node *node, NodeType ui = NodeType::GEOMETRY)#

Add a child node, this node will have its parent set and will be deleted by this node upon destruction.

Parameters:

nodeNode to be added.

void addUIChild(Node *node)#

Add a child node, this node will have its parent set and will be deleted by this node upon destruction.

Parameters:

nodeNode to be added.

bool removeChild(Node *node)#

Remove child node, this node will no longer be deleted.

Parameters:

nodeNode to be removed.

Returns:

True if the node was removed, false if it was not found.

Node *child(size_t index)#

Get the child Node at the specified index.

Parameters:

index – The index of the child.

Returns:

A pointer to the child node, or nullptr if the index is out of range. time complexity: O(n)

bool hasChild(Node *node) const#

check if the Node exists in this GroupNode.

Parameters:

nodeNode to search.

Returns:

True if the node was found, false otherwise.

inline size_t childCount() const#
Returns:

The number of child nodes contained by the GroupNode.

inline std::list<NodeInfo> &children()#

Get a reference to the child nodes list.

inline const std::list<NodeInfo> &children() const#
void clear()#

Remove all non UI-children.

void clearUI()#

Remove all UI-children.

Protected Functions

void clear(NodeType type)#

Protected Attributes

std::list<NodeInfo> m_children#
struct NodeInfo#

Public Functions

inline NodeInfo()#
inline NodeInfo(Node *n, NodeType u)#

Public Members

NodeType ui#
Node *node#