#include <mrpt/opengl/CSetOfObjects.h>
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. |
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"
Definition at line 53 of file CSetOfObjects.h.
mrpt::opengl::CSetOfObjects::CSetOfObjects | ( | ) | [private] |
Default constructor.
virtual mrpt::opengl::CSetOfObjects::~CSetOfObjects | ( | ) | [private, virtual] |
Private, virtual destructor: only can be deleted from smart pointers.
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.
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>();
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] |
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] |
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] |
virtual bool mrpt::opengl::CSetOfObjects::traceRay | ( | const mrpt::poses::CPose3D & | o, | |
float & | dist | |||
) | const [virtual] |
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: at Thu Feb 26 02:07:47 EST 2009 |