Main MRPT website > C++ reference
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:
Inheritance graph
[legend]
Collaboration diagram for mrpt::opengl::CSetOfObjects:
Collaboration graph
[legend]

List of all members.

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 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.

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 52 of file CSetOfObjects.h.


Member Typedef Documentation

typedef CListOpenGLObjects::const_iterator mrpt::opengl::CSetOfObjects::const_iterator

Definition at line 64 of file CSetOfObjects.h.

typedef CListOpenGLObjects::iterator mrpt::opengl::CSetOfObjects::iterator

Definition at line 65 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

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.

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.

bool mrpt::opengl::CSetOfObjects::empty (  )  const [inline]

Returns true if there are no objects.

Definition at line 100 of file CSetOfObjects.h.

iterator mrpt::opengl::CSetOfObjects::end (  )  [inline]

Definition at line 70 of file CSetOfObjects.h.

const_iterator mrpt::opengl::CSetOfObjects::end (  )  const [inline]

Definition at line 68 of file CSetOfObjects.h.

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 118 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.

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

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

template<class T_it >
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 84 of file CSetOfObjects.h.

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

Insert a new object to the list.

template<class T >
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 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]

Changes the default object color.

Reimplemented from mrpt::opengl::CRenderizable.

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

Color components in the range [0,1].

Reimplemented from mrpt::opengl::CRenderizable.

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

Color components in the range [0,1].

Reimplemented from mrpt::opengl::CRenderizable.

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

Color components in the range [0,1].

Reimplemented from mrpt::opengl::CRenderizable.

virtual void 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 97 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.


Member Data Documentation

The list of child objects.

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

Definition at line 60 of file CSetOfObjects.h.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines



Page generated by Doxygen 1.6.1 for MRPT 0.9.0 SVN: at Mon Jun 7 06:47:58 UTC 2010