Go to the documentation of this file.
9 #ifndef mrpt_maps_PCL_adapters_H
10 #define mrpt_maps_PCL_adapters_H
12 #include <mrpt/config.h>
19 #include <pcl/point_types.h>
20 #include <pcl/point_cloud.h>
32 pcl::PointCloud<pcl::PointXYZ>, float>
35 pcl::PointCloud<pcl::PointXYZ>&
m_obj;
41 static const int HAS_RGB = 0;
43 static const int HAS_RGBf = 0;
45 static const int HAS_RGBu8 = 0;
49 : m_obj(*const_cast<pcl::PointCloud<pcl::PointXYZ>*>(&
obj))
53 inline size_t size()
const {
return m_obj.points.size(); }
55 inline void resize(
const size_t N) { m_obj.points.resize(N); }
60 const pcl::PointXYZ&
p = m_obj.points[idx];
69 pcl::PointXYZ&
p = m_obj.points[idx];
78 pcl::PointXYZ&
p = m_obj.points[idx];
79 p.x =
p.y =
p.z = std::numeric_limits<float>::quiet_NaN();
90 pcl::PointCloud<pcl::PointXYZRGB>&
m_obj;
96 static const int HAS_RGB = 1;
98 static const int HAS_RGBf = 0;
100 static const int HAS_RGBu8 = 1;
104 : m_obj(*const_cast<pcl::PointCloud<pcl::PointXYZRGB>*>(&
obj))
108 inline size_t size()
const {
return m_obj.points.size(); }
110 inline void resize(
const size_t N) { m_obj.points.resize(N); }
112 template <
typename T>
115 const pcl::PointXYZRGB&
p = m_obj.points[idx];
124 pcl::PointXYZRGB&
p = m_obj.points[idx];
128 p.r =
p.g =
p.b = 255;
132 template <
typename T>
134 const size_t idx, T&
x, T&
y, T&
z,
float&
r,
float&
g,
float&
b)
const
136 const pcl::PointXYZRGB&
p = m_obj.points[idx];
147 const float r,
const float g,
const float b)
149 pcl::PointXYZRGB&
p = m_obj.points[idx];
159 template <
typename T>
164 const pcl::PointXYZRGB&
p = m_obj.points[idx];
177 pcl::PointXYZRGB&
p = m_obj.points[idx];
188 const size_t idx,
float&
r,
float&
g,
float&
b)
const
190 const pcl::PointXYZRGB&
p = m_obj.points[idx];
197 const size_t idx,
const float r,
const float g,
const float b)
199 pcl::PointXYZRGB&
p = m_obj.points[idx];
209 const pcl::PointXYZRGB&
p = m_obj.points[idx];
218 pcl::PointXYZRGB&
p = m_obj.points[idx];
234 pcl::PointCloud<pcl::PointXYZRGBA>&
m_obj;
240 static const int HAS_RGB = 1;
242 static const int HAS_RGBf = 0;
244 static const int HAS_RGBu8 = 1;
248 : m_obj(*const_cast<pcl::PointCloud<pcl::PointXYZRGBA>*>(&
obj))
252 inline size_t size()
const {
return m_obj.points.size(); }
254 inline void resize(
const size_t N) { m_obj.points.resize(N); }
256 template <
typename T>
259 const pcl::PointXYZRGBA&
p = m_obj.points[idx];
268 pcl::PointXYZRGBA&
p = m_obj.points[idx];
272 p.r =
p.g =
p.b = 255;
278 pcl::PointXYZRGBA&
p = m_obj.points[idx];
279 p.x =
p.y =
p.z = std::numeric_limits<float>::quiet_NaN();
283 template <
typename T>
285 const size_t idx, T&
x, T&
y, T&
z,
float&
r,
float&
g,
float&
b)
const
287 const pcl::PointXYZRGBA&
p = m_obj.points[idx];
298 const float r,
const float g,
const float b)
300 pcl::PointXYZRGBA&
p = m_obj.points[idx];
310 template <
typename T>
315 const pcl::PointXYZRGBA&
p = m_obj.points[idx];
328 pcl::PointXYZRGBA&
p = m_obj.points[idx];
339 const size_t idx,
float&
r,
float&
g,
float&
b)
const
341 const pcl::PointXYZRGBA&
p = m_obj.points[idx];
348 const size_t idx,
const float r,
const float g,
const float b)
350 pcl::PointXYZRGBA&
p = m_obj.points[idx];
360 const pcl::PointXYZRGBA&
p = m_obj.points[idx];
369 pcl::PointXYZRGBA&
p = m_obj.points[idx];
void getPointRGBu8(const size_t idx, uint8_t &r, uint8_t &g, uint8_t &b) const
Get RGBu8 color of i'th point.
PointCloudAdapter(const pcl::PointCloud< pcl::PointXYZRGBA > &obj)
Constructor (accept a const ref for convenience)
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.
An adapter to different kinds of point cloud object.
void getPointXYZ(const size_t idx, T &x, T &y, T &z) const
Get XYZ coordinates of i'th point.
void getPointXYZ(const size_t idx, T &x, T &y, T &z) const
Get XYZ coordinates of i'th point.
void setInvalidPoint(const size_t idx)
Set Invalid Point.
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.
pcl::PointCloud< pcl::PointXYZRGBA > & m_obj
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.
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.
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.
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.
void resize(const size_t N)
Set number of points (to uninitialized values)
GLsizei GLsizei GLuint * obj
void getPointRGBf(const size_t idx, float &r, float &g, float &b) const
Get RGBf color of i'th point.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
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.
void resize(const size_t N)
Set number of points (to uninitialized values)
void setPointRGBf(const size_t idx, const float r, const float g, const float b)
Set XYZ_RGBf coordinates of i'th point.
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.
PointCloudAdapter(const pcl::PointCloud< pcl::PointXYZRGB > &obj)
Constructor (accept a const ref for convenience)
pcl::PointCloud< pcl::PointXYZRGB > & m_obj
GLdouble GLdouble GLdouble r
pcl::PointCloud< pcl::PointXYZ > & m_obj
void getPointRGBf(const size_t idx, float &r, float &g, float &b) const
Get RGBf color of i'th point.
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.
void getPointRGBu8(const size_t idx, uint8_t &r, uint8_t &g, uint8_t &b) const
Get RGBu8 color of i'th point.
float coords_t
The type of each point XYZ coordinates.
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.
PointCloudAdapter(const pcl::PointCloud< pcl::PointXYZ > &obj)
Constructor (accept a const ref for convenience)
void resize(const size_t N)
Set number of points (to uninitialized values)
void setPointRGBf(const size_t idx, const float r, const float g, const float b)
Set XYZ_RGBf coordinates of i'th point.
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.
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.
float coords_t
The type of each point XYZ coordinates.
void getPointXYZ(const size_t idx, T &x, T &y, T &z) const
Get XYZ coordinates of i'th point.
size_t size() const
Get number of points.
size_t size() const
Get number of points.
A helper base class for those PointCloudAdapter<> which do not handle RGB data; it declares needed in...
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.
float coords_t
The type of each point XYZ coordinates.
void setInvalidPoint(const size_t idx)
Set Invalid Point.
size_t size() const
Get number of points.
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 | |