33 int get_policy()
const;
35 bool stop_on_success()
const;
37 bool stop_on_failure()
const;
41 int get_focused_child()
const;
45 bool get_active()
const;
53 node* n =
dynamic_cast<node*
>(instance);
80 virtual bool on_enter_node(
base_ptr b);
82 virtual bool on_leave_node(
base_ptr b);
84 virtual bool on_enter_children(
group_ptr g);
86 virtual bool on_leave_children(
group_ptr g);
88 virtual bool on_enter_parent(
node_ptr n);
90 virtual bool on_leave_parent(
node_ptr n);
106 std::string visit_order;
107 bool stop_if_not_implemented;
111 template <
typename TCH>
114 template <
typename TCH>
133#include <cgv/config/lib_end.h>
The action class is used in tree traversals together with the traverser.
T * get_interface()
use dynamic type cast to check for the given interface
virtual data::ref_ptr< group, true > get_group()
perform downcast to group
unsigned int get_nr_children() const
return the number of children
base_ptr get_child(unsigned int i) const
return the i-th child
The node class keeps a pointer to its parent.
node_ptr get_parent() const
return the parent node
complete implementation of method actions that only call one method when entering a node
interface of a handler for traverse callbacks
nodes should inherit from this policy class to allow selective tree traversals
class used to traverse a tree structure
bool ignore_activation_state
whether to ignore the active flag of the traverse policy of the traversed object
traverser & set_visit_order(const std::string &_visit_order)
set a different visiting order of node, children and parent
traverser & set_strategy(TraverseStrategy _strategy)
set a different traverse strategy
bool empty() const
check if pointer is not yet set
bool grab_focus(X *instance)
try to grab the focus in the path of this node to the root of the tree
TraverseStrategy
not yet implemented
TraversePolicy
different traversal policies
@ TP_AUTO_FOCUS
first traverse focused and then the remaining children
@ TP_STOP_ON_FAILURE
this is an optional flag for traversals with methods that return a bool. If the returned bool is true...
@ TP_ONLY_FOCUS
traverse all children
@ TP_FIRST_FOCUS
traverse only the focused child
@ TP_STOP_ON_SUCCESS
like previous but change focus to the child, where traversal succeeded