1. 新增CloudUtils静态库与相关CMake配置 2. 重构VrUtils构建脚本,修正编译选项与依赖 3. 为Windows平台添加utf-8编译选项 4. 扩展PointCloudGLWidget功能:新增点云移除、选择信息叠加、增量相机适配 5. 优化点云添加接口,支持不重置相机视图 6. 修正激光数据保存时的DataType输出 7. 为Point3D结构体添加单位注释 8. 调整鼠标交互逻辑,统一按键操作行为
55 lines
1.4 KiB
C++
55 lines
1.4 KiB
C++
#ifndef CLOUD_VIEW_3D_TYPES_H
|
|
#define CLOUD_VIEW_3D_TYPES_H
|
|
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
#include <vector>
|
|
|
|
struct Point3D
|
|
{
|
|
float x, y, z; // millimetres
|
|
Point3D() : x(0), y(0), z(0) {}
|
|
Point3D(float _x, float _y, float _z) : x(_x), y(_y), z(_z) {}
|
|
};
|
|
|
|
struct Point3DRGB
|
|
{
|
|
float x, y, z; // millimetres
|
|
uint8_t r, g, b;
|
|
float pointSize;
|
|
|
|
Point3DRGB() : x(0), y(0), z(0), r(255), g(255), b(255), pointSize(0) {}
|
|
Point3DRGB(float _x,
|
|
float _y,
|
|
float _z,
|
|
uint8_t _r = 255,
|
|
uint8_t _g = 255,
|
|
uint8_t _b = 255,
|
|
float _ps = 0)
|
|
: x(_x), y(_y), z(_z), r(_r), g(_g), b(_b), pointSize(_ps) {}
|
|
};
|
|
|
|
template<typename PointT>
|
|
class SimplePointCloud
|
|
{
|
|
public:
|
|
std::vector<PointT> points;
|
|
std::vector<int> lineIndices;
|
|
|
|
void clear() { points.clear(); lineIndices.clear(); }
|
|
size_t size() const { return points.size(); }
|
|
bool empty() const { return points.empty(); }
|
|
void reserve(size_t n) { points.reserve(n); lineIndices.reserve(n); }
|
|
void push_back(const PointT& pt) { points.push_back(pt); }
|
|
void push_back(const PointT& pt, int lineIdx)
|
|
{
|
|
points.push_back(pt);
|
|
lineIndices.push_back(lineIdx);
|
|
}
|
|
};
|
|
|
|
using PointCloudXYZ = SimplePointCloud<Point3D>;
|
|
using PointCloudXYZRGB = SimplePointCloud<Point3DRGB>;
|
|
|
|
#endif // CLOUD_VIEW_3D_TYPES_H
|