-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathActiveStereoMain.h
179 lines (148 loc) · 5.69 KB
/
ActiveStereoMain.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
/*
* Copyright 2009-2010, Andrew Barry
*
* This file is part of MakerScanner.
*
* MakerScanner is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License (Version 2, June 1991) as published by
* the Free Software Foundation.
*
* MakerScanner is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ACTIVESTEREOMAIN_H
#define ACTIVESTEREOMAIN_H
//(*Headers(ActiveStereoFrame)
#include <wx/sizer.h>
#include <wx/button.h>
#include <wx/menu.h>
#include <wx/panel.h>
#include <wx/slider.h>
#include <wx/statusbr.h>
#include <wx/statline.h>
#include <wx/frame.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
//*)
#include <wx/numdlg.h>
#include <wx/ffile.h>
#include <wx/dir.h>
#include <wx/datetime.h>
#include <wx/config.h>
#include <wx/filename.h>
// include OpenCV headers
#include "cv.h"
#include "highgui.h"
#include "Cameras.h"
#include "ScanThread.h"
#include "ScanStatus.h"
// include image-viewing widget header
#include "camview.h"
class ActiveStereoFrame: public wxFrame
{
public:
ActiveStereoFrame(wxWindow* parent,wxWindowID id = -1);
virtual ~ActiveStereoFrame();
private:
//(*Handlers(ActiveStereoFrame)
void OnQuit(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
void OnButSetConfigClick(wxCommandEvent& event);
void OnButCaptureClick(wxCommandEvent& event);
void OnSliderImageThresholdCmdScroll(wxScrollEvent& event);
void OnSliderLaserMaxCmdScrollChanged(wxScrollEvent& event);
void OnSliderLaserMinCmdScrollChanged(wxScrollEvent& event);
void OnButCameraConnectClick(wxCommandEvent& event);
void OnSliderMirrorResolutionCmdScrollChanged(wxScrollEvent& event);
void OnSliderMirrorPositionCmdScrollChanged(wxScrollEvent& event);
void OnSliderLaserIntensityCmdScrollChanged(wxScrollEvent& event);
void OnSliderServoPositionCmdScrollChanged(wxScrollEvent& event);
void OnSliderMirrorPositionCmdScrollChangedWithMove(wxScrollEvent& event);
void OnButDoneScanningClick(wxCommandEvent& event);
void OnSliderBrightnessFilterCmdScrollThumbTrack(wxScrollEvent& event);
void OnMenuChangeCameraSelected(wxCommandEvent& event);
//*)
//(*Identifiers(ActiveStereoFrame)
static const long ID_STATICTEXT3;
static const long ID_STATICTEXT4;
static const long ID_STATICTEXT1;
static const long ID_FPS_LABEL;
static const long ID_BUTTON4;
static const long ID_STATICTEXT7;
static const long ID_SLIDER3;
static const long ID_STATICTEXT5;
static const long ID_SLIDER1;
static const long ID_STATICTEXT6;
static const long ID_BUTTON3;
static const long ID_BUTTON1;
static const long ID_STATICLINE1;
static const long ID_TEXTCTRL1;
static const long ID_PANEL1;
static const long idMenuQuit;
static const long idMenuChangeCamera;
static const long idMenuAbout;
static const long ID_STATUSBAR1;
//*)
//(*Declarations(ActiveStereoFrame)
wxPanel* Panel1;
wxMenuItem* menuChangeCamera;
wxStatusBar* StatusBar1;
wxMenu* Menu3;
wxSlider* sliderBrightnessFilter;
wxStaticText* lblFPS;
wxStaticText* StaticText1;
wxStaticText* lblBrightnessFilter;
wxBoxSizer* headBoxSizer;
wxStaticLine* StaticLine1;
wxSlider* sliderImageThreshold;
wxTextCtrl* txtLog;
wxStaticText* lblImageThreshold;
wxStaticText* lblCameraConnected;
wxStaticText* StaticText2;
wxFlexGridSizer* flexGridStatus;
wxButton* butCameraConnect;
wxButton* butCapture;
wxStaticBoxSizer* staticBoxSizerStatus;
wxButton* butDoneScanning;
wxStaticText* lblStaticCameraConnected;
//*)
// We must use events to communicate with the scanning thread because direct GUI
// modifications of the frame from the thread will fail badly
// Update image event handler -- get an image and display it on the frame
void UpdateImage(wxCommandEvent &event);
// Catch an event and display its text in the terminal box
void DisplayText(wxCommandEvent &event);
// Write the point cloud file with the text stored in the event
void WriteToFile(wxCommandEvent &event);
// Catch an event to update the scan progress bar
void UpdateScanProgress(wxCommandEvent &event);
// Catch the scan finished event and re-enable the frame
void ScanFinished(wxCommandEvent &event);
// Enable/disable frame buttons (disable when scanning == true)
void SetGUIStateDuringScan(bool scanning);
// Catches an UpdateUI event and updates the FPS display
void UpdateFps(wxUpdateUIEvent &event);
// last time a USB event was sent
wxDateTime lastUsbTime;
// camera object, allows access to scanning thread
Cameras *cam;
// object that holds the current scan's status for communitcating between
// the GUI and scanning/capturing threads.
ScanStatus *scanStatus;
wxString pointcloudFilename;
// image display widget
CCamView* m_pCamView;
// configuration storage object
wxConfig *config;
// data for the FPS display
wxDateTime timeOfLastFpsUpdate;
int framesSinceLastFpsUpdate, cameraNum;
bool updateImageRunning, cameraConnected;
DECLARE_EVENT_TABLE()
};
#endif // ACTIVESTEREOMAIN_H