MRPT logo

mrpt::opengl::CSetOfTriangles Class Reference

A set of colored triangles. More...

#include <mrpt/opengl/CSetOfTriangles.h>

Inheritance diagram for mrpt::opengl::CSetOfTriangles:

mrpt::opengl::CRenderizable mrpt::utils::CSerializable

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

Const reverse iterator type.

Definition at line 66 of file CSetOfTriangles.h.


Constructor & Destructor Documentation

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

Constructor.

Definition at line 196 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 204 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 172 of file CSetOfTriangles.h.

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

Clear this object.

Definition at line 93 of file CSetOfTriangles.h.

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

Enables or disables transparency.

Definition at line 132 of file CSetOfTriangles.h.

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

Gets the ending iterator to this object.

Definition at line 178 of file CSetOfTriangles.h.

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

Gets the polygon cache.

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

Gets the triangle in a given position.

Definition at line 101 of file CSetOfTriangles.h.

References ASSERT_.

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

Get triangle count.

Definition at line 97 of file CSetOfTriangles.h.

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

Inserts a triangle into the set.

Definition at line 105 of file CSetOfTriangles.h.

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

Inserts an existing CSetOfTriangles into this one.

Definition at line 117 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 110 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 184 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 190 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 125 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 76 of file CSetOfTriangles.h.

List of triangles.

See also:
TTriangle

Definition at line 72 of file CSetOfTriangles.h.

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

Definition at line 80 of file CSetOfTriangles.h.

Polygon cache.

Definition at line 84 of file CSetOfTriangles.h.




Page generated by Doxygen 1.5.7.1 for MRPT 0.7.1 SVN: at Mon Aug 17 22:58:25 EDT 2009