Main MRPT website > C++ reference for MRPT 1.9.9
CPointCloudColoured.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
15 #include <mrpt/img/color_maps.h>
16 
17 namespace mrpt
18 {
19 namespace opengl
20 {
21 /** A cloud of points, each one with an individual colour (R,G,B). The alpha
22  * component is shared by all the points and is stored in the base member
23  * m_color_A.
24  *
25  * To load from a points-map, CPointCloudColoured::loadFromPointsMap().
26  *
27  * This class uses smart optimizations while rendering to efficiently draw
28  * clouds of millions of points,
29  * as described in this page:
30  * http://www.mrpt.org/Efficiently_rendering_point_clouds_of_millions_of_points
31  *
32  * \sa opengl::COpenGLScene, opengl::CPointCloud
33  *
34  * <div align="center">
35  * <table border="0" cellspan="4" cellspacing="4" style="border-width: 1px;
36  * border-style: solid;">
37  * <tr> <td> mrpt::opengl::CPointCloudColoured </td> <td> \image html
38  * preview_CPointCloudColoured.png </td> </tr>
39  * </table>
40  * </div>
41  *
42  * \ingroup mrpt_opengl_grp
43  */
45  public COctreePointRenderer<CPointCloudColoured>,
48 {
50 
51  public:
52  struct TPointColour
53  {
54  inline TPointColour() {}
55  inline TPointColour(
56  float _x, float _y, float _z, float _R, float _G, float _B)
57  : x(_x), y(_y), z(_z), R(_R), G(_G), B(_B)
58  {
59  }
60  float x, y, z, R, G, B; // Float is precission enough for rendering
61  };
62 
63  private:
64  using TListPointColour = std::vector<TPointColour>;
66 
69  inline iterator begin() { return m_points.begin(); }
70  inline const_iterator begin() const { return m_points.begin(); }
71  inline iterator end() { return m_points.end(); }
72  inline const_iterator end() const { return m_points.end(); }
73  /** By default is 1.0 */
74  float m_pointSize;
75  /** Default: false */
77  mutable volatile size_t m_last_rendered_count,
79 
80  public:
81  /** Constructor
82  */
84  : m_points(),
85  m_pointSize(1),
86  m_pointSmooth(false),
89  {
90  }
91  /** Private, virtual destructor: only can be deleted from smart pointers */
92  virtual ~CPointCloudColoured() {}
93  /** Do needed internal work if all points are new (octree rebuilt,...) */
94  void markAllPointsAsNew();
95 
96  public:
97  /** Evaluates the bounding box of this object (including possible children)
98  * in the coordinate frame of the object parent. */
99  virtual void getBoundingBox(
100  mrpt::math::TPoint3D& bb_min,
101  mrpt::math::TPoint3D& bb_max) const override
102  {
103  this->octree_getBoundingBox(bb_min, bb_max);
104  }
105 
106  /** @name Read/Write of the list of points to render
107  @{ */
108 
109  /** Inserts a new point into the point cloud. */
110  void push_back(float x, float y, float z, float R, float G, float B);
111 
112  /** Set the number of points, with undefined contents */
113  inline void resize(size_t N)
114  {
115  m_points.resize(N);
117  }
118 
119  /** Like STL std::vector's reserve */
120  inline void reserve(size_t N) { m_points.reserve(N); }
121  /** Read access to each individual point (checks for "i" in the valid range
122  * only in Debug). */
123  inline const TPointColour& operator[](size_t i) const
124  {
125 #ifdef _DEBUG
126  ASSERT_BELOW_(i, size());
127 #endif
128  return m_points[i];
129  }
130 
131  /** Read access to each individual point (checks for "i" in the valid range
132  * only in Debug). */
133  inline const TPointColour& getPoint(size_t i) const
134  {
135 #ifdef _DEBUG
136  ASSERT_BELOW_(i, size());
137 #endif
138  return m_points[i];
139  }
140 
141  /** Read access to each individual point (checks for "i" in the valid range
142  * only in Debug). */
143  inline mrpt::math::TPoint3Df getPointf(size_t i) const
144  {
145 #ifdef _DEBUG
146  ASSERT_BELOW_(i, size());
147 #endif
148  return mrpt::math::TPoint3Df(
149  m_points[i].x, m_points[i].y, m_points[i].z);
150  }
151 
152  /** Write an individual point (checks for "i" in the valid range only in
153  * Debug). */
154  void setPoint(size_t i, const TPointColour& p);
155 
156  /** Like \a setPoint() but does not check for index out of bounds */
157  inline void setPoint_fast(const size_t i, const TPointColour& p)
158  {
159  m_points[i] = p;
161  }
162 
163  /** Like \a setPoint() but does not check for index out of bounds */
164  inline void setPoint_fast(
165  const size_t i, const float x, const float y, const float z)
166  {
167  TPointColour& p = m_points[i];
168  p.x = x;
169  p.y = y;
170  p.z = z;
172  }
173 
174  /** Like \c setPointColor but without checking for out-of-index erors */
175  inline void setPointColor_fast(size_t index, float R, float G, float B)
176  {
177  m_points[index].R = R;
178  m_points[index].G = G;
179  m_points[index].B = B;
180  }
181  /** Like \c getPointColor but without checking for out-of-index erors */
182  inline void getPointColor_fast(
183  size_t index, float& R, float& G, float& B) const
184  {
185  R = m_points[index].R;
186  G = m_points[index].G;
187  B = m_points[index].B;
188  }
189 
190  /** Return the number of points */
191  inline size_t size() const { return m_points.size(); }
192  /** Erase all the points */
193  inline void clear()
194  {
195  m_points.clear();
197  }
198 
199  /** Load the points from any other point map class supported by the adapter
200  * mrpt::opengl::PointCloudAdapter. */
201  template <class POINTSMAP>
202  void loadFromPointsMap(const POINTSMAP* themap);
203  // Must be implemented at the end of the header.
204 
205  /** Get the number of elements actually rendered in the last render event.
206  */
207  size_t getActuallyRendered() const { return m_last_rendered_count; }
208  /** @} */
209 
210  /** @name Modify the appearance of the rendered points
211  @{ */
212 
213  inline void setPointSize(float pointSize) { m_pointSize = pointSize; }
214  inline float getPointSize() const { return m_pointSize; }
215  inline void enablePointSmooth(bool enable = true)
216  {
217  m_pointSmooth = enable;
218  }
219  inline void disablePointSmooth() { m_pointSmooth = false; }
220  inline bool isPointSmoothEnabled() const { return m_pointSmooth; }
221  /** Regenerates the color of each point according the one coordinate
222  * (coord_index:0,1,2 for X,Y,Z) and the given color map. */
224  const float coord_min, const float coord_max, const int coord_index = 2,
225  const mrpt::img::TColormap color_map = mrpt::img::cmJET);
226  /** @} */
227 
228  /** Render */
229  void render() const override;
230 
231  /** Render a subset of points (required by octree renderer) */
232  void render_subset(
233  const bool all, const std::vector<size_t>& idxs,
234  const float render_area_sqpixels) const;
235 
236  protected:
237  /** @name PLY Import virtual methods to implement in base classes
238  @{ */
239  /** In a base class, reserve memory to prepare subsequent calls to
240  * PLY_import_set_vertex */
241  virtual void PLY_import_set_vertex_count(const size_t N) override;
242  /** In a base class, reserve memory to prepare subsequent calls to
243  * PLY_import_set_face */
244  virtual void PLY_import_set_face_count(const size_t N) override
245  {
247  }
248  /** In a base class, will be called after PLY_import_set_vertex_count() once
249  * for each loaded point.
250  * \param pt_color Will be nullptr if the loaded file does not provide
251  * color info.
252  */
253  virtual void PLY_import_set_vertex(
254  const size_t idx, const mrpt::math::TPoint3Df& pt,
255  const mrpt::img::TColorf* pt_color = nullptr) override;
256  /** @} */
257 
258  /** @name PLY Export virtual methods to implement in base classes
259  @{ */
260  size_t PLY_export_get_vertex_count() const override;
261  size_t PLY_export_get_face_count() const override { return 0; }
263  const size_t idx, mrpt::math::TPoint3Df& pt, bool& pt_has_color,
264  mrpt::img::TColorf& pt_color) const override;
265  /** @} */
266 };
267 
269  mrpt::serialization::CArchive& in, CPointCloudColoured::TPointColour& o);
272  const CPointCloudColoured::TPointColour& o);
273 
274 /** Specialization
275  * mrpt::opengl::PointCloudAdapter<mrpt::opengl::CPointCloudColoured> \ingroup
276  * mrpt_adapters_grp*/
277 template <>
279 {
280  private:
282 
283  public:
284  /** The type of each point XYZ coordinates */
285  using coords_t = float;
286  /** Has any color RGB info? */
287  static const int HAS_RGB = 1;
288  /** Has native RGB info (as floats)? */
289  static const int HAS_RGBf = 1;
290  /** Has native RGB info (as uint8_t)? */
291  static const int HAS_RGBu8 = 0;
292 
293  /** Constructor (accept a const ref for convenience) */
295  : m_obj(*const_cast<mrpt::opengl::CPointCloudColoured*>(&obj))
296  {
297  }
298  /** Get number of points */
299  inline size_t size() const { return m_obj.size(); }
300  /** Set number of points (to uninitialized values) */
301  inline void resize(const size_t N) { m_obj.resize(N); }
302  /** Get XYZ coordinates of i'th point */
303  template <typename T>
304  inline void getPointXYZ(const size_t idx, T& x, T& y, T& z) const
305  {
307  x = pc.x;
308  y = pc.y;
309  z = pc.z;
310  }
311  /** Set XYZ coordinates of i'th point */
312  inline void setPointXYZ(
313  const size_t idx, const coords_t x, const coords_t y, const coords_t z)
314  {
315  m_obj.setPoint_fast(idx, x, y, z);
316  }
317 
318  inline void setInvalidPoint(const size_t idx)
319  {
320  THROW_EXCEPTION("mrpt::opengl::CPointCloudColoured needs to be dense");
321  }
322 
323  /** Get XYZ_RGBf coordinates of i'th point */
324  template <typename T>
325  inline void getPointXYZ_RGBf(
326  const size_t idx, T& x, T& y, T& z, float& r, float& g, float& b) const
327  {
329  x = pc.x;
330  y = pc.y;
331  z = pc.z;
332  r = pc.R;
333  g = pc.G;
334  b = pc.B;
335  }
336  /** Set XYZ_RGBf coordinates of i'th point */
337  inline void setPointXYZ_RGBf(
338  const size_t idx, const coords_t x, const coords_t y, const coords_t z,
339  const float r, const float g, const float b)
340  {
341  m_obj.setPoint_fast(
342  idx,
344  }
345 
346  /** Get XYZ_RGBu8 coordinates of i'th point */
347  template <typename T>
348  inline void getPointXYZ_RGBu8(
349  const size_t idx, T& x, T& y, T& z, uint8_t& r, uint8_t& g,
350  uint8_t& b) const
351  {
353  x = pc.x;
354  y = pc.y;
355  z = pc.z;
356  r = pc.R * 255;
357  g = pc.G * 255;
358  b = pc.B * 255;
359  }
360  /** Set XYZ_RGBu8 coordinates of i'th point */
361  inline void setPointXYZ_RGBu8(
362  const size_t idx, const coords_t x, const coords_t y, const coords_t z,
363  const uint8_t r, const uint8_t g, const uint8_t b)
364  {
365  m_obj.setPoint_fast(
367  x, y, z, r / 255.f, g / 255.f, b / 255.f));
368  }
369 
370  /** Get RGBf color of i'th point */
371  inline void getPointRGBf(
372  const size_t idx, float& r, float& g, float& b) const
373  {
374  m_obj.getPointColor_fast(idx, r, g, b);
375  }
376  /** Set XYZ_RGBf coordinates of i'th point */
377  inline void setPointRGBf(
378  const size_t idx, const float r, const float g, const float b)
379  {
380  m_obj.setPointColor_fast(idx, r, g, b);
381  }
382 
383  /** Get RGBu8 color of i'th point */
384  inline void getPointRGBu8(
385  const size_t idx, uint8_t& r, uint8_t& g, uint8_t& b) const
386  {
387  float R, G, B;
388  m_obj.getPointColor_fast(idx, R, G, B);
389  r = R * 255;
390  g = G * 255;
391  b = B * 255;
392  }
393  /** Set RGBu8 coordinates of i'th point */
394  inline void setPointRGBu8(
395  const size_t idx, const uint8_t r, const uint8_t g, const uint8_t b)
396  {
397  m_obj.setPointColor_fast(idx, r / 255.f, g / 255.f, b / 255.f);
398  }
399 
400 }; // end of PointCloudAdapter<mrpt::opengl::CPointCloudColoured>
401 } // namespace opengl
402 namespace opengl
403 {
404 // After declaring the adapter we can here implement this method:
405 template <class POINTSMAP>
406 void CPointCloudColoured::loadFromPointsMap(const POINTSMAP* themap)
407 {
409  const mrpt::opengl::PointCloudAdapter<POINTSMAP> pc_src(*themap);
410  const size_t N = pc_src.size();
411  pc_dst.resize(N);
412  for (size_t i = 0; i < N; i++)
413  {
414  float x, y, z, r, g, b;
415  pc_src.getPointXYZ_RGBf(i, x, y, z, r, g, b);
416  pc_dst.setPointXYZ_RGBf(i, x, y, z, r, g, b);
417  }
418 }
419 } // namespace opengl
420 namespace typemeta
421 {
422 // Specialization must occur in the same namespace
424  CPointCloudColoured::TPointColour, mrpt::opengl)
425 } // namespace typemeta
426 } // namespace mrpt
mrpt::opengl::CPointCloudColoured::getActuallyRendered
size_t getActuallyRendered() const
Get the number of elements actually rendered in the last render event.
Definition: CPointCloudColoured.h:207
mrpt::math::TPoint3Df
Lightweight 3D point (float version).
Definition: lightweight_geom_data.h:315
mrpt::opengl::CPointCloudColoured::TPointColour
Definition: CPointCloudColoured.h:52
mrpt::opengl::PointCloudAdapter
An adapter to different kinds of point cloud object.
Definition: pointcloud_adapters.h:39
mrpt::opengl::CPointCloudColoured::end
const_iterator end() const
Definition: CPointCloudColoured.h:72
mrpt::opengl::PointCloudAdapter< mrpt::opengl::CPointCloudColoured >::getPointXYZ_RGBu8
void getPointXYZ_RGBu8(const size_t idx, T &x, T &y, T &z, uint8_t &r, uint8_t &g, uint8_t &b) const
Get XYZ_RGBu8 coordinates of i'th point.
Definition: CPointCloudColoured.h:348
mrpt::opengl::CPointCloudColoured::PLY_export_get_vertex_count
size_t PLY_export_get_vertex_count() const override
In a base class, return the number of vertices.
Definition: CPointCloudColoured.cpp:229
mrpt::opengl::CPointCloudColoured::~CPointCloudColoured
virtual ~CPointCloudColoured()
Private, virtual destructor: only can be deleted from smart pointers.
Definition: CPointCloudColoured.h:92
mrpt::opengl::PointCloudAdapter< mrpt::opengl::CPointCloudColoured >::setPointXYZ_RGBf
void setPointXYZ_RGBf(const size_t idx, const coords_t x, const coords_t y, const coords_t z, const float r, const float g, const float b)
Set XYZ_RGBf coordinates of i'th point.
Definition: CPointCloudColoured.h:337
mrpt::opengl::CPointCloudColoured::clear
void clear()
Erase all the points.
Definition: CPointCloudColoured.h:193
PLY_import_export.h
mrpt::opengl::CPointCloudColoured::begin
const_iterator begin() const
Definition: CPointCloudColoured.h:70
mrpt::opengl::PointCloudAdapter< mrpt::opengl::CPointCloudColoured >::resize
void resize(const size_t N)
Set number of points (to uninitialized values)
Definition: CPointCloudColoured.h:301
mrpt::img::TColormap
TColormap
Different colormaps for use in mrpt::img::colormap()
Definition: color_maps.h:31
const_iterator
const Scalar * const_iterator
Definition: eigen_plugins.h:27
mrpt::opengl::CPointCloudColoured::setPointSize
void setPointSize(float pointSize)
Definition: CPointCloudColoured.h:213
mrpt::opengl::CPointCloudColoured::push_back
void push_back(float x, float y, float z, float R, float G, float B)
Inserts a new point into the point cloud.
Definition: CPointCloudColoured.cpp:192
mrpt::opengl::CPointCloudColoured::end
iterator end()
Definition: CPointCloudColoured.h:71
G
const double G
Definition: vision_stereo_rectify/test.cpp:31
mrpt::opengl::operator>>
mrpt::serialization::CArchive & operator>>(mrpt::serialization::CArchive &in, mrpt::opengl::CLight &o)
Definition: CLight.cpp:124
mrpt::opengl::CPointCloudColoured::size
size_t size() const
Return the number of points.
Definition: CPointCloudColoured.h:191
mrpt::opengl::CPointCloudColoured::getBoundingBox
virtual void getBoundingBox(mrpt::math::TPoint3D &bb_min, mrpt::math::TPoint3D &bb_max) const override
Evaluates the bounding box of this object (including possible children) in the coordinate frame of th...
Definition: CPointCloudColoured.h:99
mrpt::opengl::CRenderizable
The base class of 3D objects that can be directly rendered through OpenGL.
Definition: CRenderizable.h:43
mrpt::opengl::CPointCloudColoured::TPointColour::z
float z
Definition: CPointCloudColoured.h:60
color_maps.h
mrpt::opengl::PointCloudAdapter< mrpt::opengl::CPointCloudColoured >::getPointXYZ_RGBf
void getPointXYZ_RGBf(const size_t idx, T &x, T &y, T &z, float &r, float &g, float &b) const
Get XYZ_RGBf coordinates of i'th point.
Definition: CPointCloudColoured.h:325
mrpt::opengl::CPointCloudColoured::m_pointSmooth
bool m_pointSmooth
Default: false.
Definition: CPointCloudColoured.h:76
mrpt::opengl::CPointCloudColoured::render_subset
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)
Definition: CPointCloudColoured.cpp:75
mrpt::opengl::CPointCloudColoured::TListPointColour
std::vector< TPointColour > TListPointColour
Definition: CPointCloudColoured.h:64
obj
GLsizei GLsizei GLuint * obj
Definition: glext.h:4070
mrpt::opengl::CPointCloudColoured::setPoint_fast
void setPoint_fast(const size_t i, const TPointColour &p)
Like setPoint() but does not check for index out of bounds.
Definition: CPointCloudColoured.h:157
MRPT_UNUSED_PARAM
#define MRPT_UNUSED_PARAM(a)
Determines whether this is an X86 or AMD64 platform.
Definition: common.h:186
mrpt::opengl::CPointCloudColoured::PLY_export_get_vertex
void PLY_export_get_vertex(const size_t idx, mrpt::math::TPoint3Df &pt, bool &pt_has_color, mrpt::img::TColorf &pt_color) const override
In a base class, will be called after PLY_export_get_vertex_count() once for each exported point.
Definition: CPointCloudColoured.cpp:239
mrpt::opengl::PointCloudAdapter< mrpt::opengl::CPointCloudColoured >::getPointRGBf
void getPointRGBf(const size_t idx, float &r, float &g, float &b) const
Get RGBf color of i'th point.
Definition: CPointCloudColoured.h:371
mrpt::opengl::CPointCloudColoured::PLY_import_set_vertex_count
virtual void PLY_import_set_vertex_count(const size_t N) override
In a base class, reserve memory to prepare subsequent calls to PLY_import_set_vertex.
Definition: CPointCloudColoured.cpp:206
MRPT_DECLARE_TTYPENAME_NAMESPACE
#define MRPT_DECLARE_TTYPENAME_NAMESPACE(_TYPE, __NS)
Declares a typename to be "namespace::type".
Definition: TTypeName.h:115
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
g
GLubyte g
Definition: glext.h:6279
uint8_t
unsigned char uint8_t
Definition: rptypes.h:41
R
const float R
Definition: CKinematicChain.cpp:138
THROW_EXCEPTION
#define THROW_EXCEPTION(msg)
Definition: exceptions.h:41
p
GLfloat GLfloat p
Definition: glext.h:6305
mrpt::opengl::PointCloudAdapter< mrpt::opengl::CPointCloudColoured >::setPointRGBu8
void setPointRGBu8(const size_t idx, const uint8_t r, const uint8_t g, const uint8_t b)
Set RGBu8 coordinates of i'th point.
Definition: CPointCloudColoured.h:394
mrpt::opengl::CPointCloudColoured::TPointColour::x
float x
Definition: CPointCloudColoured.h:60
mrpt::opengl::PointCloudAdapter< mrpt::opengl::CPointCloudColoured >::getPointXYZ
void getPointXYZ(const size_t idx, T &x, T &y, T &z) const
Get XYZ coordinates of i'th point.
Definition: CPointCloudColoured.h:304
mrpt::opengl::CPointCloudColoured::getPoint
const TPointColour & getPoint(size_t i) const
Read access to each individual point (checks for "i" in the valid range only in Debug).
Definition: CPointCloudColoured.h:133
mrpt::opengl::PointCloudAdapter< mrpt::opengl::CPointCloudColoured >::setPointXYZ
void setPointXYZ(const size_t idx, const coords_t x, const coords_t y, const coords_t z)
Set XYZ coordinates of i'th point.
Definition: CPointCloudColoured.h:312
COctreePointRenderer.h
mrpt::opengl::CPointCloudColoured::markAllPointsAsNew
void markAllPointsAsNew()
Do needed internal work if all points are new (octree rebuilt,...)
Definition: CPointCloudColoured.cpp:203
mrpt::serialization::CArchive
Virtual base class for "archives": classes abstracting I/O streams.
Definition: CArchive.h:48
mrpt::opengl::CPointCloudColoured::resize
void resize(size_t N)
Set the number of points, with undefined contents.
Definition: CPointCloudColoured.h:113
mrpt::opengl::CPointCloudColoured::recolorizeByCoordinate
void recolorizeByCoordinate(const float coord_min, const float coord_max, const int coord_index=2, const mrpt::img::TColormap color_map=mrpt::img::cmJET)
Regenerates the color of each point according the one coordinate (coord_index:0,1,...
Definition: CPointCloudColoured.cpp:253
r
GLdouble GLdouble GLdouble r
Definition: glext.h:3705
mrpt::opengl::PLY_Exporter
A virtual base class that implements the capability of exporting 3D point clouds and faces to a file ...
Definition: PLY_import_export.h:85
ASSERT_BELOW_
#define ASSERT_BELOW_(__A, __B)
Definition: exceptions.h:165
mrpt::opengl::CPointCloudColoured::PLY_import_set_face_count
virtual void PLY_import_set_face_count(const size_t N) override
In a base class, reserve memory to prepare subsequent calls to PLY_import_set_face.
Definition: CPointCloudColoured.h:244
mrpt::opengl::PointCloudAdapter< mrpt::opengl::CPointCloudColoured >::setInvalidPoint
void setInvalidPoint(const size_t idx)
Definition: CPointCloudColoured.h:318
mrpt::opengl::CPointCloudColoured::getPointSize
float getPointSize() const
Definition: CPointCloudColoured.h:214
mrpt::opengl::CPointCloudColoured::render
void render() const override
Render.
Definition: CPointCloudColoured.cpp:31
mrpt::opengl::CPointCloudColoured::TPointColour::B
float B
Definition: CPointCloudColoured.h:60
mrpt::opengl::PointCloudAdapter< mrpt::opengl::CPointCloudColoured >::getPointRGBu8
void getPointRGBu8(const size_t idx, uint8_t &r, uint8_t &g, uint8_t &b) const
Get RGBu8 color of i'th point.
Definition: CPointCloudColoured.h:384
mrpt::opengl::CPointCloudColoured::PLY_import_set_vertex
virtual void PLY_import_set_vertex(const size_t idx, const mrpt::math::TPoint3Df &pt, const mrpt::img::TColorf *pt_color=nullptr) override
In a base class, will be called after PLY_import_set_vertex_count() once for each loaded point.
Definition: CPointCloudColoured.cpp:216
mrpt::opengl::CPointCloudColoured::iterator
TListPointColour::iterator iterator
Definition: CPointCloudColoured.h:67
mrpt::opengl::CPointCloudColoured::TPointColour::TPointColour
TPointColour()
Definition: CPointCloudColoured.h:54
mrpt::opengl::CPointCloudColoured::TPointColour::y
float y
Definition: CPointCloudColoured.h:60
mrpt::opengl::CPointCloudColoured::reserve
void reserve(size_t N)
Like STL std::vector's reserve.
Definition: CPointCloudColoured.h:120
index
GLuint index
Definition: glext.h:4054
b
GLubyte GLubyte b
Definition: glext.h:6279
mrpt::opengl::CPointCloudColoured::CPointCloudColoured
CPointCloudColoured()
Constructor.
Definition: CPointCloudColoured.h:83
mrpt::opengl::PointCloudAdapter< mrpt::opengl::CPointCloudColoured >::size
size_t size() const
Get number of points.
Definition: CPointCloudColoured.h:299
mrpt::img::TColorf
A RGB color - floats in the range [0,1].
Definition: TColor.h:79
mrpt::opengl::CPointCloudColoured::begin
iterator begin()
Definition: CPointCloudColoured.h:69
CRenderizable.h
mrpt::opengl::CPointCloudColoured::m_points
TListPointColour m_points
Definition: CPointCloudColoured.h:65
mrpt::opengl::CPointCloudColoured::PLY_export_get_face_count
size_t PLY_export_get_face_count() const override
In a base class, return the number of faces.
Definition: CPointCloudColoured.h:261
mrpt::opengl::CPointCloudColoured::TPointColour::R
float R
Definition: CPointCloudColoured.h:60
mrpt::opengl::CPointCloudColoured::enablePointSmooth
void enablePointSmooth(bool enable=true)
Definition: CPointCloudColoured.h:215
mrpt::opengl::CPointCloudColoured::isPointSmoothEnabled
bool isPointSmoothEnabled() const
Definition: CPointCloudColoured.h:220
mrpt::opengl::operator<<
mrpt::serialization::CArchive & operator<<(mrpt::serialization::CArchive &out, const mrpt::opengl::CLight &o)
Definition: CLight.cpp:130
mrpt::math::TPoint3D
Lightweight 3D point.
Definition: lightweight_geom_data.h:378
mrpt::opengl::PLY_Importer
A virtual base class that implements the capability of importing 3D point clouds and faces from a fil...
Definition: PLY_import_export.h:26
mrpt::opengl::COctreePointRenderer< CPointCloudColoured >::octree_getBoundingBox
void octree_getBoundingBox(mrpt::math::TPoint3D &bb_min, mrpt::math::TPoint3D &bb_max) const
Definition: COctreePointRenderer.h:119
mrpt::opengl::PointCloudAdapter< mrpt::opengl::CPointCloudColoured >::setPointRGBf
void setPointRGBf(const size_t idx, const float r, const float g, const float b)
Set XYZ_RGBf coordinates of i'th point.
Definition: CPointCloudColoured.h:377
mrpt::opengl::CPointCloudColoured::loadFromPointsMap
void loadFromPointsMap(const POINTSMAP *themap)
Load the points from any other point map class supported by the adapter mrpt::opengl::PointCloudAdapt...
Definition: CPointCloudColoured.h:406
mrpt::opengl::CPointCloudColoured::m_last_rendered_count
volatile size_t m_last_rendered_count
Definition: CPointCloudColoured.h:77
mrpt::opengl::CPointCloudColoured::TPointColour::TPointColour
TPointColour(float _x, float _y, float _z, float _R, float _G, float _B)
Definition: CPointCloudColoured.h:55
mrpt::opengl::COctreePointRenderer
Template class that implements the data structure and algorithms for Octree-based efficient rendering...
Definition: COctreePointRenderer.h:51
mrpt::opengl::CPointCloudColoured::const_iterator
TListPointColour::const_iterator const_iterator
Definition: CPointCloudColoured.h:68
pointcloud_adapters.h
DEFINE_SERIALIZABLE
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
Definition: CSerializable.h:102
mrpt::opengl::CPointCloudColoured::getPointf
mrpt::math::TPoint3Df getPointf(size_t i) const
Read access to each individual point (checks for "i" in the valid range only in Debug).
Definition: CPointCloudColoured.h:143
mrpt::opengl::PointCloudAdapter< mrpt::opengl::CPointCloudColoured >::PointCloudAdapter
PointCloudAdapter(const mrpt::opengl::CPointCloudColoured &obj)
Constructor (accept a const ref for convenience)
Definition: CPointCloudColoured.h:294
mrpt::opengl::CPointCloudColoured::m_last_rendered_count_ongoing
volatile size_t m_last_rendered_count_ongoing
Definition: CPointCloudColoured.h:78
mrpt::opengl::PointCloudAdapter< mrpt::opengl::CPointCloudColoured >::coords_t
float coords_t
The type of each point XYZ coordinates.
Definition: CPointCloudColoured.h:285
z
GLdouble GLdouble z
Definition: glext.h:3872
mrpt::opengl::PointCloudAdapter< mrpt::opengl::CPointCloudColoured >::setPointXYZ_RGBu8
void setPointXYZ_RGBu8(const size_t idx, const coords_t x, const coords_t y, const coords_t z, const uint8_t r, const uint8_t g, const uint8_t b)
Set XYZ_RGBu8 coordinates of i'th point.
Definition: CPointCloudColoured.h:361
in
GLuint in
Definition: glext.h:7274
mrpt::img::cmJET
@ cmJET
Definition: color_maps.h:35
mrpt::opengl::CPointCloudColoured::disablePointSmooth
void disablePointSmooth()
Definition: CPointCloudColoured.h:219
mrpt::opengl::CPointCloudColoured::setPoint_fast
void setPoint_fast(const size_t i, const float x, const float y, const float z)
Like setPoint() but does not check for index out of bounds.
Definition: CPointCloudColoured.h:164
iterator
Scalar * iterator
Definition: eigen_plugins.h:26
mrpt::opengl::CPointCloudColoured::m_pointSize
float m_pointSize
By default is 1.0.
Definition: CPointCloudColoured.h:74
mrpt::opengl::PointCloudAdapter< mrpt::opengl::CPointCloudColoured >::m_obj
mrpt::opengl::CPointCloudColoured & m_obj
Definition: CPointCloudColoured.h:281
mrpt::opengl::CPointCloudColoured::operator[]
const TPointColour & operator[](size_t i) const
Read access to each individual point (checks for "i" in the valid range only in Debug).
Definition: CPointCloudColoured.h:123
mrpt::opengl::CPointCloudColoured::getPointColor_fast
void getPointColor_fast(size_t index, float &R, float &G, float &B) const
Like getPointColor but without checking for out-of-index erors.
Definition: CPointCloudColoured.h:182
mrpt::opengl
The namespace for 3D scene representation and rendering.
Definition: CGlCanvasBase.h:15
y
GLenum GLint GLint y
Definition: glext.h:3538
mrpt::opengl::CPointCloudColoured::setPoint
void setPoint(size_t i, const TPointColour &p)
Write an individual point (checks for "i" in the valid range only in Debug).
Definition: CPointCloudColoured.cpp:179
mrpt::opengl::CPointCloudColoured::TPointColour::G
float G
Definition: CPointCloudColoured.h:60
mrpt::opengl::CPointCloudColoured
A cloud of points, each one with an individual colour (R,G,B).
Definition: CPointCloudColoured.h:44
x
GLenum GLint x
Definition: glext.h:3538
mrpt::opengl::CPointCloudColoured::setPointColor_fast
void setPointColor_fast(size_t index, float R, float G, float B)
Like setPointColor but without checking for out-of-index erors.
Definition: CPointCloudColoured.h:175



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST