Main MRPT website > C++ reference for MRPT 1.4.0
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
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 29 of file CSetOfTriangles.h.

#include <mrpt/opengl/CSetOfTriangles.h>

Inheritance diagram for mrpt::opengl::CSetOfTriangles:
Inheritance graph

Classes

struct  TTriangle
 Triangle definition. More...
 

Public Types

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

Public Member Functions

void * operator new (size_t size)
 
void * operator new[] (size_t size)
 
void operator delete (void *ptr) throw ()
 
void operator delete[] (void *ptr) throw ()
 
void operator delete (void *memory, void *ptr) throw ()
 
void * operator new (size_t size, const std::nothrow_t &) throw ()
 
void operator delete (void *ptr, const std::nothrow_t &) throw ()
 
void updatePolygons () const
 Polygon cache updating. More...
 
void clearTriangles ()
 Clear this object. More...
 
size_t getTrianglesCount () const
 Get triangle count. More...
 
void getTriangle (size_t idx, TTriangle &t) const
 Gets the triangle in a given position. More...
 
void insertTriangle (const TTriangle &t)
 Inserts a triangle into the set. More...
 
template<class InputIterator >
void insertTriangles (const InputIterator &begin, const InputIterator &end)
 Inserts a set of triangles, bounded by iterators, into this set. More...
 
void insertTriangles (const CSetOfTrianglesPtr &p)
 Inserts an existing CSetOfTriangles into this one. More...
 
void reserve (size_t t)
 Reserves memory for certain number of triangles, avoiding multiple memory allocation calls. More...
 
void enableTransparency (bool v)
 Enables or disables transparency. More...
 
CRenderizablesetColor_u8 (const mrpt::utils::TColor &c) MRPT_OVERRIDE
 
CRenderizablesetColorR_u8 (const uint8_t r) MRPT_OVERRIDE
 
CRenderizablesetColorG_u8 (const uint8_t g) MRPT_OVERRIDE
 
CRenderizablesetColorB_u8 (const uint8_t b) MRPT_OVERRIDE
 
CRenderizablesetColorA_u8 (const uint8_t a) MRPT_OVERRIDE
 
void render_dl () const MRPT_OVERRIDE
 Render. More...
 
bool traceRay (const mrpt::poses::CPose3D &o, double &dist) const MRPT_OVERRIDE
 Ray tracing. More...
 
void getPolygons (std::vector< mrpt::math::TPolygon3D > &polys) const
 Gets the polygon cache. More...
 
template<class CONTAINER >
void insertTriangles (const CONTAINER &c)
 Inserts a set of triangles, given in a container of either TTriangle's or TPolygon3D. More...
 
const_iterator begin () const
 Gets the beginning iterator to this object. More...
 
const_iterator end () const
 Gets the ending iterator to this object. More...
 
const_reverse_iterator rbegin () const
 Gets the reverse beginning iterator to this object, which points to the last triangle. More...
 
const_reverse_iterator rend () const
 Gets the reverse ending iterator to this object, which points to the beginning of the actual set. More...
 
void getBoundingBox (mrpt::math::TPoint3D &bb_min, mrpt::math::TPoint3D &bb_max) const MRPT_OVERRIDE
 Evaluates the bounding box of this object (including possible children) in the coordinate frame of the object parent. More...
 
CRenderizableDisplayListclone () const
 Interface for the stlplus smart pointer class. More...
 
void render () const MRPT_OVERRIDE
 Render the object, regenerating the display list if needed, otherwise just calling it. More...
 
virtual mxArraywriteToMatlab () const
 Introduces a pure virtual method responsible for writing to a mxArray Matlab object, typically a MATLAB struct whose contents are documented in each derived class. More...
 
mrpt::utils::CObjectPtr duplicateGetSmartPtr () const
 Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer). More...
 

Static Public Member Functions

static void * operator new (size_t size, void *ptr)
 
static void renderTextBitmap (const char *str, void *fontStyle)
 This method is safe for calling from within ::render() methods. More...
 
static void renderTextBitmap (int screen_x, int screen_y, const std::string &str, float color_r=1, float color_g=1, float color_b=1, mrpt::opengl::TOpenGLFont font=mrpt::opengl::MRPT_GLUT_BITMAP_TIMES_ROMAN_24)
 Render a text message in the current rendering context, creating a glViewport in the way (do not call within ::render() methods) More...
 
static int textBitmapWidth (const std::string &str, mrpt::opengl::TOpenGLFont font=mrpt::opengl::MRPT_GLUT_BITMAP_TIMES_ROMAN_24)
 Return the exact width in pixels for a given string, as will be rendered by renderTextBitmap(). More...
 

Static Public Attributes

static const mrpt::utils::TRuntimeClassId classCObject
 

Protected Member Functions

void writeToStreamRender (utils::CStream &out) const
 
CSerializable virtual methods
void writeToStream (mrpt::utils::CStream &out, int *getVersion) const MRPT_OVERRIDE
 Introduces a pure virtual method responsible for writing to a CStream. More...
 
void readFromStream (mrpt::utils::CStream &in, int version) MRPT_OVERRIDE
 Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori. More...
 

Static Protected Member Functions

static void checkOpenGLError ()
 Checks glGetError and throws an exception if an error situation is found. More...
 
static unsigned int getNewTextureNumber ()
 Returns the lowest next free texture name (avoid using OpenGL's own function since we may call them from different threads and seem it's not cool). More...
 
static void releaseTextureName (unsigned int i)
 

Protected Attributes

std::vector< TTrianglem_triangles
 List of triangles. More...
 
bool m_enableTransparency
 Transparency enabling. More...
 
bool polygonsUpToDate
 Mutable variable used to check whether polygons need to be recalculated. More...
 
std::vector< mrpt::math::TPolygonWithPlanetmpPolygons
 Polygon cache. More...
 
std::string m_name
 
bool m_show_name
 
mrpt::utils::TColor m_color
 Color components in the range [0,255]. More...
 
mrpt::poses::CPose3D m_pose
 6D pose wrt the parent coordinate reference. This class automatically holds the cached 3x3 rotation matrix for quick load into opengl stack. More...
 
float m_scale_x
 
float m_scale_y
 
float m_scale_z
 Scale components to apply to the object (default=1) More...
 
bool m_visible
 Is the object visible? (default=true) More...
 

Private Member Functions

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

Private Attributes

unsigned int m_dl
 Display list ID, for derived classes that want to use it (it's automatically deleted and freed on destruction of this base class). More...
 
bool m_dl_recreate
 If using display lists, this is true when the list must be updated (the object changes, it's the first rendering, etc...). More...
 

RTTI stuff


typedef CSetOfTrianglesPtr SmartPtr
 
static mrpt::utils::CLASSINIT _init_CSetOfTriangles
 
static mrpt::utils::TRuntimeClassId classCSetOfTriangles
 
static const mrpt::utils::TRuntimeClassIdclassinfo
 
static const mrpt::utils::TRuntimeClassId_GetBaseClass ()
 
virtual const mrpt::utils::TRuntimeClassIdGetRuntimeClass () const
 Returns information about the class of an object in runtime. More...
 
virtual mrpt::utils::CObjectduplicate () const MRPT_OVERRIDE
 Returns a copy of the object, indepently of its class. More...
 
static mrpt::utils::CObjectCreateObject ()
 
static CSetOfTrianglesPtr Create ()
 

Member Typedef Documentation

◆ const_iterator

Const iterator type.

Definition at line 50 of file CSetOfTriangles.h.

◆ const_reverse_iterator

Const reverse iterator type.

Definition at line 54 of file CSetOfTriangles.h.

◆ SmartPtr

typedef CSetOfTrianglesPtr mrpt::opengl::CSetOfTriangles::SmartPtr

A typedef for the associated smart pointer

Definition at line 31 of file CSetOfTriangles.h.

Constructor & Destructor Documentation

◆ CSetOfTriangles()

mrpt::opengl::CSetOfTriangles::CSetOfTriangles ( bool  enableTransparency = false)
inlineprivate

Constructor.

Definition at line 179 of file CSetOfTriangles.h.

◆ ~CSetOfTriangles()

virtual mrpt::opengl::CSetOfTriangles::~CSetOfTriangles ( )
inlineprivatevirtual

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

Definition at line 187 of file CSetOfTriangles.h.

Member Function Documentation

◆ _GetBaseClass()

static const mrpt::utils::TRuntimeClassId* mrpt::opengl::CSetOfTriangles::_GetBaseClass ( )
staticprotected

◆ begin()

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

Gets the beginning iterator to this object.

Definition at line 151 of file CSetOfTriangles.h.

◆ checkOpenGLError()

static void mrpt::opengl::CRenderizable::checkOpenGLError ( )
staticprotectedinherited

Checks glGetError and throws an exception if an error situation is found.

◆ clearTriangles()

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

Clear this object.

Definition at line 81 of file CSetOfTriangles.h.

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

◆ clone()

CRenderizableDisplayList* mrpt::opengl::CRenderizableDisplayList::clone ( ) const
inlineinherited

Interface for the stlplus smart pointer class.

Definition at line 71 of file CRenderizableDisplayList.h.

◆ Create()

static CSetOfTrianglesPtr mrpt::opengl::CSetOfTriangles::Create ( )
static

◆ CreateObject()

static mrpt::utils::CObject* mrpt::opengl::CSetOfTriangles::CreateObject ( )
static

◆ duplicate()

virtual mrpt::utils::CObject* mrpt::opengl::CSetOfTriangles::duplicate ( ) const
virtual

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

Implements mrpt::utils::CObject.

◆ duplicateGetSmartPtr()

mrpt::utils::CObjectPtr mrpt::utils::CObject::duplicateGetSmartPtr ( ) const
inlineinherited

Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer).

Definition at line 136 of file CObject.h.

◆ enableTransparency()

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

Enables or disables transparency.

Definition at line 116 of file CSetOfTriangles.h.

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

◆ end()

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

Gets the ending iterator to this object.

Definition at line 157 of file CSetOfTriangles.h.

◆ getBoundingBox()

void mrpt::opengl::CSetOfTriangles::getBoundingBox ( mrpt::math::TPoint3D bb_min,
mrpt::math::TPoint3D bb_max 
) const
virtual

Evaluates the bounding box of this object (including possible children) in the coordinate frame of the object parent.

Implements mrpt::opengl::CRenderizable.

◆ getNewTextureNumber()

static unsigned int mrpt::opengl::CRenderizable::getNewTextureNumber ( )
staticprotectedinherited

Returns the lowest next free texture name (avoid using OpenGL's own function since we may call them from different threads and seem it's not cool).


◆ getPolygons()

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

Gets the polygon cache.

See also
insertTriangles

◆ getPose()

mrpt::math::TPose3D mrpt::opengl::CRenderizable::getPose ( ) const
inherited

Returns the 3D pose of the object as TPose3D.

◆ getPoseRef()

const mrpt::poses::CPose3D& mrpt::opengl::CRenderizable::getPoseRef ( ) const
inlineinherited

Returns a const ref to the 3D pose of the object as mrpt::poses::CPose3D (which explicitly contains the 3x3 rotation matrix)

Definition at line 79 of file CRenderizable.h.

◆ GetRuntimeClass()

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.

◆ getTriangle()

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

Gets the triangle in a given position.

Definition at line 89 of file CSetOfTriangles.h.

References ASSERT_, and t().

◆ getTrianglesCount()

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

Get triangle count.

Definition at line 85 of file CSetOfTriangles.h.

◆ insertTriangle()

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

Inserts a triangle into the set.

Definition at line 93 of file CSetOfTriangles.h.

References mrpt::opengl::CRenderizableDisplayList::notifyChange(), and t().

◆ insertTriangles() [1/3]

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

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

◆ insertTriangles() [2/3]

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

Inserts an existing CSetOfTriangles into this one.

◆ insertTriangles() [3/3]

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

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

◆ isVisible()

bool mrpt::opengl::CRenderizable::isVisible ( ) const
inlineinherited

Is the object visible?

See also
setVisibility

Definition at line 66 of file CRenderizable.h.

◆ notifyChange()

EIGEN_STRONG_INLINE void mrpt::opengl::CRenderizableDisplayList::notifyChange ( ) const
inlineprotectedinherited

Must be called to notify that the object has changed (so, the display list must be updated)

Definition at line 49 of file CRenderizableDisplayList.h.

Referenced by mrpt::opengl::CGeneralizedCylinder::addVisibleSectionAtEnd(), mrpt::opengl::CGeneralizedCylinder::addVisibleSectionAtStart(), mrpt::opengl::CMeshFast::adjustGridToImageAR(), mrpt::opengl::CMesh::adjustGridToImageAR(), mrpt::opengl::CSetOfLines::appendLine(), mrpt::opengl::CSetOfLines::appendLines(), mrpt::opengl::CSetOfLines::begin(), mrpt::opengl::CSetOfLines::clear(), mrpt::opengl::CVectorField2D::clear(), mrpt::opengl::CVectorField3D::clear(), mrpt::opengl::CSetOfTexturedTriangles::clearTriangles(), clearTriangles(), mrpt::opengl::COpenGLStandardObject::enable(), mrpt::opengl::CSimpleLine::enableAntiAliasing(), mrpt::opengl::CGridPlaneXZ::enableAntiAliasing(), mrpt::opengl::CGridPlaneXY::enableAntiAliasing(), mrpt::opengl::CMesh3D::enableAntiAliasing(), mrpt::opengl::CVectorField2D::enableAntiAliasing(), mrpt::opengl::CSetOfLines::enableAntiAliasing(), mrpt::opengl::CVectorField3D::enableAntiAliasing(), mrpt::opengl::CBox::enableBoxBorder(), mrpt::opengl::CVectorField3D::enableColorFromModule(), mrpt::opengl::CMesh::enableColorFromZ(), mrpt::opengl::CMeshFast::enableColorFromZ(), mrpt::opengl::COctoMapVoxels::enableCubeTransparency(), mrpt::opengl::C3DSScene::enableExtraAmbientLight(), mrpt::opengl::CMesh3D::enableFaceNormals(), mrpt::opengl::COctoMapVoxels::enableLights(), mrpt::opengl::CPlanarLaserScan::enableLine(), mrpt::opengl::CPlanarLaserScan::enablePoints(), mrpt::opengl::CSphere::enableRadiusIndependentOfEyeDistance(), mrpt::opengl::CMesh3D::enableShowEdges(), mrpt::opengl::CMesh3D::enableShowFaces(), mrpt::opengl::CVectorField3D::enableShowPoints(), mrpt::opengl::CMesh3D::enableShowVertices(), mrpt::opengl::CPlanarLaserScan::enableSurface(), mrpt::opengl::CAxis::enableTickMarks(), mrpt::opengl::CMesh3D::enableTransparency(), mrpt::opengl::CMesh::enableTransparency(), mrpt::opengl::CMeshFast::enableTransparency(), enableTransparency(), mrpt::opengl::CAngularObservationMesh::enableTransparency(), mrpt::opengl::CMesh::enableWireFrame(), mrpt::opengl::CSetOfLines::end(), mrpt::opengl::COctoMapVoxels::getGridCubeRef(), mrpt::opengl::CSetOfTexturedTriangles::getTriangle(), mrpt::opengl::COctoMapVoxels::getVoxel(), mrpt::opengl::COctoMapVoxels::getVoxelRef(), mrpt::opengl::CSetOfTexturedTriangles::insertTriangle(), insertTriangle(), insertTriangles(), mrpt::opengl::COctoMapVoxels::push_back_GridCube(), mrpt::opengl::COctoMapVoxels::push_back_Voxel(), reserve(), mrpt::opengl::CSetOfLines::reserve(), mrpt::opengl::COctoMapVoxels::reserveVoxels(), mrpt::opengl::CSetOfLines::resize(), mrpt::opengl::CVectorField2D::resize(), mrpt::opengl::CVectorField3D::resize(), mrpt::opengl::COctoMapVoxels::resizeGridCubes(), mrpt::opengl::COctoMapVoxels::resizeVoxels(), mrpt::opengl::COctoMapVoxels::resizeVoxelSets(), mrpt::opengl::CGeneralizedCylinder::setAllSectionsInvisible(), mrpt::opengl::CGeneralizedCylinder::setAllSectionsVisible(), mrpt::opengl::CArrow::setArrowEnds(), mrpt::opengl::CArrow::setArrowYawPitchRoll(), mrpt::opengl::CGeneralizedCylinder::setAxis(), mrpt::opengl::CAxis::setAxisLimits(), mrpt::opengl::CBox::setBoxBorderColor(), mrpt::opengl::CGeneralizedCylinder::setClosed(), mrpt::opengl::CGeneralizedEllipsoidTemplate< 3 >::setCovMatrixAndMean(), mrpt::opengl::CDisk::setDiskRadius(), mrpt::opengl::COpenGLStandardObject::setFlags(), mrpt::opengl::CText3D::setFont(), mrpt::opengl::CGeneralizedCylinder::setGeneratrix(), mrpt::opengl::CVectorField2D::setGridCenterAndCellSize(), mrpt::opengl::CGridPlaneXY::setGridFrequency(), mrpt::opengl::CGridPlaneXZ::setGridFrequency(), mrpt::opengl::CMesh::setGridLimits(), mrpt::opengl::CMeshFast::setGridLimits(), mrpt::opengl::CVectorField2D::setGridLimits(), mrpt::opengl::COctoMapVoxels::setGridLinesColor(), mrpt::opengl::COctoMapVoxels::setGridLinesWidth(), mrpt::opengl::CCylinder::setHasBases(), mrpt::opengl::CArrow::setHeadRatio(), mrpt::opengl::CCylinder::setHeight(), mrpt::opengl::CArrow::setLargeRadius(), mrpt::opengl::CSetOfLines::setLineByIndex(), mrpt::opengl::CSimpleLine::setLineCoords(), mrpt::opengl::CSimpleLine::setLineWidth(), mrpt::opengl::CGridPlaneXZ::setLineWidth(), mrpt::opengl::CGridPlaneXY::setLineWidth(), mrpt::opengl::CSetOfLines::setLineWidth(), mrpt::opengl::CAxis::setLineWidth(), mrpt::opengl::CFrustum::setLineWidth(), mrpt::opengl::CBox::setLineWidth(), mrpt::opengl::CVectorField2D::setLineWidth(), mrpt::opengl::CGeneralizedEllipsoidTemplate< 3 >::setLineWidth(), mrpt::opengl::CVectorField3D::setLineWidth(), mrpt::opengl::CPolyhedron::setLineWidth(), mrpt::opengl::CVectorField3D::setMaxSpeedForColor(), mrpt::opengl::CVectorField3D::setMotionFieldColormap(), mrpt::opengl::COpenGLStandardObject::setNormal(), mrpt::opengl::CSphere::setNumberDivsLatitude(), mrpt::opengl::CSphere::setNumberDivsLongitude(), mrpt::opengl::CGeneralizedEllipsoidTemplate< 3 >::setNumberOfSegments(), mrpt::opengl::CFrustum::setPlaneColor(), mrpt::opengl::CTexturedPlane::setPlaneCorners(), mrpt::opengl::CGridPlaneXY::setPlaneLimits(), mrpt::opengl::CGridPlaneXZ::setPlaneLimits(), mrpt::opengl::CGridPlaneXZ::setPlaneYcoord(), mrpt::opengl::CGridPlaneXY::setPlaneZcoord(), mrpt::opengl::CVectorField2D::setPointColor(), mrpt::opengl::CVectorField3D::setPointColor(), mrpt::opengl::CVectorField3D::setPointCoordinates(), mrpt::opengl::CVectorField2D::setPointSize(), mrpt::opengl::CVectorField3D::setPointSize(), mrpt::opengl::CGeneralizedEllipsoidTemplate< 3 >::setQuantiles(), mrpt::opengl::CCylinder::setRadii(), mrpt::opengl::CSphere::setRadius(), mrpt::opengl::CCylinder::setRadius(), mrpt::opengl::CPlanarLaserScan::setScan(), mrpt::opengl::CCylinder::setSlicesCount(), mrpt::opengl::CArrow::setSmallRadius(), mrpt::opengl::CCylinder::setStacksCount(), mrpt::opengl::CText3D::setString(), mrpt::opengl::CText3D::setTextKerning(), mrpt::opengl::CText3D::setTextSpacing(), mrpt::opengl::CText3D::setTextStyle(), mrpt::opengl::CTexturedPlane::setTextureCornerCoords(), mrpt::opengl::CVectorField2D::setVectorField(), mrpt::opengl::CVectorField3D::setVectorField(), mrpt::opengl::CVectorField2D::setVectorFieldColor(), mrpt::opengl::CVectorField3D::setVectorFieldColor(), mrpt::opengl::CGeneralizedCylinder::setVisibleSections(), mrpt::opengl::COctoMapVoxels::setVisualizationMode(), mrpt::opengl::COctoMapVoxels::setVoxelAsPointsSize(), mrpt::opengl::CBox::setWireframe(), mrpt::opengl::CAngularObservationMesh::setWireframe(), mrpt::opengl::CPolyhedron::setWireframe(), mrpt::opengl::CMeshFast::setXBounds(), mrpt::opengl::CMesh::setXBounds(), mrpt::opengl::CMeshFast::setXMax(), mrpt::opengl::CMesh::setXMax(), mrpt::opengl::CMeshFast::setXMin(), mrpt::opengl::CMesh::setXMin(), mrpt::opengl::CMeshFast::setYBounds(), mrpt::opengl::CMesh::setYBounds(), mrpt::opengl::CMeshFast::setYMax(), mrpt::opengl::CMesh::setYMax(), mrpt::opengl::CMeshFast::setYMin(), mrpt::opengl::CMesh::setYMin(), mrpt::opengl::COctoMapVoxels::showGridLines(), mrpt::opengl::COctoMapVoxels::showVoxels(), mrpt::opengl::COctoMapVoxels::showVoxelsAsPoints(), and mrpt::opengl::CGeneralizedEllipsoidTemplate< 3 >::thisclass_readFromStream().

◆ operator delete() [1/3]

void mrpt::opengl::CSetOfTriangles::operator delete ( void *  memory,
void *  ptr 
)
throw (
)
inline

Definition at line 31 of file CSetOfTriangles.h.

◆ operator delete() [2/3]

void mrpt::opengl::CSetOfTriangles::operator delete ( void *  ptr)
throw (
)
inline

Definition at line 31 of file CSetOfTriangles.h.

◆ operator delete() [3/3]

void mrpt::opengl::CSetOfTriangles::operator delete ( void *  ptr,
const std::nothrow_t &   
)
throw (
)
inline

Definition at line 31 of file CSetOfTriangles.h.

◆ operator delete[]()

void mrpt::opengl::CSetOfTriangles::operator delete[] ( void *  ptr)
throw (
)
inline

Definition at line 31 of file CSetOfTriangles.h.

◆ operator new() [1/3]

void* mrpt::opengl::CSetOfTriangles::operator new ( size_t  size)
inline

Definition at line 31 of file CSetOfTriangles.h.

◆ operator new() [2/3]

void* mrpt::opengl::CSetOfTriangles::operator new ( size_t  size,
const std::nothrow_t &   
)
throw (
)
inline

Definition at line 31 of file CSetOfTriangles.h.

◆ operator new() [3/3]

static void* mrpt::opengl::CSetOfTriangles::operator new ( size_t  size,
void *  ptr 
)
inlinestatic

Definition at line 31 of file CSetOfTriangles.h.

◆ operator new[]()

void* mrpt::opengl::CSetOfTriangles::operator new[] ( size_t  size)
inline

Definition at line 31 of file CSetOfTriangles.h.

◆ rbegin()

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

◆ readFromStream()

void mrpt::opengl::CSetOfTriangles::readFromStream ( mrpt::utils::CStream in,
int  version 
)
protectedvirtual

Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori.

Parameters
inThe input binary stream where the object data must read from.
versionThe version of the object stored in the stream: use this version number in your code to know how to read the incoming data.
Exceptions
std::exceptionOn any error, see CStream::ReadBuffer
See also
CStream

Implements mrpt::utils::CSerializable.

◆ readFromStreamRender()

void mrpt::opengl::CRenderizableDisplayList::readFromStreamRender ( mrpt::utils::CStream in)
inlineprotectedinherited

◆ releaseTextureName()

static void mrpt::opengl::CRenderizable::releaseTextureName ( unsigned int  i)
staticprotectedinherited

◆ rend()

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

◆ render()

void mrpt::opengl::CRenderizableDisplayList::render ( ) const
virtualinherited

Render the object, regenerating the display list if needed, otherwise just calling it.

Implements mrpt::opengl::CRenderizable.

◆ render_dl()

void mrpt::opengl::CSetOfTriangles::render_dl ( ) const
virtual

◆ renderTextBitmap() [1/2]

static void mrpt::opengl::CRenderizable::renderTextBitmap ( const char *  str,
void *  fontStyle 
)
staticinherited

This method is safe for calling from within ::render() methods.

See also
renderTextBitmap, mrpt::opengl::gl_utils

◆ renderTextBitmap() [2/2]

static void mrpt::opengl::CRenderizable::renderTextBitmap ( int  screen_x,
int  screen_y,
const std::string &  str,
float  color_r = 1,
float  color_g = 1,
float  color_b = 1,
mrpt::opengl::TOpenGLFont  font = mrpt::opengl::MRPT_GLUT_BITMAP_TIMES_ROMAN_24 
)
staticinherited

Render a text message in the current rendering context, creating a glViewport in the way (do not call within ::render() methods)

  • Coordinates (x,y) are 2D pixels, starting at bottom-left of the viewport. Negative numbers will wrap to the opposite side of the viewport (e.g. x=-10 means 10px fromt the right).
  • The text color is defined by (color_r,color_g,color_b), each float numbers in the range [0,1].
    See also
    renderTextBitmap, textBitmapWidth, mrpt::opengl::gl_utils

◆ reserve()

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

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

Definition at line 110 of file CSetOfTriangles.h.

References mrpt::opengl::CRenderizableDisplayList::notifyChange(), and t().

◆ setColor() [1/2]

CRenderizable& mrpt::opengl::CRenderizable::setColor ( const mrpt::utils::TColorf c)
inlineinherited
Parameters
cChanges the default object color
Returns
a ref to this

Definition at line 125 of file CRenderizable.h.

References mrpt::utils::TColorf::A, mrpt::utils::TColorf::B, mrpt::utils::TColorf::G, and mrpt::utils::TColorf::R.

◆ setColor() [2/2]

CRenderizable& mrpt::opengl::CRenderizable::setColor ( double  R,
double  G,
double  B,
double  A = 1 
)
inlineinherited

Set the color components of this object (R,G,B,Alpha, in the range 0-1)

Returns
a ref to this

Definition at line 131 of file CRenderizable.h.

◆ setColor_u8() [1/2]

CRenderizable& mrpt::opengl::CSetOfTriangles::setColor_u8 ( const mrpt::utils::TColor c)
virtual

Reimplemented from mrpt::opengl::CRenderizable.

◆ setColor_u8() [2/2]

CRenderizable& mrpt::opengl::CRenderizable::setColor_u8 ( uint8_t  R,
uint8_t  G,
uint8_t  B,
uint8_t  A = 255 
)
inlineinherited

Set the color components of this object (R,G,B,Alpha, in the range 0-1)

Returns
a ref to this

Definition at line 138 of file CRenderizable.h.

References mrpt::opengl::CRenderizable::setColor_u8().

Referenced by mrpt::opengl::CRenderizable::setColor_u8().

◆ setColorA_u8()

CRenderizable& mrpt::opengl::CSetOfTriangles::setColorA_u8 ( const uint8_t  a)

◆ setColorB_u8()

CRenderizable& mrpt::opengl::CSetOfTriangles::setColorB_u8 ( const uint8_t  b)

◆ setColorG_u8()

CRenderizable& mrpt::opengl::CSetOfTriangles::setColorG_u8 ( const uint8_t  g)

◆ setColorR_u8()

CRenderizable& mrpt::opengl::CSetOfTriangles::setColorR_u8 ( const uint8_t  r)

◆ setLocation() [1/2]

CRenderizable& mrpt::opengl::CRenderizable::setLocation ( const mrpt::math::TPoint3D p)
inlineinherited

Changes the location of the object, keeping untouched the orientation.

Returns
a ref to this

Definition at line 85 of file CRenderizable.h.

References mrpt::math::TPoint3D::x, mrpt::math::TPoint3D::y, and mrpt::math::TPoint3D::z.

◆ setLocation() [2/2]

CRenderizable& mrpt::opengl::CRenderizable::setLocation ( double  x,
double  y,
double  z 
)
inlineinherited

Changes the location of the object, keeping untouched the orientation.

Returns
a ref to this

Definition at line 82 of file CRenderizable.h.

◆ setPose() [1/4]

CRenderizable& mrpt::opengl::CRenderizable::setPose ( const mrpt::math::TPose3D o)
inherited

Set the 3D pose from a mrpt::math::TPose3D object (return a ref to this)

◆ setPose() [2/4]

CRenderizable& mrpt::opengl::CRenderizable::setPose ( const mrpt::poses::CPoint2D o)
inherited

Set the 3D pose from a mrpt::poses::CPose3D object (return a ref to this)

◆ setPose() [3/4]

CRenderizable& mrpt::opengl::CRenderizable::setPose ( const mrpt::poses::CPoint3D o)
inherited

Set the 3D pose from a mrpt::poses::CPose3D object (return a ref to this)

◆ setPose() [4/4]

CRenderizable& mrpt::opengl::CRenderizable::setPose ( const mrpt::poses::CPose3D o)
inherited

Set the 3D pose from a mrpt::poses::CPose3D object (return a ref to this)

◆ setVisibility()

void mrpt::opengl::CRenderizable::setVisibility ( bool  visible = true)
inlineinherited

Set object visibility (default=true)

See also
isVisible

Definition at line 67 of file CRenderizable.h.

◆ should_skip_display_list_cache()

virtual bool mrpt::opengl::CRenderizableDisplayList::should_skip_display_list_cache ( ) const
inlineprotectedvirtualinherited

Optional: If the object has some state in which creating a display list is NOT preferred over direct rendering, implement this method and return "true" in those cases.

Reimplemented in mrpt::opengl::CSphere.

Definition at line 56 of file CRenderizableDisplayList.h.

◆ textBitmapWidth()

static int mrpt::opengl::CRenderizable::textBitmapWidth ( const std::string &  str,
mrpt::opengl::TOpenGLFont  font = mrpt::opengl::MRPT_GLUT_BITMAP_TIMES_ROMAN_24 
)
staticinherited

Return the exact width in pixels for a given string, as will be rendered by renderTextBitmap().

See also
renderTextBitmap, mrpt::opengl::gl_utils

◆ traceRay()

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

Ray tracing.

Reimplemented from mrpt::opengl::CRenderizable.

◆ updatePolygons()

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

Polygon cache updating.

◆ writeToMatlab()

virtual mxArray* mrpt::utils::CSerializable::writeToMatlab ( ) const
inlinevirtualinherited

Introduces a pure virtual method responsible for writing to a mxArray Matlab object, typically a MATLAB struct whose contents are documented in each derived class.

Returns
A new mxArray (caller is responsible of memory freeing) or NULL is class does not support conversion to MATLAB.

Definition at line 79 of file CSerializable.h.

◆ writeToStream()

void mrpt::opengl::CSetOfTriangles::writeToStream ( mrpt::utils::CStream out,
int *  getVersion 
) const
protectedvirtual

Introduces a pure virtual method responsible for writing to a CStream.

This can not be used directly be users, instead use "stream << object;" for writing it to a stream.

Parameters
outThe output binary stream where object must be dumped.
getVersionIf NULL, the object must be dumped. If not, only the version of the object dump must be returned in this pointer. This enables the versioning of objects dumping and backward compatibility with previously stored data.
Exceptions
std::exceptionOn any error, see CStream::WriteBuffer
See also
CStream

Implements mrpt::utils::CSerializable.

◆ writeToStreamRender()

void mrpt::opengl::CRenderizable::writeToStreamRender ( utils::CStream out) const
protectedinherited

Member Data Documentation

◆ _init_CSetOfTriangles

mrpt::utils::CLASSINIT mrpt::opengl::CSetOfTriangles::_init_CSetOfTriangles
staticprotected

Definition at line 31 of file CSetOfTriangles.h.

◆ classCObject

const mrpt::utils::TRuntimeClassId mrpt::utils::CObject::classCObject
staticinherited

Definition at line 124 of file CObject.h.

◆ classCRenderizable

const mrpt::utils::TRuntimeClassId mrpt::opengl::CRenderizable::classCRenderizable
staticinherited

Definition at line 46 of file CRenderizable.h.

◆ classCRenderizableDisplayList

const mrpt::utils::TRuntimeClassId mrpt::opengl::CRenderizableDisplayList::classCRenderizableDisplayList
staticinherited

Definition at line 38 of file CRenderizableDisplayList.h.

◆ classCSerializable

const mrpt::utils::TRuntimeClassId mrpt::utils::CSerializable::classCSerializable
staticinherited

Definition at line 42 of file CSerializable.h.

◆ classCSetOfTriangles

mrpt::utils::TRuntimeClassId mrpt::opengl::CSetOfTriangles::classCSetOfTriangles
static

Definition at line 31 of file CSetOfTriangles.h.

◆ classinfo

const mrpt::utils::TRuntimeClassId* mrpt::opengl::CSetOfTriangles::classinfo
static

Definition at line 31 of file CSetOfTriangles.h.

◆ m_color

mrpt::utils::TColor mrpt::opengl::CRenderizable::m_color
protectedinherited

Color components in the range [0,255].

Definition at line 54 of file CRenderizable.h.

◆ m_dl

unsigned int mrpt::opengl::CRenderizableDisplayList::m_dl
mutableprivateinherited

Display list ID, for derived classes that want to use it (it's automatically deleted and freed on destruction of this base class).

Definition at line 41 of file CRenderizableDisplayList.h.

◆ m_dl_recreate

bool mrpt::opengl::CRenderizableDisplayList::m_dl_recreate
mutableprivateinherited

If using display lists, this is true when the list must be updated (the object changes, it's the first rendering, etc...).

Definition at line 42 of file CRenderizableDisplayList.h.

◆ m_enableTransparency

bool mrpt::opengl::CSetOfTriangles::m_enableTransparency
protected

Transparency enabling.

Definition at line 64 of file CSetOfTriangles.h.

◆ m_name

std::string mrpt::opengl::CRenderizable::m_name
protectedinherited

Definition at line 52 of file CRenderizable.h.

◆ m_pose

mrpt::poses::CPose3D mrpt::opengl::CRenderizable::m_pose
protectedinherited

6D pose wrt the parent coordinate reference. This class automatically holds the cached 3x3 rotation matrix for quick load into opengl stack.

Definition at line 55 of file CRenderizable.h.

Referenced by mrpt::opengl::CGeneralizedEllipsoidTemplate< 3 >::render_dl().

◆ m_scale_x

float mrpt::opengl::CRenderizable::m_scale_x
protectedinherited

Definition at line 56 of file CRenderizable.h.

◆ m_scale_y

float mrpt::opengl::CRenderizable::m_scale_y
protectedinherited

Definition at line 56 of file CRenderizable.h.

◆ m_scale_z

float mrpt::opengl::CRenderizable::m_scale_z
protectedinherited

Scale components to apply to the object (default=1)

Definition at line 56 of file CRenderizable.h.

◆ m_show_name

bool mrpt::opengl::CRenderizable::m_show_name
protectedinherited

Definition at line 53 of file CRenderizable.h.

◆ m_triangles

std::vector<TTriangle> mrpt::opengl::CSetOfTriangles::m_triangles
protected

List of triangles.

See also
TTriangle

Definition at line 60 of file CSetOfTriangles.h.

◆ m_visible

bool mrpt::opengl::CRenderizable::m_visible
protectedinherited

Is the object visible? (default=true)

Definition at line 57 of file CRenderizable.h.

◆ polygonsUpToDate

bool mrpt::opengl::CSetOfTriangles::polygonsUpToDate
mutableprotected

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

Definition at line 68 of file CSetOfTriangles.h.

◆ tmpPolygons

std::vector<mrpt::math::TPolygonWithPlane> mrpt::opengl::CSetOfTriangles::tmpPolygons
mutableprotected

Polygon cache.

Definition at line 72 of file CSetOfTriangles.h.




Page generated by Doxygen 1.8.17 for MRPT 1.4.0 SVN: at Sat Jan 18 22:37:07 UTC 2020