#include <mrpt/opengl/CSetOfObjects.h>
Public Member Functions | |
template<class T > | |
void | insertCollection (const T &objs) |
Inserts a set of objects into the list. | |
void | insert (const CRenderizablePtr &newObject) |
Insert a new object to the list. | |
template<class T_it > | |
void | insert (const T_it &begin, const T_it &end) |
Inserts a set of objects, bounded by iterators, into 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, double &dist) const |
Ray tracing. | |
virtual void | setColor (const mrpt::utils::TColorf &c) |
Changes the default object color. | |
virtual void | setColor (double r, double g, double b, double a=1) |
Set the color components of this object (R,G,B,Alpha, in the range 0-1). | |
virtual void | setColorR (const double r) |
Color components in the range [0,1]. | |
virtual void | setColorG (const double g) |
Color components in the range [0,1]. | |
virtual void | setColorB (const double b) |
Color components in the range [0,1]. | |
virtual void | setColorA (const double a) |
Color components in the range [0,1]. | |
bool | contains (const CRenderizablePtr &obj) const |
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 |
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 106 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 T_it & | begin, | |
const T_it & | end | |||
) | [inline] |
Inserts a set of objects, bounded by iterators, into the list.
Definition at line 77 of file CSetOfObjects.h.
void mrpt::opengl::CSetOfObjects::insert | ( | const CRenderizablePtr & | newObject | ) |
Insert a new object to the list.
void mrpt::opengl::CSetOfObjects::insertCollection | ( | const T & | objs | ) | [inline] |
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 | ( | double | R, | |
double | G, | |||
double | B, | |||
double | A = 1 | |||
) | [virtual] |
Set the color components of this object (R,G,B,Alpha, in the range 0-1).
Reimplemented from mrpt::opengl::CRenderizable.
virtual void mrpt::opengl::CSetOfObjects::setColor | ( | const mrpt::utils::TColorf & | c | ) | [virtual] |
virtual void mrpt::opengl::CSetOfObjects::setColorA | ( | const double | a | ) | [virtual] |
virtual void mrpt::opengl::CSetOfObjects::setColorB | ( | const double | b | ) | [virtual] |
virtual void mrpt::opengl::CSetOfObjects::setColorG | ( | const double | g | ) | [virtual] |
virtual void mrpt::opengl::CSetOfObjects::setColorR | ( | const double | r | ) | [virtual] |
size_t mrpt::opengl::CSetOfObjects::size | ( | ) | [inline] |
virtual bool mrpt::opengl::CSetOfObjects::traceRay | ( | const mrpt::poses::CPose3D & | o, | |
double & | 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.9 for MRPT 0.7.1 SVN: at Mon Aug 17 22:21:34 EDT 2009 |