3#include <cgv/base/action.h>
14 std::vector<X*>& result;
19 x = p->get_interface<X>();
44template <
class X,
typename T>
The action class is used in tree traversals together with the traverser.
simple action implementation that adds nodes implementing X to a results vector
void select(base_ptr p)
make the passed object current
bool implements_action() const
check if the current object implements the interface needed for this action
bool begin()
perform the enter part of the action on the current object
complete implementation of method actions that only call one method when entering a node
class used to traverse a tree structure
bool traverse(base_ptr start, traverse_callback_handler *tch=0)
traverse a tree starting at given node according to set strategy, order and dest and previously comin...
bool ensure_by_find(X *start, T *&pointer, unsigned i=0)
traverse the hierarchy to find the i-th instance of type T and set pointer to it but only in case poi...
data::ref_ptr< base, true > base_ptr
ref counted pointer to base
void find_interface(base_ptr start, std::vector< X * > &result)
collect all nodes that implement interface X