cgv
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
cgv::base::traverser Class Reference

class used to traverse a tree structure More...

#include <traverser.h>

Public Member Functions

 traverser (action &_a, const std::string &_visit_order="pnc", TraverseStrategy _strategy=TS_DEPTH_FIRST, bool _stop_if_not_implemented=false, bool _ignore_activation_state=false)
 construct from reference on action and traversal order string
 
traverserset_visit_order (const std::string &_visit_order)
 set a different visiting order of node, children and parent
 
traverserset_strategy (TraverseStrategy _strategy)
 set a different traverse strategy
 
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 coming from src and return whether traversal yielded success
 

Protected Member Functions

template<typename TCH >
bool traverse_tmp_1 (base_ptr dest, base_ptr src, bool &force_termination, TCH &tch)
 traverse a single object, template over a static traverse callback handler interface
 
template<typename TCH >
bool traverse_tmp_2 (base_ptr p, base_ptr dest, base_ptr src, traverse_policy *tp, bool &force_termination, TCH &tch)
 helper method encapsulating common functionality
 

Protected Attributes

actiona
 
TraverseStrategy strategy
 
std::string visit_order
 
bool stop_if_not_implemented
 
bool ignore_activation_state
 whether to ignore the active flag of the traverse policy of the traversed object
 

Detailed Description

class used to traverse a tree structure

Definition at line 101 of file traverser.h.

Constructor & Destructor Documentation

◆ traverser()

cgv::base::traverser::traverser ( action _a,
const std::string &  _visit_order = "pnc",
TraverseStrategy  _strategy = TS_DEPTH_FIRST,
bool  _stop_if_not_implemented = false,
bool  _ignore_activation_state = false 
)

construct from reference on action and traversal order string

Definition at line 203 of file traverser.cxx.

Member Function Documentation

◆ traverse()

bool cgv::base::traverser::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 coming from src and return whether traversal yielded success

Definition at line 373 of file traverser.cxx.

References traverse_tmp_1().

Referenced by cgv::render::gl::gl_context::configure_gl(), cgv::render::context::configure_new_child(), cgv::base::find_interface(), and cgv::render::context::render_pass().

◆ traverse_tmp_1()

◆ traverse_tmp_2()

template<typename TCH >
bool cgv::base::traverser::traverse_tmp_2 ( base_ptr  p,
base_ptr  dest,
base_ptr  src,
traverse_policy tp,
bool force_termination,
TCH tch 
)
protected

helper method encapsulating common functionality

Definition at line 355 of file traverser.cxx.

References cgv::base::traverse_policy::stop_on_failure(), cgv::base::traverse_policy::stop_on_success(), and traverse_tmp_1().

Referenced by traverse_tmp_1().

Member Data Documentation

◆ a

action& cgv::base::traverser::a
protected

Definition at line 104 of file traverser.h.

◆ ignore_activation_state

bool cgv::base::traverser::ignore_activation_state
protected

whether to ignore the active flag of the traverse policy of the traversed object

Definition at line 109 of file traverser.h.

Referenced by traverse_tmp_1().

◆ stop_if_not_implemented

bool cgv::base::traverser::stop_if_not_implemented
protected

Definition at line 107 of file traverser.h.

◆ strategy

TraverseStrategy cgv::base::traverser::strategy
protected

Definition at line 105 of file traverser.h.

◆ visit_order

std::string cgv::base::traverser::visit_order
protected

Definition at line 106 of file traverser.h.


The documentation for this class was generated from the following files: