MRPT logo

mrpt::opengl::CSetOfObjects Class Reference

A set of object, which are referenced to the coordinates framework established in this object. More...

#include <mrpt/opengl/CSetOfObjects.h>

Inheritance diagram for mrpt::opengl::CSetOfObjects:

mrpt::opengl::CRenderizable mrpt::utils::CSerializable

List of all members.

Public Member Functions

void insert (const CRenderizablePtr &newObject)
 Insert a new object to the list.
void render ()
 Render child objects.
void clear ()
 Clear the list of objects in the scene, deleting objects' memory.
size_t size ()
 Returns number of objects.
void initializeAllTextures ()
 Initializes all textures in the scene (See opengl::CTexturedPlane::loadTextureInOpenGL).
template<typename T >
T::SmartPtr getByClass (const size_t &ith=0) const
 Returns the i'th object of a given class (or of a descendant class), or NULL (an empty smart pointer) if not found.
void removeObject (const CRenderizablePtr &obj)
 Removes the given object from the scene (it also deletes the object to free its memory).
void dumpListOfObjects (utils::CStringList &lst)
 Retrieves a list of all objects in text form.

Static Public Member Functions

static CSetOfObjectsPtr Create ()
 Class factory.

Protected Attributes

CListOpenGLObjects m_objects
 The list of child objects.

Private Member Functions

 CSetOfObjects ()
 Default constructor.
virtual ~CSetOfObjects ()
 Private, virtual destructor: only can be deleted from smart pointers.


Detailed Description

A set of object, which are referenced to the coordinates framework established in this object.

It can be established a hierarchy of "CSetOfObjects", where the coordinates framework of each one will be referenced to the parent's one. The list of child objects is accessed directly as in the class "COpenGLScene"

See also:
opengl::COpenGLScene

Definition at line 53 of file CSetOfObjects.h.


Constructor & Destructor Documentation

mrpt::opengl::CSetOfObjects::CSetOfObjects (  )  [private]

Default constructor.

virtual mrpt::opengl::CSetOfObjects::~CSetOfObjects (  )  [private, virtual]

Private, virtual destructor: only can be deleted from smart pointers.


Member Function Documentation

void mrpt::opengl::CSetOfObjects::clear (  ) 

Clear the list of objects in the scene, deleting objects' memory.

static CSetOfObjectsPtr mrpt::opengl::CSetOfObjects::Create (  )  [inline, static]

Class factory.

Definition at line 83 of file CSetOfObjects.h.

References mrpt::opengl::CSetOfObjects.

void mrpt::opengl::CSetOfObjects::dumpListOfObjects ( utils::CStringList lst  ) 

Retrieves a list of all objects in text form.

template<typename T >
T::SmartPtr mrpt::opengl::CSetOfObjects::getByClass ( const size_t &  ith = 0  )  const [inline]

Returns the i'th object of a given class (or of a descendant class), or NULL (an empty smart pointer) if not found.

Example:

                                        CSpherePtr obs = myscene.getByClass<CSphere>();
By default (ith=0), the first observation is returned.

Definition at line 101 of file CSetOfObjects.h.

References CLASS_ID_NAMESPACE, MRPT_TRY_END, and MRPT_TRY_START.

void mrpt::opengl::CSetOfObjects::initializeAllTextures (  ) 

Initializes all textures in the scene (See opengl::CTexturedPlane::loadTextureInOpenGL).

void mrpt::opengl::CSetOfObjects::insert ( const CRenderizablePtr &  newObject  ) 

Insert a new object to the list.

void mrpt::opengl::CSetOfObjects::removeObject ( const CRenderizablePtr &  obj  ) 

Removes the given object from the scene (it also deletes the object to free its memory).

void mrpt::opengl::CSetOfObjects::render (  )  [virtual]

Render child objects.

Implements mrpt::opengl::CRenderizable.

size_t mrpt::opengl::CSetOfObjects::size (  )  [inline]

Returns number of objects.

Definition at line 80 of file CSetOfObjects.h.


Member Data Documentation

The list of child objects.

Objects are automatically deleted when calling "clear" or in the destructor.

Definition at line 61 of file CSetOfObjects.h.




Page generated by Doxygen 1.5.8 for MRPT 0.6.5 SVN:exported at Mon Jan 12 13:00:16 UTC 2009