cgv
Loading...
Searching...
No Matches
cgv::base::traverse_policy Class Reference

nodes should inherit from this policy class to allow selective tree traversals More...

#include <traverser.h>

Inheritance diagram for cgv::base::traverse_policy:
cgv::gui::event_handler cgv::render::drawable cgv::app::gizmo cgv::app::overlay cgv::gui::key_control< T > cgv::gui::key_control< bool > vr_emulator vr_test cgv::app::gizmo cgv::app::overlay cgv::plot::plot_base cgv::render::callback_drawable cgv::render::gl::gl_implicit_surface_drawable_base cgv::render::gl::image_drawable cgv::render::gl::mesh_drawable cgv::render::multi_pass_drawable vr_emulator vr_test

Public Member Functions

 traverse_policy (int _policy=TP_ALL+TP_STOP_ON_SUCCESS, bool _active=true, int _focus=-1)
 construct default traverse policy that visits everything
 
int get_policy () const
 return the policy without the stop on success flag
 
bool stop_on_success () const
 return whether to stop on success
 
bool stop_on_failure () const
 return whether to stop on failure
 
void set_policy (int _policy)
 set a new policy, always add stop on success flag if needed
 
int get_focused_child () const
 return the focused child or -1 if none is focused
 
void set_focused_child (int _focused_child)
 set the focused child
 
bool get_active () const
 return whether the current node is active
 
void set_active (bool _active)
 set the active flag of the current node
 

Protected Attributes

TraversePolicy policy
 
bool active
 
int focus
 

Detailed Description

nodes should inherit from this policy class to allow selective tree traversals

Definition at line 23 of file traverser.h.

Constructor & Destructor Documentation

◆ traverse_policy()

cgv::base::traverse_policy::traverse_policy ( int  _policy = TP_ALL+TP_STOP_ON_SUCCESS,
bool  _active = true,
int  _focus = -1 
)

construct default traverse policy that visits everything

Definition at line 7 of file traverser.cxx.

Member Function Documentation

◆ get_active()

bool cgv::base::traverse_policy::get_active ( ) const

return whether the current node is active

Definition at line 39 of file traverser.cxx.

Referenced by cgv::app::gizmo::handle(), and cgv::base::traverser::traverse_tmp_1().

◆ get_focused_child()

int cgv::base::traverse_policy::get_focused_child ( ) const

return the focused child or -1 if none is focused

Definition at line 31 of file traverser.cxx.

Referenced by cgv::base::traverser::traverse_tmp_1().

◆ get_policy()

int cgv::base::traverse_policy::get_policy ( ) const

return the policy without the stop on success flag

Definition at line 11 of file traverser.cxx.

References cgv::base::TP_STOP_ON_FAILURE, and cgv::base::TP_STOP_ON_SUCCESS.

Referenced by cgv::base::traverser::traverse_tmp_1().

◆ set_active()

void cgv::base::traverse_policy::set_active ( bool  _active)

set the active flag of the current node

Definition at line 43 of file traverser.cxx.

◆ set_focused_child()

void cgv::base::traverse_policy::set_focused_child ( int  _focused_child)

set the focused child

Definition at line 35 of file traverser.cxx.

Referenced by cgv::base::traverser::traverse_tmp_1().

◆ set_policy()

void cgv::base::traverse_policy::set_policy ( int  _policy)

set a new policy, always add stop on success flag if needed

Definition at line 27 of file traverser.cxx.

◆ stop_on_failure()

bool cgv::base::traverse_policy::stop_on_failure ( ) const

return whether to stop on failure

Definition at line 22 of file traverser.cxx.

References cgv::base::TP_STOP_ON_FAILURE.

Referenced by cgv::base::traverser::traverse_tmp_1(), and cgv::base::traverser::traverse_tmp_2().

◆ stop_on_success()

bool cgv::base::traverse_policy::stop_on_success ( ) const

return whether to stop on success

Definition at line 16 of file traverser.cxx.

References cgv::base::TP_STOP_ON_SUCCESS.

Referenced by cgv::base::traverser::traverse_tmp_1(), and cgv::base::traverser::traverse_tmp_2().

Member Data Documentation

◆ active

bool cgv::base::traverse_policy::active
protected

Definition at line 27 of file traverser.h.

◆ focus

int cgv::base::traverse_policy::focus
protected

Definition at line 28 of file traverser.h.

◆ policy

TraversePolicy cgv::base::traverse_policy::policy
protected

Definition at line 26 of file traverser.h.


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