inlib
1.2.0
|
Public Member Functions | |
virtual void * | cast (const std::string &a_class) const |
virtual node * | copy () const |
virtual const std::string & | s_cls () const |
virtual void | render (render_action &a_action) |
virtual void | pick (pick_action &a_action) |
virtual void | bbox (bbox_action &a_action) |
virtual void | event (event_action &a_action) |
virtual void | search (search_action &a_action) |
virtual bool | write (write_action &a_action) |
group () | |
virtual | ~group () |
group (const group &a_from) | |
group & | operator= (const group &a_from) |
void | add (node *a_node) |
void | set (unsigned a_index, node *a_node) |
void | clear () |
unsigned int | size () const |
bool | empty () const |
node * | operator[] (unsigned int a_index) const |
const std::vector< node * > & | children () const |
Static Public Member Functions | |
static const std::string & | s_class () |
Protected Member Functions | |
bool | write_children (write_action &a_action) |
Protected Attributes | |
std::vector< node * > | m_children |
virtual inlib::sg::group::~group | ( | ) | [inline, virtual] |
inlib::sg::group::group | ( | const group & | a_from | ) | [inline] |
Definition at line 76 of file group.
:node(a_from) { std::vector<node*>::const_iterator it; for(it=a_from.m_children.begin();it!=a_from.m_children.end();++it) { m_children.push_back((*it)->copy()); } }
void inlib::sg::group::add | ( | node * | a_node | ) | [inline] |
Definition at line 94 of file group.
{ //WARNING : take ownership of a_node. m_children.push_back(a_node); }
virtual void inlib::sg::group::bbox | ( | bbox_action & | a_action | ) | [inline, virtual] |
Reimplemented from inlib::sg::node.
Reimplemented in inlib::sg::_switch.
Definition at line 46 of file group.
{ std::vector<node*>::iterator it; for(it=m_children.begin();it!=m_children.end();++it) { (*it)->bbox(a_action); } }
virtual void* inlib::sg::group::cast | ( | const std::string & | a_class | ) | const [inline, virtual] |
Reimplemented from inlib::sg::node.
Definition at line 25 of file group.
{ if(void* p = inlib::cmp_cast<group>(this,a_class)) {return p;} return node::cast(a_class); }
const std::vector<node*>& inlib::sg::group::children | ( | ) | const [inline] |
Definition at line 138 of file group.
{return m_children;}
void inlib::sg::group::clear | ( | ) | [inline] |
Definition at line 123 of file group.
{ std::vector<node*>::iterator it; for(it=m_children.begin();it!=m_children.end();) { node* child = *it; it = m_children.erase(it); delete child; } m_children.clear(); }
virtual node* inlib::sg::group::copy | ( | ) | const [inline, virtual] |
bool inlib::sg::group::empty | ( | ) | const [inline] |
Definition at line 133 of file group.
{return m_children.size()?false:true;}
virtual void inlib::sg::group::event | ( | event_action & | a_action | ) | [inline, virtual] |
Reimplemented from inlib::sg::node.
Reimplemented in inlib::sg::_switch.
Definition at line 52 of file group.
{ std::vector<node*>::iterator it; for(it=m_children.begin();it!=m_children.end();++it) { (*it)->event(a_action); //if(a_action.handled()) break; //do not stop if handled. } }
Definition at line 84 of file group.
{ node::operator=(a_from); clear(); std::vector<node*>::const_iterator it; for(it=a_from.m_children.begin();it!=a_from.m_children.end();++it) { m_children.push_back((*it)->copy()); } return *this; }
node* inlib::sg::group::operator[] | ( | unsigned int | a_index | ) | const [inline] |
Definition at line 134 of file group.
{ //WARNING : no check is done on a_index. return m_children[a_index]; }
virtual void inlib::sg::group::pick | ( | pick_action & | a_action | ) | [inline, virtual] |
Reimplemented from inlib::sg::node.
Reimplemented in inlib::sg::_switch.
Definition at line 39 of file group.
{ std::vector<node*>::iterator it; for(it=m_children.begin();it!=m_children.end();++it) { (*it)->pick(a_action); if(a_action.done()) break; } }
virtual void inlib::sg::group::render | ( | render_action & | a_action | ) | [inline, virtual] |
Reimplemented from inlib::sg::node.
Reimplemented in inlib::sg::_switch.
Definition at line 33 of file group.
{ std::vector<node*>::iterator it; for(it=m_children.begin();it!=m_children.end();++it) { (*it)->render(a_action); } }
static const std::string& inlib::sg::group::s_class | ( | ) | [inline, static] |
Reimplemented from inlib::sg::node.
Definition at line 20 of file group.
{ static const std::string s_v("inlib::sg::group"); return s_v; }
virtual const std::string& inlib::sg::group::s_cls | ( | ) | const [inline, virtual] |
virtual void inlib::sg::group::search | ( | search_action & | a_action | ) | [inline, virtual] |
Reimplemented from inlib::sg::node.
Reimplemented in inlib::sg::_switch.
Definition at line 59 of file group.
{ std::vector<node*>::iterator it; for(it=m_children.begin();it!=m_children.end();++it) { (*it)->search(a_action); if(a_action.done()) break; } }
void inlib::sg::group::set | ( | unsigned | a_index, |
node * | a_node | ||
) | [inline] |
Definition at line 98 of file group.
{ //WARNING : take ownership of a_node. //WARNING : no check is done on a_index. m_children[a_index] = a_node; }
unsigned int inlib::sg::group::size | ( | ) | const [inline] |
Definition at line 132 of file group.
{return m_children.size();}
virtual bool inlib::sg::group::write | ( | write_action & | a_action | ) | [inline, virtual] |
Reimplemented from inlib::sg::node.
Definition at line 66 of file group.
{ if(!a_action.beg_node(*this)) return false; if(!write_children(a_action)) return false; if(!a_action.end_node(*this)) return false; return true; }
bool inlib::sg::group::write_children | ( | write_action & | a_action | ) | [inline, protected] |
Definition at line 140 of file group.
{ std::vector<node*>::iterator it; for(it=m_children.begin();it!=m_children.end();++it) { if(!(*it)->write(a_action)) return false; } return true; }
std::vector<node*> inlib::sg::group::m_children [protected] |