Main MRPT website > C++ reference
MRPT logo
Classes | Public Types | Public Member Functions | Protected Attributes | Private Member Functions

mrpt::opengl::CSetOfTriangles Class Reference


Detailed Description

A set of colored triangles.

This class can be used to draw any solid, arbitrarily complex object (without textures).

See also:
opengl::COpenGLScene, CSetOfTexturedTriangles

Definition at line 47 of file CSetOfTriangles.h.

#include <mrpt/opengl/CSetOfTriangles.h>

Inheritance diagram for mrpt::opengl::CSetOfTriangles:
Inheritance graph
[legend]

List of all members.

Classes

struct  TTriangle
 Triangle definition. More...

Public Types

typedef std::vector< TTriangle >
::const_iterator 
const_iterator
 Const iterator type.
typedef std::vector< TTriangle >
::const_reverse_iterator 
const_reverse_iterator
 Const reverse iterator type.

Public Member Functions

void updatePolygons () const
 Polygon cache updating.
void clearTriangles ()
 Clear this object.
size_t getTrianglesCount () const
 Get triangle count.
void getTriangle (size_t idx, TTriangle &t) const
 Gets the triangle in a given position.
void insertTriangle (const TTriangle &t)
 Inserts a triangle into the set.
template<class InputIterator >
void insertTriangles (const InputIterator &begin, const InputIterator &end)
 Inserts a set of triangles, bounded by iterators, into this set.
void insertTriangles (const CSetOfTrianglesPtr &p)
 Inserts an existing CSetOfTriangles into this one.
void reserve (size_t t)
 Reserves memory for certain number of triangles, avoiding multiple memory allocation calls.
void enableTransparency (bool v)
 Enables or disables transparency.
virtual CRenderizablesetColor (const mrpt::utils::TColorf &c)
 Changes the default object color.
virtual CRenderizablesetColor (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 CRenderizablesetColorR (const double r)
 Color components in the range [0,1].
virtual CRenderizablesetColorG (const double g)
 Color components in the range [0,1].
virtual CRenderizablesetColorB (const double b)
 Color components in the range [0,1].
virtual CRenderizablesetColorA (const double a)
 Color components in the range [0,1].
void render_dl () const
 Render.
virtual bool traceRay (const mrpt::poses::CPose3D &o, double &dist) const
 Ray tracing.
void getPolygons (std::vector< mrpt::math::TPolygon3D > &polys) const
 Gets the polygon cache.
template<class CONTAINER >
void insertTriangles (const CONTAINER &c)
 Inserts a set of triangles, given in a container of either TTriangle's or TPolygon3D.
const_iterator begin () const
 Gets the beginning iterator to this object.
const_iterator end () const
 Gets the ending iterator to this object.
const_reverse_iterator rbegin () const
 Gets the reverse beginning iterator to this object, which points to the last triangle.
const_reverse_iterator rend () const
 Gets the reverse ending iterator to this object, which points to the beginning of the actual set.

Protected Attributes

std::vector< TTrianglem_triangles
 List of triangles.
bool m_enableTransparency
 Transparency enabling.
bool polygonsUpToDate
 Mutable variable used to check whether polygons need to be recalculated.
std::vector
< mrpt::math::TPolygonWithPlane
tmpPolygons
 Polygon cache.

Private Member Functions

 CSetOfTriangles (bool enableTransparency=false)
 Constructor.
virtual ~CSetOfTriangles ()
 Private, virtual destructor: only can be deleted from smart pointers.

RTTI stuff

typedef CSetOfTrianglesPtr SmartPtr
static mrpt::utils::CLASSINIT _init_CSetOfTriangles
static mrpt::utils::TRuntimeClassId classCSetOfTriangles
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::CObjectduplicate () const
 Returns a copy of the object, indepently of its class.
static mrpt::utils::CObjectCreateObject ()
static CSetOfTrianglesPtr Create ()

Member Typedef Documentation

Const iterator type.

Definition at line 68 of file CSetOfTriangles.h.

Const reverse iterator type.

Definition at line 72 of file CSetOfTriangles.h.

A typedef for the associated smart pointer

Definition at line 49 of file CSetOfTriangles.h.


Constructor & Destructor Documentation

mrpt::opengl::CSetOfTriangles::CSetOfTriangles ( bool  enableTransparency = false) [inline, private]

Constructor.

Definition at line 199 of file CSetOfTriangles.h.

virtual mrpt::opengl::CSetOfTriangles::~CSetOfTriangles ( ) [inline, private, virtual]

Private, virtual destructor: only can be deleted from smart pointers.

Definition at line 207 of file CSetOfTriangles.h.


Member Function Documentation

static const mrpt::utils::TRuntimeClassId* mrpt::opengl::CSetOfTriangles::_GetBaseClass ( ) [static, protected]
const_iterator mrpt::opengl::CSetOfTriangles::begin ( ) const [inline]

Gets the beginning iterator to this object.

Definition at line 175 of file CSetOfTriangles.h.

void mrpt::opengl::CSetOfTriangles::clearTriangles ( ) [inline]

Clear this object.

Definition at line 99 of file CSetOfTriangles.h.

References mrpt::opengl::CRenderizableDisplayList::notifyChange().

static CSetOfTrianglesPtr mrpt::opengl::CSetOfTriangles::Create ( ) [static]
static mrpt::utils::CObject* mrpt::opengl::CSetOfTriangles::CreateObject ( ) [static]
virtual mrpt::utils::CObject* mrpt::opengl::CSetOfTriangles::duplicate ( ) const [virtual]

Returns a copy of the object, indepently of its class.

Implements mrpt::utils::CObject.

void mrpt::opengl::CSetOfTriangles::enableTransparency ( bool  v) [inline]

Enables or disables transparency.

Definition at line 139 of file CSetOfTriangles.h.

References mrpt::opengl::CRenderizableDisplayList::notifyChange().

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

Gets the ending iterator to this object.

Definition at line 181 of file CSetOfTriangles.h.

void mrpt::opengl::CSetOfTriangles::getPolygons ( std::vector< mrpt::math::TPolygon3D > &  polys) const

Gets the polygon cache.

See also:
insertTriangles
virtual const mrpt::utils::TRuntimeClassId* mrpt::opengl::CSetOfTriangles::GetRuntimeClass ( ) const [virtual]

Returns information about the class of an object in runtime.

Reimplemented from mrpt::opengl::CRenderizableDisplayList.

void mrpt::opengl::CSetOfTriangles::getTriangle ( size_t  idx,
TTriangle t 
) const [inline]

Gets the triangle in a given position.

Definition at line 107 of file CSetOfTriangles.h.

References ASSERT_.

size_t mrpt::opengl::CSetOfTriangles::getTrianglesCount ( ) const [inline]

Get triangle count.

Definition at line 103 of file CSetOfTriangles.h.

void mrpt::opengl::CSetOfTriangles::insertTriangle ( const TTriangle t) [inline]

Inserts a triangle into the set.

Definition at line 111 of file CSetOfTriangles.h.

References mrpt::opengl::CRenderizableDisplayList::notifyChange().

template<class InputIterator >
void mrpt::opengl::CSetOfTriangles::insertTriangles ( const InputIterator &  begin,
const InputIterator &  end 
) [inline]

Inserts a set of triangles, bounded by iterators, into this set.

See also:
insertTriangle

Definition at line 116 of file CSetOfTriangles.h.

References begin(), end(), and mrpt::opengl::CRenderizableDisplayList::notifyChange().

void mrpt::opengl::CSetOfTriangles::insertTriangles ( const CSetOfTrianglesPtr p) [inline]

Inserts an existing CSetOfTriangles into this one.

Definition at line 124 of file CSetOfTriangles.h.

References mrpt::opengl::CRenderizableDisplayList::notifyChange().

template<class CONTAINER >
void mrpt::opengl::CSetOfTriangles::insertTriangles ( const CONTAINER &  c) [inline]

Inserts a set of triangles, given in a container of either TTriangle's or TPolygon3D.

See also:
insertTriangle

Definition at line 167 of file CSetOfTriangles.h.

References mrpt::opengl::CRenderizableDisplayList::notifyChange().

const_reverse_iterator mrpt::opengl::CSetOfTriangles::rbegin ( ) const [inline]

Gets the reverse beginning iterator to this object, which points to the last triangle.

Definition at line 187 of file CSetOfTriangles.h.

const_reverse_iterator mrpt::opengl::CSetOfTriangles::rend ( ) const [inline]

Gets the reverse ending iterator to this object, which points to the beginning of the actual set.

Definition at line 193 of file CSetOfTriangles.h.

void mrpt::opengl::CSetOfTriangles::render_dl ( ) const [virtual]
void mrpt::opengl::CSetOfTriangles::reserve ( size_t  t) [inline]

Reserves memory for certain number of triangles, avoiding multiple memory allocation calls.

Definition at line 133 of file CSetOfTriangles.h.

References mrpt::opengl::CRenderizableDisplayList::notifyChange().

virtual CRenderizable& mrpt::opengl::CSetOfTriangles::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)

Returns:
a ref to this

Reimplemented from mrpt::opengl::CRenderizableDisplayList.

virtual CRenderizable& mrpt::opengl::CSetOfTriangles::setColor ( const mrpt::utils::TColorf c) [virtual]

Changes the default object color.

Returns:
a ref to this

Reimplemented from mrpt::opengl::CRenderizableDisplayList.

virtual CRenderizable& mrpt::opengl::CSetOfTriangles::setColorA ( const double  a) [virtual]

Color components in the range [0,1].

Returns:
a ref to this

Reimplemented from mrpt::opengl::CRenderizableDisplayList.

virtual CRenderizable& mrpt::opengl::CSetOfTriangles::setColorB ( const double  b) [virtual]

Color components in the range [0,1].

Returns:
a ref to this

Reimplemented from mrpt::opengl::CRenderizableDisplayList.

virtual CRenderizable& mrpt::opengl::CSetOfTriangles::setColorG ( const double  g) [virtual]

Color components in the range [0,1].

Returns:
a ref to this

Reimplemented from mrpt::opengl::CRenderizableDisplayList.

virtual CRenderizable& mrpt::opengl::CSetOfTriangles::setColorR ( const double  r) [virtual]

Color components in the range [0,1].

Returns:
a ref to this

Reimplemented from mrpt::opengl::CRenderizableDisplayList.

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

Ray tracing.

Reimplemented from mrpt::opengl::CRenderizable.

void mrpt::opengl::CSetOfTriangles::updatePolygons ( ) const

Polygon cache updating.


Member Data Documentation

Definition at line 49 of file CSetOfTriangles.h.

Definition at line 49 of file CSetOfTriangles.h.

Definition at line 49 of file CSetOfTriangles.h.

Transparency enabling.

Definition at line 82 of file CSetOfTriangles.h.

List of triangles.

See also:
TTriangle

Definition at line 78 of file CSetOfTriangles.h.

Mutable variable used to check whether polygons need to be recalculated.

Definition at line 86 of file CSetOfTriangles.h.

Polygon cache.

Definition at line 90 of file CSetOfTriangles.h.




Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN: at Sat Mar 26 06:16:28 UTC 2011