3#include <cgv/base/action.h>
14 std::vector<X*>& result;
16 find_action(std::vector<X*>& _result) :
action(
true,
true), result(_result) {}
19 x = p->get_interface<X>();
44template <
class X,
typename T>
50 std::vector<T*> instances;
52 if (instances.empty())
54 pointer = instances[i < instances.size() ? i : instances.size() - 1];
action(bool _default_result_begin, bool _default_result_end)
construct with default return values for the begin and end method
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
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...
the base namespace holds the base hierarchy, support for plugin registration and signals
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
this header is dependency free