Subversion Repositories seema-scanner

Rev

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

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