cpp-toolbox  0.0.1
A toolbox library for C++
Loading...
Searching...
No Matches
toolbox::types::point_cloud_t< T > Class Template Reference

包含点和相关数据的点云类 / A point cloud class containing points and associated data More...

#include <point.hpp>

Inheritance diagram for toolbox::types::point_cloud_t< T >:

Public Member Functions

 ~point_cloud_t ()=default
 
 point_cloud_t ()
 
 point_cloud_t (const point_cloud_t &other)
 
 point_cloud_t (point_cloud_t &&other) noexcept
 
point_cloud_toperator= (const point_cloud_t &other)
 
point_cloud_toperator= (point_cloud_t &&other) noexcept
 
auto size () const -> std::size_t
 获取点云中的点数 / Get number of points in cloud
 
auto empty () const -> bool
 检查点云是否为空 / Check if cloud is empty
 
void clear ()
 清除点云中的所有数据 / Clear all data from cloud
 
void reserve (const std::size_t &required_size)
 为点预留内存 / Reserve memory for points
 
auto operator+ (const point_cloud_t &other) const -> point_cloud_t
 合并两个点云 / Add two point clouds
 
auto operator+ (const point_t< T > &point) const -> point_cloud_t
 向点云添加点 / Add point to cloud
 
auto operator+ (point_t< T > &&point) const -> point_cloud_t
 向点云添加点(移动版本) / Add point to cloud (move version)
 
auto operator+ (point_cloud_t &&other) const -> point_cloud_t
 合并两个点云(移动版本) / Add two point clouds (move version)
 
point_cloud_toperator+= (const point_t< T > &point)
 向点云添加点 / Add point to cloud
 
point_cloud_toperator+= (point_t< T > &&point)
 向点云添加点(移动版本) / Add point to cloud (move version)
 
point_cloud_toperator+= (const point_cloud_t &other)
 合并另一个点云到当前点云 / Add another cloud to this one
 
point_cloud_toperator+= (point_cloud_t &&other)
 合并另一个点云到当前点云(移动版本) / Add another cloud to this one (move version)
 
- Public Member Functions inherited from toolbox::io::base_file_data_t
virtual ~base_file_data_t ()=default
 
 base_file_data_t (const base_file_data_t &)=default
 
base_file_data_toperator= (const base_file_data_t &)=default
 
 base_file_data_t (base_file_data_t &&)=default
 
base_file_data_toperator= (base_file_data_t &&)=default
 

Public Attributes

std::vector< point_t< T > > points
 点坐标 / Point coordinates
 
std::vector< point_t< T > > normals
 点法线(可选) / Point normals (optional)
 
std::vector< point_t< T > > colors
 点颜色(可选) / Point colors (optional)
 
intensity
 全局强度值 / Global intensity value
 

Additional Inherited Members

- Protected Member Functions inherited from toolbox::io::base_file_data_t
 base_file_data_t ()=default
 

Detailed Description

template<typename T>
class toolbox::types::point_cloud_t< T >

包含点和相关数据的点云类 / A point cloud class containing points and associated data

Template Parameters
T点坐标的数值类型 / The numeric type for point coordinates

该类表示3D点的集合,可选包含法线、颜色和强度数据。/ This class represents a collection of 3D points with optional normals, colors and intensity data.

// 创建点云 / Create point cloud
// 添加点 / Add points
cloud += point_t<double>(1.0, 2.0, 3.0);
cloud += point_t<double>(4.0, 5.0, 6.0);
// 访问数据 / Access data
std::size_t num_points = cloud.size();
point_t<double> first_point = cloud.points[0];
// 合并点云 / Merge clouds
cloud2 += point_t<double>(7.0, 8.0, 9.0);
auto merged = cloud + cloud2;
包含点和相关数据的点云类 / A point cloud class containing points and associated data
Definition point.hpp:268
std::vector< point_t< T > > points
点坐标 / Point coordinates
Definition point.hpp:270
auto size() const -> std::size_t
获取点云中的点数 / Get number of points in cloud
Definition point_impl.hpp:293
3D点/向量模板类 / A 3D point/vector template class
Definition point.hpp:48

Constructor & Destructor Documentation

◆ ~point_cloud_t()

template<typename T >
toolbox::types::point_cloud_t< T >::~point_cloud_t ( )
default

◆ point_cloud_t() [1/3]

template<typename T >
toolbox::types::point_cloud_t< T >::point_cloud_t ( )

◆ point_cloud_t() [2/3]

template<typename T >
toolbox::types::point_cloud_t< T >::point_cloud_t ( const point_cloud_t< T > &  other)

◆ point_cloud_t() [3/3]

template<typename T >
toolbox::types::point_cloud_t< T >::point_cloud_t ( point_cloud_t< T > &&  other)
noexcept

Member Function Documentation

◆ clear()

template<typename T >
void toolbox::types::point_cloud_t< T >::clear ( )

清除点云中的所有数据 / Clear all data from cloud

◆ empty()

template<typename T >
auto toolbox::types::point_cloud_t< T >::empty ( ) const -> bool

检查点云是否为空 / Check if cloud is empty

Returns
如果为空返回true,否则返回false / true if empty, false otherwise

◆ operator+() [1/4]

template<typename T >
auto toolbox::types::point_cloud_t< T >::operator+ ( const point_cloud_t< T > &  other) const -> point_cloud_t

合并两个点云 / Add two point clouds

Parameters
other要合并的点云 / Cloud to add
Returns
新的合并后的点云 / New combined cloud

◆ operator+() [2/4]

template<typename T >
auto toolbox::types::point_cloud_t< T >::operator+ ( const point_t< T > &  point) const -> point_cloud_t

向点云添加点 / Add point to cloud

Parameters
point要添加的点 / Point to add
Returns
添加点后的新点云 / New cloud with added point

◆ operator+() [3/4]

template<typename T >
auto toolbox::types::point_cloud_t< T >::operator+ ( point_cloud_t< T > &&  other) const -> point_cloud_t

合并两个点云(移动版本) / Add two point clouds (move version)

Parameters
other要合并的点云 / Cloud to add
Returns
新的合并后的点云 / New combined cloud

◆ operator+() [4/4]

template<typename T >
auto toolbox::types::point_cloud_t< T >::operator+ ( point_t< T > &&  point) const -> point_cloud_t

向点云添加点(移动版本) / Add point to cloud (move version)

Parameters
point要添加的点 / Point to add
Returns
添加点后的新点云 / New cloud with added point

◆ operator+=() [1/4]

template<typename T >
point_cloud_t< T > & toolbox::types::point_cloud_t< T >::operator+= ( const point_cloud_t< T > &  other)

合并另一个点云到当前点云 / Add another cloud to this one

Parameters
other要合并的点云 / Cloud to add
Returns
对本点云的引用 / Reference to this cloud

◆ operator+=() [2/4]

template<typename T >
point_cloud_t< T > & toolbox::types::point_cloud_t< T >::operator+= ( const point_t< T > &  point)

向点云添加点 / Add point to cloud

Parameters
point要添加的点 / Point to add
Returns
对本点云的引用 / Reference to this cloud

◆ operator+=() [3/4]

template<typename T >
point_cloud_t< T > & toolbox::types::point_cloud_t< T >::operator+= ( point_cloud_t< T > &&  other)

合并另一个点云到当前点云(移动版本) / Add another cloud to this one (move version)

Parameters
other要合并的点云 / Cloud to add
Returns
对本点云的引用 / Reference to this cloud

◆ operator+=() [4/4]

template<typename T >
point_cloud_t< T > & toolbox::types::point_cloud_t< T >::operator+= ( point_t< T > &&  point)

向点云添加点(移动版本) / Add point to cloud (move version)

Parameters
point要添加的点 / Point to add
Returns
对本点云的引用 / Reference to this cloud

◆ operator=() [1/2]

template<typename T >
point_cloud_t< T > & toolbox::types::point_cloud_t< T >::operator= ( const point_cloud_t< T > &  other)

◆ operator=() [2/2]

template<typename T >
point_cloud_t< T > & toolbox::types::point_cloud_t< T >::operator= ( point_cloud_t< T > &&  other)
noexcept

◆ reserve()

template<typename T >
void toolbox::types::point_cloud_t< T >::reserve ( const std::size_t &  required_size)

为点预留内存 / Reserve memory for points

Parameters
required_size要预留空间的点数 / Number of points to reserve space for

◆ size()

template<typename T >
auto toolbox::types::point_cloud_t< T >::size ( ) const -> std::size_t

获取点云中的点数 / Get number of points in cloud

Returns
点的数量 / Number of points

Member Data Documentation

◆ colors

template<typename T >
std::vector<point_t<T> > toolbox::types::point_cloud_t< T >::colors

点颜色(可选) / Point colors (optional)

◆ intensity

template<typename T >
T toolbox::types::point_cloud_t< T >::intensity

全局强度值 / Global intensity value

◆ normals

template<typename T >
std::vector<point_t<T> > toolbox::types::point_cloud_t< T >::normals

点法线(可选) / Point normals (optional)

◆ points

template<typename T >
std::vector<point_t<T> > toolbox::types::point_cloud_t< T >::points

点坐标 / Point coordinates


The documentation for this class was generated from the following files: