#ifndef ICLOUDSHOW_H #define ICLOUDSHOW_H #include "CloudShow_global.h" #include #include #include #include class CLOUDSHOW_EXPORT ICloudShow { public: using PointCloudPtr = pcl::PointCloud::ConstPtr; virtual ~ICloudShow() = default; /// 工厂方法 static std::unique_ptr Create(); /// 单次显示:弹出窗口,按 intensity 着色,阻塞直到关闭窗口 virtual int Show(PointCloudPtr cloud, const std::string& windowName = "PointCloud") = 0; /// 连续显示:非阻塞启动后台渲染线程 virtual int Start(const std::string& windowName = "PointCloud") = 0; /// 更新当前窗口中的点云(连续模式,替换而非叠加) virtual int UpdateCloud(PointCloudPtr cloud) = 0; /// 停止连续显示 virtual int Stop() = 0; /// 消费待更新点云并驱动一次渲染事件(必须与 Start 同线程调用) virtual int SpinOnce(int ms = 1) = 0; /// 是否正在连续显示 virtual bool IsRunning() const = 0; /// 键盘状态查询(PCL 窗口回调设置,主线程轮询) virtual bool IsQuitRequested() const = 0; virtual bool IsSaveRequested() const = 0; virtual void ClearSaveRequest() = 0; /// 保存为 TXT(兼容 LaserDataLoader::DebugSaveLaser 格式) virtual int SaveToTxt(const std::string& fileName, PointCloudPtr cloud) = 0; }; #endif // ICLOUDSHOW_H