-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmain_window.h
134 lines (94 loc) · 2.74 KB
/
main_window.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
//
// Created by Ryan Shen on 2018/11/6.
//
#ifndef PCL_TRIANGULATION_PCL_VISUALIZER_H
#define PCL_TRIANGULATION_PCL_VISUALIZER_H
#include <QtGlobal>
#ifdef Q_OS_MACOS
#include <Carbon/Carbon.h>
#include <ApplicationServices/ApplicationServices.h>
#endif
// Visualization Toolkit
// VTK build from source with OpenGL2 Rendering
// These code are not necessary on macOS
//#include <vtkAutoInit.h>
//VTK_MODULE_INIT(vtkRenderingOpenGL2);
//VTK_MODULE_INIT(vtkInteractionStyle);
#include <vtkRenderWindow.h>
#include <iostream>
#include <vector>
#include <QFileDialog>
#include <QtWidgets/QWidget>
#include <QMessageBox>
#include <QDateTime>
#include <QtWidgets/QMainWindow>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <pcl/point_cloud.h>
#include <pcl/visualization/pcl_visualizer.h>
#include <pcl/exceptions.h>
#include <pcl/visualization/cloud_viewer.h>
#include <pcl/segmentation/region_growing_rgb.h>
#include "tool/triangulation.h"
#include "tool/classifier.h"
#include "tool/projection.h"
#include "tool/resampling.h"
#include "tool/filter.h"
#include "tool/utils.h"
#include "tool/io.h"
#include "pojo/MyException.h"
#include "pojo/MyPointCloud.h"
#include "ui_main_window.h"
class MainWindow : public QMainWindow {
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private:
Ui::MainWindow ui;
// 存储点云数据
MyPointCloud myPointCloud;
std::vector<MyPointCloud> cloud_vector;
long points_number = 0;
boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer;
// 存储mesh数据
pcl::PolygonMesh mesh;
boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer_mesh;
// 初始化
void Initial();
// 点云区域框选
static void pp_callback(const pcl::visualization::AreaPickingEvent &event, void *args);
// 更新viewer
void updateViewer(boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer);
private slots:
// File
void OpenFile();
void SaveFile();
void Clear();
void Exit();
// View point
void MainView();
void LeftView();
void TopView();
// View
void OpenPointsViewer();
// Algorithm Function
void DisplayTriangles(int type);
void DisplayProjection();
void GetResample();
// Filter
void openFilterPanel(int type);
void FilterPassThrough();
void FilterStatisticalOutlierRemoval();
void toggleSelectPoints(bool isToggle);
// remove points
void RemoveSelectPoints();
// Region Growing
void RegionGrowing();
void RegionGrowingRGB();
// 控制Config面板开关
void openRegionGrowingPanel(bool isBasic);
// Console print
void SaveLog(QString operation, QString note);
};
#endif //PCL_TRIANGULATION_PCL_VISUALIZER_H