55 lines
1.4 KiB
C++
55 lines
1.4 KiB
C++
#ifndef CCLOUDSHOW_H
|
|
#define CCLOUDSHOW_H
|
|
|
|
#include <pcl/point_types.h>
|
|
#include <pcl/point_cloud.h>
|
|
#include <pcl/visualization/pcl_visualizer.h>
|
|
|
|
#include <atomic>
|
|
#include <mutex>
|
|
#include <string>
|
|
|
|
#include "ICloudShow.h"
|
|
|
|
class vtkOrientationMarkerWidget;
|
|
|
|
class CCloudShow : public ICloudShow
|
|
{
|
|
public:
|
|
CCloudShow();
|
|
~CCloudShow() override;
|
|
|
|
int Show(ICloudShow::PointCloudPtr cloud, const std::string& windowName = "PointCloud") override;
|
|
int Start(const std::string& windowName = "PointCloud") override;
|
|
int UpdateCloud(PointCloudPtr cloud) override;
|
|
int Stop() override;
|
|
int SpinOnce(int ms = 1) override;
|
|
bool IsRunning() const override;
|
|
|
|
int SaveToTxt(const std::string& fileName, PointCloudPtr cloud) override;
|
|
|
|
bool IsQuitRequested() const override;
|
|
bool IsSaveRequested() const override;
|
|
void ClearSaveRequest() override;
|
|
|
|
private:
|
|
static void keyboardCallback(const pcl::visualization::KeyboardEvent& event, void* cookie);
|
|
|
|
std::shared_ptr<pcl::visualization::PCLVisualizer> m_viewer;
|
|
|
|
std::atomic<bool> m_bRunning{false};
|
|
std::mutex m_cloudMutex;
|
|
|
|
ICloudShow::PointCloudPtr m_currentCloud;
|
|
bool m_bUpdated = false;
|
|
bool m_bFirstCloud = true;
|
|
std::string m_windowName;
|
|
|
|
vtkOrientationMarkerWidget* m_axesWidget = nullptr;
|
|
|
|
std::atomic<bool> m_bQuitRequested{false};
|
|
std::atomic<bool> m_bSaveRequested{false};
|
|
};
|
|
|
|
#endif // CCLOUDSHOW_H
|