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

mrpt::opengl::CPointCloudColoured Class Reference


Detailed Description

A cloud of points, each one with an individual colour (R,G,B).

The alpha component is shared by all the points and is stored in the base member m_color_A.

To load from a points-map, CPointCloudColoured::loadFromPointsMap().

This class uses smart optimizations while rendering to efficiently draw clouds of millions of points, as described in this page: http://www.mrpt.org/Efficiently_rendering_point_clouds_of_millions_of_points

See also:
opengl::COpenGLScene, opengl::CPointCloud
mrpt::opengl::CPointCloudColoured
preview_CPointCloudColoured.png

Definition at line 62 of file CPointCloudColoured.h.

#include <mrpt/opengl/CPointCloudColoured.h>

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

List of all members.

Classes

struct  TPointColour

Public Member Functions

void render () const
 Render.
void render_subset (const bool all, const std::vector< size_t > &idxs, const float render_area_sqpixels) const
 Render a subset of points (required by octree renderer)
Read/Write of the list of points to render
void push_back (float x, float y, float z, float R, float G, float B)
 Inserts a new point into the point cloud.
void resize (size_t N)
 Set the number of points, with undefined contents.
void reserve (size_t N)
 Like STL std::vector's reserve.
const TPointColouroperator[] (size_t i) const
 Read access to each individual point (checks for "i" in the valid range only in Debug).
const TPointColourgetPoint (size_t i) const
 Read access to each individual point (checks for "i" in the valid range only in Debug).
mrpt::math::TPoint3Df getPointf (size_t i) const
 Read access to each individual point (checks for "i" in the valid range only in Debug).
void setPoint (size_t i, const TPointColour &p)
 Write an individual point (checks for "i" in the valid range only in Debug).
size_t size () const
 Return the number of points.
void clear ()
 Erase all the points.
template<class POINTSMAP >
void loadFromPointsMap (const POINTSMAP *m)
 Load the points from a points map (passed as a pointer), depending on the type of point map passed: for the case of a mrpt::slam::CColouredPointMap the colours of individual points will be also copied.
size_t getActuallyRendered () const
 Get the number of elements actually rendered in the last render event.
Modify the appearance of the rendered points
void setPointSize (float pointSize)
float getPointSize () const
void enablePointSmooth (bool enable=true)
void disablePointSmooth ()
bool isPointSmoothEnabled () const

Private Types

typedef std::vector< TPointColourTListPointColour
typedef TListPointColour::iterator iterator
typedef
TListPointColour::const_iterator 
const_iterator

Private Member Functions

iterator begin ()
const_iterator begin () const
iterator end ()
const_iterator end () const
 CPointCloudColoured ()
 Constructor.
virtual ~CPointCloudColoured ()
 Private, virtual destructor: only can be deleted from smart pointers.
void markAllPointsAsNew ()
 Do needed internal work if all points are new (octree rebuilt,...)

Private Attributes

TListPointColour m_points
float m_pointSize
 By default is 1.0.
bool m_pointSmooth
 Default: false.
volatile size_t m_last_rendered_count
volatile size_t m_last_rendered_count_ongoing

RTTI stuff

typedef CPointCloudColouredPtr SmartPtr
static mrpt::utils::CLASSINIT _init_CPointCloudColoured
static mrpt::utils::TRuntimeClassId classCPointCloudColoured
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 CPointCloudColouredPtr Create ()

Member Typedef Documentation

Definition at line 81 of file CPointCloudColoured.h.

Definition at line 80 of file CPointCloudColoured.h.

A typedef for the associated smart pointer

Definition at line 66 of file CPointCloudColoured.h.

Definition at line 77 of file CPointCloudColoured.h.


Constructor & Destructor Documentation

mrpt::opengl::CPointCloudColoured::CPointCloudColoured (  ) [inline, private]

Constructor.

Definition at line 94 of file CPointCloudColoured.h.

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

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

Definition at line 103 of file CPointCloudColoured.h.


Member Function Documentation

static const mrpt::utils::TRuntimeClassId* mrpt::opengl::CPointCloudColoured::_GetBaseClass (  ) [static, protected]

Reimplemented from mrpt::opengl::CRenderizable.

iterator mrpt::opengl::CPointCloudColoured::begin (  ) [inline, private]

Definition at line 82 of file CPointCloudColoured.h.

const_iterator mrpt::opengl::CPointCloudColoured::begin (  ) const [inline, private]

Definition at line 83 of file CPointCloudColoured.h.

void mrpt::opengl::CPointCloudColoured::clear ( void   ) [inline]

Erase all the points.

Definition at line 150 of file CPointCloudColoured.h.

static CPointCloudColouredPtr mrpt::opengl::CPointCloudColoured::Create (  ) [static]
static mrpt::utils::CObject* mrpt::opengl::CPointCloudColoured::CreateObject (  ) [static]
void mrpt::opengl::CPointCloudColoured::disablePointSmooth (  ) [inline]

Definition at line 209 of file CPointCloudColoured.h.

virtual mrpt::utils::CObject* mrpt::opengl::CPointCloudColoured::duplicate (  ) const [virtual]

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

Implements mrpt::utils::CObject.

void mrpt::opengl::CPointCloudColoured::enablePointSmooth ( bool  enable = true ) [inline]

Definition at line 208 of file CPointCloudColoured.h.

iterator mrpt::opengl::CPointCloudColoured::end (  ) [inline, private]

Definition at line 84 of file CPointCloudColoured.h.

const_iterator mrpt::opengl::CPointCloudColoured::end (  ) const [inline, private]

Definition at line 85 of file CPointCloudColoured.h.

size_t mrpt::opengl::CPointCloudColoured::getActuallyRendered (  ) const [inline]

Get the number of elements actually rendered in the last render event.

Definition at line 197 of file CPointCloudColoured.h.

const TPointColour& mrpt::opengl::CPointCloudColoured::getPoint ( size_t  i ) const [inline]

Read access to each individual point (checks for "i" in the valid range only in Debug).

Definition at line 130 of file CPointCloudColoured.h.

References ASSERT_BELOW_, and mrpt::math::size().

mrpt::math::TPoint3Df mrpt::opengl::CPointCloudColoured::getPointf ( size_t  i ) const [inline]

Read access to each individual point (checks for "i" in the valid range only in Debug).

Definition at line 138 of file CPointCloudColoured.h.

References ASSERT_BELOW_, mrpt::math::size(), and internal::y.

float mrpt::opengl::CPointCloudColoured::getPointSize (  ) const [inline]

Definition at line 206 of file CPointCloudColoured.h.

virtual const mrpt::utils::TRuntimeClassId* mrpt::opengl::CPointCloudColoured::GetRuntimeClass (  ) const [virtual]

Returns information about the class of an object in runtime.

Reimplemented from mrpt::opengl::CRenderizable.

bool mrpt::opengl::CPointCloudColoured::isPointSmoothEnabled (  ) const [inline]

Definition at line 210 of file CPointCloudColoured.h.

template<class POINTSMAP >
void mrpt::opengl::CPointCloudColoured::loadFromPointsMap ( const POINTSMAP *  m ) [inline]

Load the points from a points map (passed as a pointer), depending on the type of point map passed: for the case of a mrpt::slam::CColouredPointMap the colours of individual points will be also copied.

The possible classes accepted as arguments are: mrpt::slam::CColouredPointsMap, or in general any mrpt::slam::CPointsMap.

Note:
The method is a template since CPointsMap belongs to a different mrpt library.

Definition at line 158 of file CPointCloudColoured.h.

References mrpt::dynamicsize_vector< T >::resize(), and internal::y.

void mrpt::opengl::CPointCloudColoured::markAllPointsAsNew (  ) [private]

Do needed internal work if all points are new (octree rebuilt,...)

const TPointColour& mrpt::opengl::CPointCloudColoured::operator[] ( size_t  i ) const [inline]

Read access to each individual point (checks for "i" in the valid range only in Debug).

Definition at line 122 of file CPointCloudColoured.h.

References ASSERT_BELOW_, and mrpt::math::size().

void mrpt::opengl::CPointCloudColoured::push_back ( float  x,
float  y,
float  z,
float  R,
float  G,
float  B 
)

Inserts a new point into the point cloud.

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

Render.

Implements mrpt::opengl::CRenderizable.

void mrpt::opengl::CPointCloudColoured::render_subset ( const bool  all,
const std::vector< size_t > &  idxs,
const float  render_area_sqpixels 
) const

Render a subset of points (required by octree renderer)

void mrpt::opengl::CPointCloudColoured::reserve ( size_t  N ) [inline]

Like STL std::vector's reserve.

Definition at line 119 of file CPointCloudColoured.h.

void mrpt::opengl::CPointCloudColoured::resize ( size_t  N ) [inline]

Set the number of points, with undefined contents.

Definition at line 116 of file CPointCloudColoured.h.

void mrpt::opengl::CPointCloudColoured::setPoint ( size_t  i,
const TPointColour p 
)

Write an individual point (checks for "i" in the valid range only in Debug).

void mrpt::opengl::CPointCloudColoured::setPointSize ( float  pointSize ) [inline]

Definition at line 205 of file CPointCloudColoured.h.

size_t mrpt::opengl::CPointCloudColoured::size (  ) const [inline]

Return the number of points.

Definition at line 148 of file CPointCloudColoured.h.


Member Data Documentation

Definition at line 66 of file CPointCloudColoured.h.

Definition at line 66 of file CPointCloudColoured.h.

Definition at line 66 of file CPointCloudColoured.h.

Definition at line 90 of file CPointCloudColoured.h.

Definition at line 90 of file CPointCloudColoured.h.

Definition at line 78 of file CPointCloudColoured.h.

By default is 1.0.

Definition at line 88 of file CPointCloudColoured.h.

Default: false.

Definition at line 89 of file CPointCloudColoured.h.




Page generated by Doxygen 1.7.2 for MRPT 0.9.4 SVN: at Mon Jan 10 22:30:30 UTC 2011