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 () const
 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.
virtual bool traceRay (const mrpt::poses::CPose3D &o, float &dist) const
 Ray tracing.
virtual void setColor (const mrpt::utils::TColorf &c)
 Changes the default object color.
virtual void setColor (float r, float g, float b, float a=1)
virtual void setColorR (const double r)
virtual void setColorG (const double g)
virtual void setColorB (const double b)
virtual void setColorA (const double a)
bool contains (const CRenderizablePtr &obj) const

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.

bool mrpt::opengl::CSetOfObjects::contains ( const CRenderizablePtr &  obj  )  const

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 (  )  const [virtual]

Render child objects.

Implements mrpt::opengl::CRenderizable.

virtual void mrpt::opengl::CSetOfObjects::setColor ( float  r,
float  g,
float  b,
float  a = 1 
) [virtual]

virtual void mrpt::opengl::CSetOfObjects::setColor ( const mrpt::utils::TColorf c  )  [virtual]

Changes the default object color.

Reimplemented from mrpt::opengl::CRenderizable.

virtual void mrpt::opengl::CSetOfObjects::setColorA ( const double  a  )  [virtual]

Reimplemented from mrpt::opengl::CRenderizable.

virtual void mrpt::opengl::CSetOfObjects::setColorB ( const double  b  )  [virtual]

Reimplemented from mrpt::opengl::CRenderizable.

virtual void mrpt::opengl::CSetOfObjects::setColorG ( const double  g  )  [virtual]

Reimplemented from mrpt::opengl::CRenderizable.

virtual void mrpt::opengl::CSetOfObjects::setColorR ( const double  r  )  [virtual]

Reimplemented from mrpt::opengl::CRenderizable.

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

Returns number of objects.

Definition at line 80 of file CSetOfObjects.h.

virtual bool mrpt::opengl::CSetOfObjects::traceRay ( const mrpt::poses::CPose3D o,
float &  dist 
) const [virtual]

Ray tracing.

Reimplemented from mrpt::opengl::CRenderizable.


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.7.1 for MRPT 0.6.5 SVN: at Mon Feb 23 13:25:04 EST 2009