Go to the documentation of this file.
139 const std::vector<float>&
x,
const std::vector<float>&
y,
140 const std::vector<float>&
z)
152 std::vector<float>&
x, std::vector<float>&
y, std::vector<float>&
z)
206 void setPoint(
size_t i,
const float x,
const float y,
const float z);
210 size_t i,
const float x,
const float y,
const float z)
221 template <
class POINTSMAP>
227 template <
class LISTOFPOINTS>
231 const size_t N = pointsList.size();
239 for (idx = 0, it = pointsList.begin(); idx < N; ++idx, ++it)
285 void render()
const override;
289 const bool all,
const std::vector<size_t>& idxs,
290 const float render_area_sqpixels)
const;
324 static const int HAS_RGB = 0;
326 static const int HAS_RGBf = 0;
328 static const int HAS_RGBu8 = 0;
336 inline size_t size()
const {
return m_obj.
size(); }
340 template <
typename T>
363 template <
class POINTSMAP>
369 const size_t N = pc_src.size();
371 for (
size_t i = 0; i < N; i++)
374 pc_src.getPointXYZ(i,
x,
y,
z);
375 pc_dst.setPointXYZ(i,
x,
y,
z);
Lightweight 3D point (float version).
An adapter to different kinds of point cloud object.
mrpt::img::TColorf m_col_slop_inv
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.
void setInvalidPoint(const size_t idx)
Set XYZ coordinates of i'th point.
const Scalar * const_iterator
void setAllPointsFast(std::vector< float > &x, std::vector< float > &y, std::vector< float > &z)
Set the list of (X,Y,Z) point coordinates, DESTROYING the contents of the input vectors (via swap)
const std::vector< float > & getArrayX() const
Get a const reference to the internal array of X coordinates.
const std::vector< float > & getArrayY() const
Get a const reference to the internal array of Y coordinates.
CPointCloud()
Constructor.
mrpt::math::TPoint3D operator[](size_t i) const
Read access to each individual point (checks for "i" in the valid range only in Debug).
void clear()
Empty the list of points.
The base class of 3D objects that can be directly rendered through OpenGL.
virtual ~CPointCloud()
Private, virtual destructor: only can be deleted from smart pointers.
void render() const override
Render.
void loadFromPointsMap(const POINTSMAP *themap)
Load the points from any other point map class supported by the adapter mrpt::opengl::PointCloudAdapt...
GLsizei GLsizei GLuint * obj
void setGradientColors(const mrpt::img::TColorf &colorMin, const mrpt::img::TColorf &colorMax)
Sets the colors used as extremes when colorFromDepth is enabled.
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 MRPT_UNUSED_PARAM(a)
Determines whether this is an X86 or AMD64 platform.
float m_min
Buffer for min/max coords when m_colorFromDepth is true.
size_t size() const
Get number of points.
mrpt::img::TColorf m_colorFromDepth_min
The colors used to interpolate when m_colorFromDepth is true.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void getPointXYZ(const size_t idx, T &x, T &y, T &z) const
Get XYZ coordinates of i'th point.
#define THROW_EXCEPTION(msg)
#define ASSERT_(f)
Defines an assertion mechanism.
enum mrpt::opengl::CPointCloud::Axis m_colorFromDepth
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.
void setAllPoints(const std::vector< float > &x, const std::vector< float > &y, const std::vector< float > &z)
Set the list of (X,Y,Z) point coordinates, all at once, from three vectors with their coordinates.
void disablePointSmooth()
void markAllPointsAsNew()
Do needed internal work if all points are new (octree rebuilt,...)
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.
volatile size_t m_last_rendered_count_ongoing
float m_pointSize
By default is 1.0.
void enablePointSmooth(bool enable=true)
A virtual base class that implements the capability of exporting 3D point clouds and faces to a file ...
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.
#define ASSERT_BELOW_(__A, __B)
void loadFromPointsList(LISTOFPOINTS &pointsList)
Load the points from a list of mrpt::math::TPoint3D.
const std::vector< float > & getArrayZ() const
Get a const reference to the internal array of Z coordinates.
void resize(const size_t N)
Set number of points (to uninitialized values)
mrpt::img::TColorf m_col_slop
Color linear function slope.
bool isPointSmoothEnabled() const
void setPoint(size_t i, const float x, const float y, const float z)
Write an individual point (checks for "i" in the valid range only in Debug).
std::vector< float > m_zs
void enableColorFromY(bool v=true)
A RGB color - floats in the range [0,1].
size_t PLY_export_get_face_count() const override
In a base class, return the number of faces.
mrpt::img::TColorf m_colorFromDepth_max
size_t PLY_export_get_vertex_count() const override
In a base class, return the number of vertices.
A cloud of points, all with the same color or each depending on its value along a particular coordina...
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)
void internal_render_one_point(size_t i) const
void enableColorFromZ(bool v=true)
void insertPoint(float x, float y, float z)
Adds a new point to the cloud.
size_t getActuallyRendered() const
Get the number of elements actually rendered in the last render event.
A virtual base class that implements the capability of importing 3D point clouds and faces from a fil...
void octree_getBoundingBox(mrpt::math::TPoint3D &bb_min, mrpt::math::TPoint3D &bb_max) const
mrpt::math::TPoint3D getPoint(size_t i) const
Read access to each individual point (checks for "i" in the valid range only in Debug).
void setPointSize(float p)
By default is 1.0.
Template class that implements the data structure and algorithms for Octree-based efficient rendering...
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
mrpt::math::TPoint3Df getPointf(size_t i) const
Read access to each individual point (checks for "i" in the valid range only in Debug).
A helper base class for those PointCloudAdapter<> which do not handle RGB data; it declares needed in...
void reserve(size_t N)
Like STL std::vector's reserve.
void enableColorFromX(bool v=true)
void resize(size_t N)
Set the number of points (with contents undefined)
std::vector< float > m_ys
float coords_t
The type of each point XYZ coordinates.
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...
float getPointSize() const
bool m_pointSmooth
Default: false.
std::vector< float > m_xs
volatile size_t m_last_rendered_count
PointCloudAdapter(const mrpt::opengl::CPointCloud &obj)
Constructor (accept a const ref for convenience)
void setPoint_fast(size_t i, const float x, const float y, const float z)
Write an individual point (without checking validity of the index).
mrpt::opengl::CPointCloud & m_obj
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 | |