Subversion Repositories seema-scanner

Rev

Rev 244 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 244 Rev 255
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
#include <QTimer>
10
 
11
 
11
#include "SMPreferenceDialog.h"
12
#include "SMPreferenceDialog.h"
12
#include "SMLogDialog.h"
13
#include "SMLogDialog.h"
-
 
14
#include "SMExportWorker.h"
13
#include "SMCaptureWorker.h"
15
#include "SMCaptureWorker.h"
14
#include "SMCalibrationWorker.h"
16
#include "SMCalibrationWorker.h"
15
#include "SMReconstructionWorker.h"
17
#include "SMReconstructionWorker.h"
16
//#include "SMMeshingWorker.h"
18
//#include "SMMeshingWorker.h"
17
 
19
 
18
#include <opencv2/opencv.hpp>
20
#include <opencv2/opencv.hpp>
19
#include <pcl/point_cloud.h>
21
#include <pcl/point_cloud.h>
20
#include <pcl/point_types.h>
22
#include <pcl/point_types.h>
21
 
23
 
22
 
24
 
23
namespace Ui {
25
namespace Ui {
24
    class SMScanner;
26
    class SMScanner;
25
}
27
}
26
 
28
 
27
class SMScanner : public QMainWindow{
29
class SMScanner : public QMainWindow{
28
    Q_OBJECT
30
    Q_OBJECT
29
 
31
 
30
    public:
32
    public:
31
        explicit SMScanner(QWidget *parent = 0);
33
        explicit SMScanner(QWidget *parent = 0);
32
        void closeEvent(QCloseEvent *event);
34
        void closeEvent(QCloseEvent *event);
33
        ~SMScanner();
35
        ~SMScanner();
34
 
36
 
-
 
37
    signals:
-
 
38
        void exportFrameSequence(QString, SMFrameSequence);
-
 
39
 
35
    private slots:
40
    private slots:
36
        void on_actionPreferences_triggered();
41
        void on_actionPreferences_triggered();
37
        void onPreferencesChanged();
42
        void onPreferencesChanged();
38
 
43
 
39
        void onReceiveFrame(unsigned int camId, cv::Mat frame);
44
        void onReceiveFrame(unsigned int camId, cv::Mat frame);
40
        void onReceiveCalibrationSet(SMCalibrationSet calibrationSet);
45
        void onReceiveCalibrationSet(SMCalibrationSet calibrationSet);
41
        void onReceiveFrameSequence(SMFrameSequence frameSequence);
46
        void onReceiveFrameSequence(SMFrameSequence frameSequence);
42
        void onReceiveRotatedTo(float angle);
47
        void onReceiveRotatedTo(float angle);
43
 
48
 
44
        void onReceiveCheckerboardResult(int idx, SMCalibrationSet calibrationSet);
49
        void onReceiveCheckerboardResult(int, SMCalibrationSet calibrationSet);
45
 
50
 
46
        void on_singleCalibrationButton_clicked();
51
        void on_singleCalibrationButton_clicked();
47
 
52
 
48
        void on_calibrateCamerasButton_clicked();
53
        void on_calibrateCamerasButton_clicked();
49
 
54
 
50
        void onReceiveCalibrationDone();
55
        void onReceiveCalibrationDone();
51
        void on_calibrationListWidget_itemSelectionChanged();
56
        void on_calibrationListWidget_itemSelectionChanged();
52
 
57
 
53
        void on_singleCaptureButton_clicked();
58
        void on_singleCaptureButton_clicked();
54
 
59
 
55
        void on_calibrationRotationDial_sliderReleased();
60
        void on_calibrationRotationDial_sliderReleased();
56
 
61
 
57
        void on_captureRotationDial_sliderReleased();
62
        void on_captureRotationDial_sliderReleased();
58
 
63
 
59
        void on_captureTreeWidget_itemSelectionChanged();
64
        void on_captureTreeWidget_itemSelectionChanged();
60
 
65
 
61
        void on_batchCalibrationButton_clicked();
66
        void on_batchCalibrationButton_clicked();
62
 
67
 
63
        void on_batchCaptureButton_clicked();
68
        void on_batchCaptureButton_clicked();
64
 
69
 
65
        void on_actionExport_Sets_triggered();
70
        void on_actionExport_Sets_triggered();
66
 
71
 
67
        void on_actionExport_Sequences_triggered();
72
        void on_actionExport_Sequences_triggered();
68
 
73
 
69
        void onReceivePointCloud(SMPointCloud pc);
74
        void onReceivePointCloud(SMPointCloud pc);
70
 
75
 
-
 
76
        void onAbortedExport();
-
 
77
 
-
 
78
        void onExportProgress(int progress);
-
 
79
 
-
 
80
        void onFinishedExport(int id);
-
 
81
 
71
        void on_actionExport_Point_Clouds_triggered();
82
        void on_actionExport_Point_Clouds_triggered();
72
 
83
 
73
        void on_pointCloudsListWidget_itemChanged(QListWidgetItem *item);
84
        void on_pointCloudsListWidget_itemChanged(QListWidgetItem *item);
74
 
85
 
75
        void on_actionExport_Parameters_triggered();
86
        void on_actionExport_Parameters_triggered();
76
 
87
 
77
        void on_actionClear_Sequences_triggered();
88
        void on_actionClear_Sequences_triggered();
78
 
89
 
79
        void on_actionExport_White_Frames_triggered();
90
        void on_actionExport_White_Frames_triggered();
80
 
91
 
81
        void on_actionImport_Parameters_triggered();
92
        void on_actionImport_Parameters_triggered();
82
 
93
 
83
        void on_actionImport_Sets_triggered();
94
        void on_actionImport_Sets_triggered();
84
 
95
 
85
        void on_actionImport_Sequences_triggered();
96
        void on_actionImport_Sequences_triggered();
86
 
97
 
87
        void on_actionClear_Point_Clouds_triggered();
98
        void on_actionClear_Point_Clouds_triggered();
88
 
99
 
89
        void on_calibrationRotationSpinBox_editingFinished();
100
        void on_calibrationRotationSpinBox_editingFinished();
90
 
101
 
91
        void on_captureRotationSpinBox_editingFinished();
102
        void on_captureRotationSpinBox_editingFinished();
92
 
103
 
93
        void on_actionProject_Focusing_Pattern_triggered();
104
        void on_actionProject_Focusing_Pattern_triggered();
94
 
105
 
95
        void on_calibrateRotationStageButton_clicked();
106
        void on_calibrateRotationStageButton_clicked();
96
 
107
 
97
        void on_actionView_Log_Messages_triggered();
108
        void on_actionView_Log_Messages_triggered();
98
 
109
 
99
        void on_tabWidget_currentChanged(int index);
110
        void on_tabWidget_currentChanged(int index);
100
 
111
 
101
        void on_calibrationListWidget_currentRowChanged(int currentRow);
112
        void on_calibrationListWidget_currentRowChanged(int currentRow);
102
 
113
 
103
        void on_actionEdit_Configuration_File_triggered();
114
        void on_actionEdit_Configuration_File_triggered();
104
 
115
 
-
 
116
        void on_exportCheckBox_toggled(bool checked);
-
 
117
 
-
 
118
        void on_browseExportPushButton_clicked();
-
 
119
 
105
private:
120
private:
106
        Ui::SMScanner *ui;
121
        Ui::SMScanner *ui;
107
 
122
 
108
        QSettings settings;
123
        QSettings settings;
109
 
124
 
110
        SMPreferenceDialog preferenceDialog;
125
        SMPreferenceDialog preferenceDialog;
111
        SMLogDialog logDialog;
126
        SMLogDialog logDialog;
112
 
127
 
-
 
128
        SMExportWorker *exportWorker;
-
 
129
        QThread *exportWorkerThread;
-
 
130
        QTimer* exportTimer;
-
 
131
 
113
        SMCaptureWorker *captureWorker;
132
        SMCaptureWorker *captureWorker;
114
        QThread *captureWorkerThread;
133
        QThread *captureWorkerThread;
115
 
134
 
116
        SMCalibrationWorker *calibrationWorker;
135
        SMCalibrationWorker *calibrationWorker;
117
        QThread *calibrationWorkerThread;
136
        QThread *calibrationWorkerThread;
118
 
137
 
119
        SMReconstructionWorker *reconstructionWorker;
138
        SMReconstructionWorker *reconstructionWorker;
120
        QThread *reconstructionWorkerThread;
139
        QThread *reconstructionWorkerThread;
121
 
140
 
122
        std::vector< SMCalibrationSet > calibrationData;
141
        std::vector< SMCalibrationSet > calibrationData;
123
 
142
 
124
        std::vector< SMFrameSequence > captureData;
143
        std::vector< SMFrameSequence > captureData;
125
        std::vector< SMPointCloud > pointCloudData;
144
        std::vector< SMPointCloud > pointCloudData;
126
 
145
 
127
        bool calibrationReviewMode;
146
        bool calibrationReviewMode;
128
        bool captureReviewMode;
147
        bool captureReviewMode;
129
        int lastCaptureId;
148
        int lastCaptureId;
130
 
149
 
131
};
150
};
132
 
151
 
133
#endif // SMSCANNER_H
152
#endif // SMSCANNER_H
134
 
153