open3D源码分析第四篇

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 &center) override;
    //将旋转应用于几何体坐标和法线。
    PointCloud &Rotate(const Eigen::Matrix3d &R,
                       const Eigen::Vector3d &center) override;
	//重载&#
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值