9 #ifndef CSimplePointsMap_H
10 #define CSimplePointsMap_H
22 class CObservation2DRangeScan;
23 class CObservation3DRangeScan;
42 virtual ~CSimplePointsMap();
52 virtual
void reserve(
size_t newLength);
58 virtual
void resize(
size_t newLength);
64 virtual
void setSize(
size_t newLength);
67 virtual
void setPointFast(
size_t index,
float x,
float y,
float z);
70 virtual
void insertPointFast(
float x,
float y,
float z = 0 );
74 virtual
void copyFrom(const CPointsMap &obj);
80 virtual
void getPointAllFieldsFast( const
size_t index,
std::vector<
float> & point_data )
const {
82 point_data[0] = x[index];
83 point_data[1] = y[index];
84 point_data[2] = z[index];
93 x[index] = point_data[0];
94 y[index] = point_data[1];
95 z[index] = point_data[2];
99 virtual void loadFromRangeScan(
101 const CPose3D *robotPose = NULL );
104 virtual void loadFromRangeScan(
106 const CPose3D *robotPose = NULL );
137 virtual void internal_clear();
142 virtual void PLY_import_set_vertex_count(
const size_t N);
159 static const int HAS_RGB = 0;
160 static const int HAS_RGBf = 0;
161 static const int HAS_RGBu8 = 0;
166 inline size_t size()
const {
return m_obj.
size(); }
171 template <
typename T>
172 inline void getPointXYZ(
const size_t idx, T &x,T &y, T &z)
const {
176 inline void setPointXYZ(
const size_t idx,
const coords_t x,
const coords_t y,
const coords_t z) {
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
void getPointFast(size_t index, float &x, float &y, float &z) const
Just like getPoint() but without checking out-of-bound index and without returning the point weight...
A helper base class for those PointCloudAdapter<> which do not handle RGB data; it declares needed in...
virtual void setPointFast(size_t index, float x, float y, float z)
Changes the coordinates of the given point (0-based index), without checking for out-of-bounds and wi...
virtual void addFrom_classSpecific(const CPointsMap &anotherMap, const size_t nPreviousPoints)
Auxiliary method called from within addFrom() automatically, to finish the copying of class-specific ...
size_t size() const
Returns the number of stored points in the map.
float coords_t
The type of each point XYZ coordinates.
size_t size() const
Get number of points.
virtual CSimplePointsMap * getAsSimplePointsMap()
void getPointXYZ(const size_t idx, T &x, T &y, T &z) const
Get XYZ 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.
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
mrpt::slam::CSimplePointsMap & m_obj
virtual void resize(size_t newLength)
Resizes all point buffers so they can hold the given number of points: newly created points are set t...
EIGEN_STRONG_INLINE void setSize(size_t row, size_t col)
Changes the size of matrix, maintaining its previous content as possible and padding with zeros where...
PointCloudAdapter(const mrpt::slam::CSimplePointsMap &obj)
Constructor (accept a const ref for convenience)
virtual const CSimplePointsMap * getAsSimplePointsMap() const
If the map is a simple points map or it's a multi-metric map that contains EXACTLY one simple points ...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
An adapter to different kinds of point cloud object.
#define ASSERTDEB_(f)
Defines an assertion mechanism - only when compiled in debug.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
virtual void setPointAllFieldsFast(const size_t index, const std::vector< float > &point_data)
Set all the data fields for one point as a vector: [X Y Z] Unlike setPointAllFields(), this method does not check for index out of bounds.
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans or other sensors...
Declares a class derived from "CObservation" that encapsules a 3D range scan measurement (e...
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans. ...
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
void resize(const size_t N)
Set number of points (to uninitialized values)