-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmainwindow.cpp
82 lines (69 loc) · 1.84 KB
/
mainwindow.cpp
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
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QString>
#include <QDebug>
#include <QDoubleValidator>
#include <QGraphicsView>
#include <QGraphicsScene>
#include <QPixmap>
#include <QGraphicsPixmapItem>
#include <cstdlib>
#include "BasicOperations.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_concatenate_clicked()
{
m_dialog.exec();
}
void MainWindow::on_showMesh_clicked()
{
#ifdef __linux__
std::string command("./mesh_viewer output.ply");
#else
std::string command("mesh_viewer.exe output.ply");
#endif
qDebug() << "[INF] Show Mesh Command: " << command.c_str();
std::system(command.c_str());
}
void MainWindow::on_startScan_clicked()
{
#ifdef __linux__
std::string command("./grab_points");
#else
std::string command("grab_points.exe");
#endif
qDebug() << "[INF] Start Scan Command: " << command.c_str();
std::system(command.c_str());
}
void MainWindow::on_crop_clicked()
{
#ifdef __linux__ /* Linux */
std::string command("./process_points output");
#else
std::string command("process_points.exe output");
#endif
qDebug() << "[INF] Crop Clouds Command: " << command.c_str();
std::system(command.c_str());
}
void MainWindow::on_showPoints_clicked()
{
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZRGBA>);
if (pcl::io::loadPCDFile<pcl::PointXYZRGBA> ("output.pcd", *cloud) == -1) //* load the file
{
std::string msg("[ERR] Couldn't read file output.pcd\n");
qDebug() << msg.c_str();
return;
}
pcl::visualization::CloudViewer viewer("Point Cloud Viewer");
while (!viewer.wasStopped()) {
viewer.showCloud(cloud);
}
}