2021SC@SDUSC
PointCloud.h
注释中文部分是源码解读,分析和问题在源码之后
#include <Eigen/Core>
#include <memory>
#include <tuple>
#include <vector>
#include "open3d/geometry/Geometry3D.h"
#include "open3d/geometry/KDTreeSearchParam.h"
namespace open3d {
namespace camera {
class PinholeCameraIntrinsic;
}
namespace geometry {
//这些类之后会分析到
class Image;
class RGBDImage;
class TriangleMesh;
class VoxelGrid;
// 点云类class PointCloud
// 点云由点坐标、点颜色和点法线(可选)组成
class PointCloud : public Geometry3D {
public:
// 默认构造函数
PointCloud() : Geometry3D(Geometry::GeometryType::PointCloud) {
}
// 参数化构造函数。输入值为点坐标
PointCloud(const std::vector<Eigen::Vector3d> &points)
: Geometry3D(Geometry::GeometryType::PointCloud), points_(points) {
}
//析构函数覆盖
~PointCloud() override {
}
public:
// 清除几何图形中的所有元素
PointCloud &Clear() override;
// 如果几何体为空,则返回'true'。
bool IsEmpty() const override;
// 返回几何体坐标的最小边界。
Eigen::Vector3d GetMinBound() const override;
// 返回几何体坐标的最大边界。
Eigen::Vector3d GetMaxBound() const override;
// 返回几何体坐标的中心。
Eigen::Vector3d GetCenter() const override;
// 返回几何体的轴对齐边界框。
AxisAlignedBoundingBox GetAxisAlignedBoundingBox() const override;
// 返回几何图形的定向边界框。
OrientedBoundingBox GetOrientedBoundingBox() const override;
// 将变换(4x4矩阵)应用于几何坐标。
PointCloud &Transform(const Eigen::Matrix4d &transformation) override;
// 将平移应用于几何体坐标。
PointCloud &Translate(const Eigen::Vector3d &translation,
bool relative = true) override;
// 对几何体坐标应用缩放
PointCloud &Scale(const double scale,
const Eigen::Vector3d ¢er) override;
//将旋转应用于几何体坐标和法线。
PointCloud &Rotate(const Eigen::Matrix3d &R,
const Eigen::Vector3d ¢er) override;
//重载&#