Utility to walk through nodes. More...
#include <Traverser.hpp>
Public Member Functions | |
Traverser (Scene *scene) | |
virtual void | start () |
Protected Member Functions | |
void | findDependents () |
Canvas * | getCanvas () const |
virtual void | onApplicable (Node *node, Applicable *applicable) |
virtual void | onDrawable (Node *node, Drawable *drawable) |
void | traverseChildren (Node *node) |
void | traverseNode (Node *node) |
void | setCanvas (Canvas *canvas) |
Private Attributes | |
list< Dependent * > | dependents |
Scene * | scene |
Canvas * | canvas |
Utility to walk through nodes.
void findDependents | ( | ) | [protected] |
Finds nodes that are dependent on the canvas.
Canvas * getCanvas | ( | ) | const [inline, protected] |
void setCanvas | ( | Canvas * | c | ) | [inline, protected] |
Sets the canvas that will be used for dependent nodes.
void traverseChildren | ( | Node * | node | ) | [protected] |
Recursively traverses the children of a node.
This functionality is implemented as a separate function, as opposed to incorporating it directly into paint, because some nodes need to traverse their children at different times.
node | Pointer to the parent node. |
void traverseNode | ( | Node * | node | ) | [protected] |
Recursively traverses a node.
Automatically takes care of performing different actions depending on what type of interfaces the node supports.
node | Pointer to the Node to paint. |