-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpclviewer.h
88 lines (66 loc) · 1.71 KB
/
pclviewer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#ifndef PCLVIEWER_H
#define PCLVIEWER_H
// Qt
#include <QMainWindow>
#include <QFileDialog>
#include <QProgressDialog>
#include <QFuture>
#include <QFutureWatcher>
#include <QtConcurrentRun>
// Point Cloud Library
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl/io/ply_io.h>
#include <pcl/io/pcd_io.h>
#include <pcl/filters/filter.h>
#include <pcl/visualization/pcl_visualizer.h>
#include <pcl/visualization/point_cloud_color_handlers.h>
// Boost
#include <boost/math/special_functions/round.hpp>
// Visualization Toolkit (VTK)
#include <vtkRenderWindow.h>
typedef pcl::PointXYZRGBA PointT;
typedef pcl::PointCloud<PointT> PointCloudT;
namespace Ui
{
class PCLViewer;
}
class PCLViewer : public QMainWindow
{
Q_OBJECT
public:
/** @brief Constructor */
explicit
PCLViewer (QWidget *parent = 0);
/** @brief Destructor */
~PCLViewer ();
public slots:
void
browseFileButtonPressed ();
/** @brief Triggered whenever the "Load file" button is clicked */
void
loadFileButtonPressed ();
/** @brief Triggered whenever a button in the "Color mode" group is clicked */
void
colorSelected ();
void
pSliderValueChanged (int value);
protected:
/** @brief The PCL visualizer object */
boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer_;
/** @brief The point cloud displayed */
PointCloudT::Ptr cloud_;
void
addOrUpdateCloud(pcl::visualization::PointCloudColorHandler<pcl::PointXYZRGBA> &handler);
void
load (QString &filename);
void
loadAsync (QString &filename);
void
paintCloud();
private:
/** @brief ui pointer */
Ui::PCLViewer *ui;
bool first_time;
};
#endif // PCLVIEWER_H