Subversion Repositories seema-scanner

Rev

Rev 208 | Rev 225 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 208 Rev 217
1
#ifndef SMSCANNER_H
1
#ifndef SMSCANNER_H
2
#define SMSCANNER_H
2
#define SMSCANNER_H
3
 
3
 
4
#include <QMainWindow>
4
#include <QMainWindow>
5
#include <QSettings>
5
#include <QSettings>
6
#include <QThread>
6
#include <QThread>
7
#include <QCloseEvent>
7
#include <QCloseEvent>
8
#include <QModelIndex>
8
#include <QModelIndex>
9
#include <QListWidgetItem>
9
#include <QListWidgetItem>
10
 
10
 
11
#include "SMPreferenceDialog.h"
11
#include "SMPreferenceDialog.h"
12
#include "SMCaptureWorker.h"
12
#include "SMCaptureWorker.h"
13
#include "SMCalibrationWorker.h"
13
#include "SMCalibrationWorker.h"
14
#include "SMReconstructionWorker.h"
14
#include "SMReconstructionWorker.h"
15
#include "SMMeshingWorker.h"
15
//#include "SMMeshingWorker.h"
16
 
16
 
17
#include <opencv2/opencv.hpp>
17
#include <opencv2/opencv.hpp>
18
#include <pcl/point_cloud.h>
18
#include <pcl/point_cloud.h>
19
#include <pcl/point_types.h>
19
#include <pcl/point_types.h>
20
 
20
 
21
 
21
 
22
namespace Ui {
22
namespace Ui {
23
    class SMScanner;
23
    class SMScanner;
24
}
24
}
25
 
25
 
26
class SMScanner : public QMainWindow{
26
class SMScanner : public QMainWindow{
27
    Q_OBJECT
27
    Q_OBJECT
28
 
28
 
29
    public:
29
    public:
30
        explicit SMScanner(QWidget *parent = 0);
30
        explicit SMScanner(QWidget *parent = 0);
31
        void closeEvent(QCloseEvent *event);
31
        void closeEvent(QCloseEvent *event);
32
        ~SMScanner();
32
        ~SMScanner();
33
 
33
 
34
    private slots:
34
    private slots:
35
        void on_actionPreferences_triggered();
35
        void on_actionPreferences_triggered();
36
        void onPreferencesChanged();
36
        void onPreferencesChanged();
37
 
37
 
38
        void onReceiveFrame(unsigned int camId, cv::Mat frame);
38
        void onReceiveFrame(unsigned int camId, cv::Mat frame);
39
        void onReceiveCalibrationSet(SMCalibrationSet calibrationSet);
39
        void onReceiveCalibrationSet(SMCalibrationSet calibrationSet);
40
        void onReceiveFrameSequence(SMFrameSequence frameSequence);
40
        void onReceiveFrameSequence(SMFrameSequence frameSequence);
41
        void onReceiveRotatedTo(float angle);
41
        void onReceiveRotatedTo(float angle);
42
 
42
 
43
        void onCalibrationSetProcessed(int idx);
43
        void onCalibrationSetProcessed(int idx);
44
        void onCalibrationFrameResult(int idx, int camID, bool success, cv::Mat result);
44
        void onCalibrationFrameResult(int idx, int camID, bool success, cv::Mat result);
45
 
45
 
46
        void on_singleCalibrationButton_clicked();
46
        void on_singleCalibrationButton_clicked();
47
 
47
 
48
        void on_calibrateButton_clicked();
48
        void on_calibrateButton_clicked();
49
 
49
 
50
        void onCalibrationDone();
50
        void onCalibrationDone();
51
        void on_calibrationListWidget_itemSelectionChanged();
51
        void on_calibrationListWidget_itemSelectionChanged();
52
 
52
 
53
        void on_singleCaptureButton_clicked();
53
        void on_singleCaptureButton_clicked();
54
 
54
 
55
 
55
 
56
        void on_calibrationRotationDial_sliderReleased();
56
        void on_calibrationRotationDial_sliderReleased();
57
 
57
 
58
        void on_captureRotationDial_sliderReleased();
58
        void on_captureRotationDial_sliderReleased();
59
 
59
 
60
        void on_captureTreeWidget_itemSelectionChanged();
60
        void on_captureTreeWidget_itemSelectionChanged();
61
 
61
 
62
        void on_batchCalibrationButton_clicked();
62
        void on_batchCalibrationButton_clicked();
63
 
63
 
64
        void on_batchCaptureButton_clicked();
64
        void on_batchCaptureButton_clicked();
65
 
65
 
66
        void on_actionExport_Sets_triggered();
66
        void on_actionExport_Sets_triggered();
67
 
67
 
68
        void on_actionExport_Sequences_triggered();
68
        void on_actionExport_Sequences_triggered();
69
 
69
 
70
        void on_reconstructButton_clicked();
70
        void on_reconstructButton_clicked();
71
        void on_meshButton_clicked();
71
        void on_meshButton_clicked();
72
 
72
 
73
        void onReceivePointCloud(SMPointCloud pc);
73
        void onReceivePointCloud(SMPointCloud pc);
74
 
74
 
75
        void on_actionExport_Point_Clouds_triggered();
75
        void on_actionExport_Point_Clouds_triggered();
76
 
76
 
77
        void on_pointCloudsListWidget_itemChanged(QListWidgetItem *item);
77
        void on_pointCloudsListWidget_itemChanged(QListWidgetItem *item);
78
 
78
 
79
        void on_actionExport_Parameters_triggered();
79
        void on_actionExport_Parameters_triggered();
80
 
80
 
81
        void on_actionClear_Sequences_triggered();
81
        void on_actionClear_Sequences_triggered();
82
 
82
 
83
        void on_actionExport_White_Frames_triggered();
83
        void on_actionExport_White_Frames_triggered();
84
 
84
 
85
        void on_actionImport_Parameters_triggered();
85
        void on_actionImport_Parameters_triggered();
86
 
86
 
87
        void on_actionImport_Sets_triggered();
87
        void on_actionImport_Sets_triggered();
88
 
88
 
89
        void on_actionImport_Sequences_triggered();
89
        void on_actionImport_Sequences_triggered();
90
 
90
 
91
        void on_actionClear_Point_Clouds_triggered();
91
        void on_actionClear_Point_Clouds_triggered();
92
 
92
 
93
        void on_calibrationRotationSpinBox_editingFinished();
93
        void on_calibrationRotationSpinBox_editingFinished();
94
 
94
 
95
        void on_captureRotationSpinBox_editingFinished();
95
        void on_captureRotationSpinBox_editingFinished();
96
 
96
 
97
        void on_actionProject_Focusing_Pattern_triggered();
97
        void on_actionProject_Focusing_Pattern_triggered();
98
 
98
 
99
private:
99
private:
100
        Ui::SMScanner *ui;
100
        Ui::SMScanner *ui;
101
 
101
 
102
        QSettings settings;
102
        QSettings settings;
103
 
103
 
104
        SMPreferenceDialog preferenceDialog;
104
        SMPreferenceDialog preferenceDialog;
105
 
105
 
106
        SMCaptureWorker *captureWorker;
106
        SMCaptureWorker *captureWorker;
107
        QThread *captureWorkerThread;
107
        QThread *captureWorkerThread;
108
 
108
 
109
        SMCalibrationWorker *calibrationWorker;
109
        SMCalibrationWorker *calibrationWorker;
110
        QThread *calibrationWorkerThread;
110
        QThread *calibrationWorkerThread;
111
 
111
 
112
        SMReconstructionWorker *reconstructionWorker;
112
        SMReconstructionWorker *reconstructionWorker;
113
        QThread *reconstructionWorkerThread;
113
        QThread *reconstructionWorkerThread;
114
 
114
 
115
        SMMeshingWorker *meshWorker;
115
        //SMMeshingWorker *meshWorker;
116
        QThread *meshWorkerThread;
116
        QThread *meshWorkerThread;
117
 
117
 
118
        std::vector< SMCalibrationSet > calibrationData;
118
        std::vector< SMCalibrationSet > calibrationData;
119
        std::vector< SMFrameSequence > captureData;
119
        std::vector< SMFrameSequence > captureData;
120
        std::vector< SMPointCloud > pointCloudData;
120
        std::vector< SMPointCloud > pointCloudData;
121
 
121
 
122
        bool calibrationReviewMode;
122
        bool calibrationReviewMode;
123
        bool captureReviewMode;
123
        bool captureReviewMode;
124
        int lastCaptureId;
124
        int lastCaptureId;
125
};
125
};
126
 
126
 
127
#endif // SMSCANNER_H
127
#endif // SMSCANNER_H
128
 
128