A set of colored triangles.
This class can be used to draw any solid, arbitrarily complex object (without textures).
Definition at line 47 of file CSetOfTriangles.h.
#include <mrpt/opengl/CSetOfTriangles.h>
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 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]. | |
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< TTriangle > | m_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::CObject * | duplicate () const |
Returns a copy of the object, indepently of its class. | |
static mrpt::utils::CObject * | CreateObject () |
static CSetOfTrianglesPtr | Create () |
typedef std::vector<TTriangle>::const_iterator mrpt::opengl::CSetOfTriangles::const_iterator |
Const iterator type.
Definition at line 68 of file CSetOfTriangles.h.
typedef std::vector<TTriangle>::const_reverse_iterator mrpt::opengl::CSetOfTriangles::const_reverse_iterator |
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.
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.
static const mrpt::utils::TRuntimeClassId* mrpt::opengl::CSetOfTriangles::_GetBaseClass | ( | ) | [static, protected] |
Reimplemented from mrpt::opengl::CRenderizableDisplayList.
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.
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().
void mrpt::opengl::CSetOfTriangles::insertTriangles | ( | const InputIterator & | begin, |
const InputIterator & | end | ||
) | [inline] |
Inserts a set of triangles, bounded by iterators, into this set.
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().
void mrpt::opengl::CSetOfTriangles::insertTriangles | ( | const CONTAINER & | c ) | [inline] |
Inserts a set of triangles, given in a container of either TTriangle's or TPolygon3D.
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] |
Render.
Implements mrpt::opengl::CRenderizableDisplayList.
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)
Reimplemented from mrpt::opengl::CRenderizableDisplayList.
virtual CRenderizable& mrpt::opengl::CSetOfTriangles::setColor | ( | const mrpt::utils::TColorf & | c ) | [virtual] |
Changes the default object color.
Reimplemented from mrpt::opengl::CRenderizableDisplayList.
virtual CRenderizable& mrpt::opengl::CSetOfTriangles::setColorA | ( | const double | a ) | [virtual] |
Color components in the range [0,1].
Reimplemented from mrpt::opengl::CRenderizableDisplayList.
virtual CRenderizable& mrpt::opengl::CSetOfTriangles::setColorB | ( | const double | b ) | [virtual] |
Color components in the range [0,1].
Reimplemented from mrpt::opengl::CRenderizableDisplayList.
virtual CRenderizable& mrpt::opengl::CSetOfTriangles::setColorG | ( | const double | g ) | [virtual] |
Color components in the range [0,1].
Reimplemented from mrpt::opengl::CRenderizableDisplayList.
virtual CRenderizable& mrpt::opengl::CSetOfTriangles::setColorR | ( | const double | r ) | [virtual] |
Color components in the range [0,1].
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.
mrpt::utils::CLASSINIT mrpt::opengl::CSetOfTriangles::_init_CSetOfTriangles [static, protected] |
Definition at line 49 of file CSetOfTriangles.h.
Definition at line 49 of file CSetOfTriangles.h.
const mrpt::utils::TRuntimeClassId* mrpt::opengl::CSetOfTriangles::classinfo [static] |
Definition at line 49 of file CSetOfTriangles.h.
bool mrpt::opengl::CSetOfTriangles::m_enableTransparency [protected] |
Transparency enabling.
Definition at line 82 of file CSetOfTriangles.h.
std::vector<TTriangle> mrpt::opengl::CSetOfTriangles::m_triangles [protected] |
bool mrpt::opengl::CSetOfTriangles::polygonsUpToDate [mutable, protected] |
Mutable variable used to check whether polygons need to be recalculated.
Definition at line 86 of file CSetOfTriangles.h.
std::vector<mrpt::math::TPolygonWithPlane> mrpt::opengl::CSetOfTriangles::tmpPolygons [mutable, protected] |
Polygon cache.
Definition at line 90 of file CSetOfTriangles.h.
Page generated by Doxygen 1.7.2 for MRPT 0.9.4 SVN: at Mon Jan 10 22:46:17 UTC 2011 |