inlib  1.2.0
Public Member Functions | Public Attributes | Protected Member Functions
inlib::sg::_switch Class Reference
Inheritance diagram for inlib::sg::_switch:
Inheritance graph
[legend]
Collaboration diagram for inlib::sg::_switch:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual void render (render_action &a_action)
virtual void pick (pick_action &a_action)
virtual void bbox (bbox_action &a_action)
virtual void search (search_action &a_action)
virtual void event (event_action &a_action)
 _switch ()
virtual ~_switch ()

Public Attributes

sf< int > which

Protected Member Functions

 _switch (const _switch &a_from)
_switchoperator= (const _switch &a_from)

Detailed Description

Definition at line 15 of file _switch.


Constructor & Destructor Documentation

inlib::sg::_switch::_switch ( ) [inline]

Definition at line 81 of file _switch.

  :group()
  ,which(-1)
  {
    add_fields();
  }
virtual inlib::sg::_switch::~_switch ( ) [inline, virtual]

Definition at line 87 of file _switch.

{}
inlib::sg::_switch::_switch ( const _switch a_from) [inline, protected]

Definition at line 89 of file _switch.

  :group(a_from)
  ,which(a_from.which)
  {
    add_fields();
  }

Member Function Documentation

virtual void inlib::sg::_switch::bbox ( bbox_action a_action) [inline, virtual]

Reimplemented from inlib::sg::group.

Definition at line 45 of file _switch.

                                           {
    int index = which.value();
    if(index==(-1)) {
      std::vector<node*>::iterator it;
      for(it=m_children.begin();it!=m_children.end();++it) {
        (*it)->bbox(a_action);
      }    
    } else if((index>=0)&&(index<(int)m_children.size())) {
      m_children[index]->bbox(a_action);
    }
  }
virtual void inlib::sg::_switch::event ( event_action a_action) [inline, virtual]

Reimplemented from inlib::sg::group.

Definition at line 68 of file _switch.

                                             {
    int index = which.value();
    if(index==(-1)) {
      std::vector<node*>::iterator it;
      for(it=m_children.begin();it!=m_children.end();++it) {
        (*it)->event(a_action);
        //if(a_action.handled()) break;
      }    
    } else if((index>=0)&&(index<(int)m_children.size())) {
      m_children[index]->event(a_action);
    }
  }
_switch& inlib::sg::_switch::operator= ( const _switch a_from) [inline, protected]

Definition at line 95 of file _switch.

                                           {
    group::operator=(a_from);
    which = a_from.which;
    return *this;
  }
virtual void inlib::sg::_switch::pick ( pick_action a_action) [inline, virtual]

Reimplemented from inlib::sg::group.

Definition at line 33 of file _switch.

                                           {
    int index = which.value();
    if(index==(-1)) {
      std::vector<node*>::iterator it;
      for(it=m_children.begin();it!=m_children.end();++it) {
        (*it)->pick(a_action);
        if(a_action.done()) break;
      }    
    } else if((index>=0)&&(index<(int)m_children.size())) {
      m_children[index]->pick(a_action);
    }
  }
virtual void inlib::sg::_switch::render ( render_action a_action) [inline, virtual]

Reimplemented from inlib::sg::group.

Definition at line 22 of file _switch.

                                               {
    int index = which.value();
    if(index==(-1)) {
      std::vector<node*>::iterator it;
      for(it=m_children.begin();it!=m_children.end();++it) {
        (*it)->render(a_action);
      }     
    } else if((index>=0)&&(index<(int)m_children.size())) {
      m_children[index]->render(a_action);
    }
  }
virtual void inlib::sg::_switch::search ( search_action a_action) [inline, virtual]

Reimplemented from inlib::sg::group.

Definition at line 56 of file _switch.

                                               {
    int index = which.value();
    if(index==(-1)) {
      std::vector<node*>::iterator it;
      for(it=m_children.begin();it!=m_children.end();++it) {
        (*it)->search(a_action);
        if(a_action.done()) break;
      }    
    } else if((index>=0)&&(index<(int)m_children.size())) {
      m_children[index]->search(a_action);
    }
  }

Member Data Documentation

Definition at line 20 of file _switch.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines