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"
Definition at line 52 of file CSetOfObjects.h.
#include <mrpt/opengl/CSetOfObjects.h>
Public Types | |
typedef CListOpenGLObjects::const_iterator | const_iterator |
typedef CListOpenGLObjects::iterator | iterator |
Public Member Functions | |
const_iterator | begin () const |
const_iterator | end () const |
iterator | begin () |
iterator | end () |
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. | |
bool | empty () const |
Returns true if there are no objects. | |
void | initializeAllTextures () |
Initializes all textures in the scene (See opengl::CTexturedPlane::loadTextureInOpenGL) | |
CRenderizablePtr | getByName (const std::string &str) |
Returns the first object with a given name, or a NULL pointer if not found. | |
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 CRenderizable & | setColor (const mrpt::utils::TColorf &c) |
Changes the default object color. | |
virtual CRenderizable & | 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 CRenderizable & | setColorR (const double r) |
Color components in the range [0,1]. | |
virtual CRenderizable & | setColorG (const double g) |
Color components in the range [0,1]. | |
virtual CRenderizable & | setColorB (const double b) |
Color components in the range [0,1]. | |
virtual CRenderizable & | 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. | |
RTTI stuff | |
typedef CSetOfObjectsPtr | SmartPtr |
static mrpt::utils::CLASSINIT | _init_CSetOfObjects |
static mrpt::utils::TRuntimeClassId | classCSetOfObjects |
static const mrpt::utils::TRuntimeClassId * | classinfo |
static const mrpt::utils::TRuntimeClassId * | _GetBaseClass () |
virtual const mrpt::utils::TRuntimeClassId * | GetRuntimeClass () const |
Returns information about the class of an object in runtime. | |
virtual mrpt::utils::CObject * | duplicate () const |
Returns a copy of the object, indepently of its class. | |
static mrpt::utils::CObject * | CreateObject () |
static CSetOfObjectsPtr | Create () |
Definition at line 64 of file CSetOfObjects.h.
Definition at line 65 of file CSetOfObjects.h.
A typedef for the associated smart pointer
Definition at line 54 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.
static const mrpt::utils::TRuntimeClassId* mrpt::opengl::CSetOfObjects::_GetBaseClass | ( | ) | [static, protected] |
Reimplemented from mrpt::opengl::CRenderizable.
iterator mrpt::opengl::CSetOfObjects::begin | ( | ) | [inline] |
Definition at line 69 of file CSetOfObjects.h.
const_iterator mrpt::opengl::CSetOfObjects::begin | ( | ) | const [inline] |
Definition at line 67 of file CSetOfObjects.h.
void mrpt::opengl::CSetOfObjects::clear | ( | ) |
Clear the list of objects in the scene, deleting objects' memory.
Referenced by mrpt::opengl::COctreePointRenderer< CPointCloudColoured >::octree_get_graphics_boundingboxes().
bool mrpt::opengl::CSetOfObjects::contains | ( | const CRenderizablePtr & | obj ) | const |
static CSetOfObjectsPtr mrpt::opengl::CSetOfObjects::Create | ( | ) | [static] |
static mrpt::utils::CObject* mrpt::opengl::CSetOfObjects::CreateObject | ( | ) | [static] |
void mrpt::opengl::CSetOfObjects::dumpListOfObjects | ( | utils::CStringList & | lst ) |
Retrieves a list of all objects in text form.
virtual mrpt::utils::CObject* mrpt::opengl::CSetOfObjects::duplicate | ( | ) | const [virtual] |
Returns a copy of the object, indepently of its class.
Implements mrpt::utils::CObject.
bool mrpt::opengl::CSetOfObjects::empty | ( | ) | const [inline] |
Returns true if there are no objects.
Definition at line 99 of file CSetOfObjects.h.
const_iterator mrpt::opengl::CSetOfObjects::end | ( | ) | const [inline] |
Definition at line 68 of file CSetOfObjects.h.
iterator mrpt::opengl::CSetOfObjects::end | ( | ) | [inline] |
Definition at line 70 of file CSetOfObjects.h.
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 117 of file CSetOfObjects.h.
References CLASS_ID_NAMESPACE, MRPT_END, and MRPT_START.
CRenderizablePtr mrpt::opengl::CSetOfObjects::getByName | ( | const std::string & | str ) |
Returns the first object with a given name, or a NULL pointer if not found.
virtual const mrpt::utils::TRuntimeClassId* mrpt::opengl::CSetOfObjects::GetRuntimeClass | ( | ) | const [virtual] |
Returns information about the class of an object in runtime.
Reimplemented from mrpt::opengl::CRenderizable.
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.
Referenced by mrpt::opengl::COctreePointRenderer< CPointCloudColoured >::octree_get_graphics_boundingboxes().
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 83 of file CSetOfObjects.h.
References end().
void mrpt::opengl::CSetOfObjects::insertCollection | ( | const T & | objs ) | [inline] |
Inserts a set of objects into the list.
Definition at line 74 of file CSetOfObjects.h.
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 CRenderizable& mrpt::opengl::CSetOfObjects::setColor | ( | const mrpt::utils::TColorf & | c ) | [virtual] |
Changes the default object color.
Reimplemented from mrpt::opengl::CRenderizable.
virtual CRenderizable& 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 CRenderizable& mrpt::opengl::CSetOfObjects::setColorA | ( | const double | a ) | [virtual] |
Color components in the range [0,1].
Reimplemented from mrpt::opengl::CRenderizable.
virtual CRenderizable& mrpt::opengl::CSetOfObjects::setColorB | ( | const double | b ) | [virtual] |
Color components in the range [0,1].
Reimplemented from mrpt::opengl::CRenderizable.
virtual CRenderizable& mrpt::opengl::CSetOfObjects::setColorG | ( | const double | g ) | [virtual] |
Color components in the range [0,1].
Reimplemented from mrpt::opengl::CRenderizable.
virtual CRenderizable& mrpt::opengl::CSetOfObjects::setColorR | ( | const double | r ) | [virtual] |
Color components in the range [0,1].
Reimplemented from mrpt::opengl::CRenderizable.
size_t mrpt::opengl::CSetOfObjects::size | ( | ) | [inline] |
Returns number of objects.
Definition at line 96 of file CSetOfObjects.h.
virtual bool mrpt::opengl::CSetOfObjects::traceRay | ( | const mrpt::poses::CPose3D & | o, |
double & | dist | ||
) | const [virtual] |
Ray tracing.
Reimplemented from mrpt::opengl::CRenderizable.
mrpt::utils::CLASSINIT mrpt::opengl::CSetOfObjects::_init_CSetOfObjects [static, protected] |
Definition at line 54 of file CSetOfObjects.h.
Definition at line 54 of file CSetOfObjects.h.
const mrpt::utils::TRuntimeClassId* mrpt::opengl::CSetOfObjects::classinfo [static] |
Definition at line 54 of file CSetOfObjects.h.
The list of child objects.
Objects are automatically deleted when calling "clear" or in the destructor.
Definition at line 60 of file CSetOfObjects.h.
Page generated by Doxygen 1.7.2 for MRPT 0.9.4 SVN: at Mon Jan 10 22:30:30 UTC 2011 |