OpenGLPrakt --> cObject
This object provides any means neccessary to build a scene graph.
It is intended to derive from it, overloading the DrawTheObject() and probably Init() methods.
public cObject ( const char * name = NULL ) ;
constructor with initialization for name (default constructor)
name | name to identify the object (optional) |
public cObject ( const cObject & ) ;
copy constructor
public virtual ~ cObject ( ) ;
destructor
public typedef slist < class cObject * > childs_t ;
a type for the list of childs an object has
The scene graph is an n-ary tree, cObjects are the nodes. We cannot store plain cObjects here since vector<> might invalidate iterators during realloc()'ing (thatswhy, we use slist<>)
We make it public to provide limited access to child tree.
protected childs_t mChilds
singly linked list of all childs (uses STLs slist template)
protected string * mName
name of this object (defaults to class name)
public virtual int Init ( ) ;
initialization function (candidate for overloading!) note: You *have to* call this function, even if overloaded! (best way is to call cObject::Init after having done your specific work) You may not display anything during Init().
public cObject * AddChild ( cObject * child ) ;
add new child object (copy it!)
child | reference to cObject object |
public bool HasChilds ( ) ;
determine whether the object has got any siblings
public childs_t :: const_iterator GetChildsBeginIterator ( ) ;
provide access to childs
public childs_t :: const_iterator GetChildsEndIterator ( ) ;
determine iterator for end of child list
public const char * GetName ( ) const ;
query name of object
public void SetName ( const char * n ) ;
set name of object
name | name of object |
protected virtual void Activate ( ) ;
actions to perform before drawing the object and it's siblings (might be overloaded)
Activate() works as follows: (see implementation for details) 1. call Activate() of all siblings 2. Deactivate () (may be overloaded)
protected virtual void Deactivate ( ) ;
actions to perform after drawing the object and it's siblings (might be overloaded)
protected virtual const char * GetDefaultName ( ) const ;
return default name of object (the poor man's RTTI)
Every object within the scene graph can be associated a name. By default, the class of the object is used.
This documentation was generated automatically by the ccdoc tool (version 0.7a).
Click here to submit a bug report or feature request.
Click here to return to the top of the page.