Main MRPT website > C++ reference
MRPT logo

mrpt::opengl::CSetOfTriangles Class Reference

A set of colored triangles. More...

#include <mrpt/opengl/CSetOfTriangles.h>

Inheritance diagram for mrpt::opengl::CSetOfTriangles:
Inheritance graph
[legend]
Collaboration diagram for mrpt::opengl::CSetOfTriangles:
Collaboration 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 void setColor (double R, double G, double B, double A)
 Changes the color to all the vertices in each triangle of the set.
virtual void setColor (const mrpt::utils::TColorf &c)
 Changes the color to all the vertices in each triangle of the set.
virtual void setColorR (const double r)
 Changes the red color component to all the vertices in each triangle of the set.
virtual void setColorG (const double g)
 Changes the green color component to all the vertices in each triangle of the set.
virtual void setColorB (const double b)
 Changes the blue color component to all the vertices in each triangle of the set.
virtual void setColorA (const double a)
 Changes the alpha color component to all the vertices in each triangle of the set.
void render () 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.

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.


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.


Constructor & Destructor Documentation

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

Constructor.

Definition at line 213 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 221 of file CSetOfTriangles.h.


Member Function Documentation

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

Gets the beginning iterator to this object.

Definition at line 189 of file CSetOfTriangles.h.

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

Clear this object.

Definition at line 99 of file CSetOfTriangles.h.

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

Enables or disables transparency.

Definition at line 138 of file CSetOfTriangles.h.

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

Gets the ending iterator to this object.

Definition at line 195 of file CSetOfTriangles.h.

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

Gets the polygon cache.

See also:
insertTriangles
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.

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 182 of file CSetOfTriangles.h.

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

Inserts an existing CSetOfTriangles into this one.

Definition at line 123 of file CSetOfTriangles.h.

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.

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 201 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 207 of file CSetOfTriangles.h.

void mrpt::opengl::CSetOfTriangles::render (  )  const [virtual]

Render.

Implements mrpt::opengl::CRenderizable.

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

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

Definition at line 131 of file CSetOfTriangles.h.

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

Changes the color to all the vertices in each triangle of the set.

Reimplemented from mrpt::opengl::CRenderizable.

virtual void mrpt::opengl::CSetOfTriangles::setColor ( double  R,
double  G,
double  B,
double  A 
) [virtual]

Changes the color to all the vertices in each triangle of the set.

Reimplemented from mrpt::opengl::CRenderizable.

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

Changes the alpha color component to all the vertices in each triangle of the set.

Reimplemented from mrpt::opengl::CRenderizable.

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

Changes the blue color component to all the vertices in each triangle of the set.

Reimplemented from mrpt::opengl::CRenderizable.

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

Changes the green color component to all the vertices in each triangle of the set.

Reimplemented from mrpt::opengl::CRenderizable.

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

Changes the red color component to all the vertices in each triangle of the set.

Reimplemented from mrpt::opengl::CRenderizable.

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

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.

 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