Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef MRPT_WX_UTILS_H
00029 #define MRPT_WX_UTILS_H
00030
00031 #include <mrpt/utils/utils_defs.h>
00032 #include <mrpt/utils/CImage.h>
00033 #include <mrpt/utils/CConfigFileBase.h>
00034 #include <mrpt/utils/CConfigFileMemory.h>
00035 #include <mrpt/synch.h>
00036 #include <mrpt/gui/keycodes.h>
00037
00038 #include <mrpt/gui/link_pragmas.h>
00039
00040 #if MRPT_HAS_WXWIDGETS
00041
00042 #include <wx/sizer.h>
00043 #include <wx/statbmp.h>
00044 #include <wx/menu.h>
00045 #include <wx/toolbar.h>
00046 #include <wx/frame.h>
00047 #include <wx/timer.h>
00048 #include <wx/statusbr.h>
00049 #include <wx/msgdlg.h>
00050 #include <wx/artprov.h>
00051 #include <wx/bitmap.h>
00052 #include <wx/intl.h>
00053 #include <wx/image.h>
00054 #include <wx/string.h>
00055 #include <wx/msgdlg.h>
00056 #include <wx/panel.h>
00057 #include <wx/filedlg.h>
00058 #include <wx/progdlg.h>
00059 #include <wx/imaglist.h>
00060 #include <wx/busyinfo.h>
00061 #include <wx/log.h>
00062 #include <wx/textdlg.h>
00063 #include <wx/dirdlg.h>
00064 #include <wx/colordlg.h>
00065 #include <wx/dcmemory.h>
00066 #include <wx/app.h>
00067 #include <wx/pen.h>
00068 #include <wx/spinctrl.h>
00069 #include <wx/sizer.h>
00070 #include <wx/notebook.h>
00071 #include <wx/button.h>
00072 #include <wx/panel.h>
00073 #include <wx/stattext.h>
00074 #include <wx/textctrl.h>
00075 #include <wx/choice.h>
00076 #include <wx/radiobox.h>
00077 #include <wx/settings.h>
00078 #include <wx/checkbox.h>
00079 #include <wx/dc.h>
00080 #include <wx/dcclient.h>
00081
00082 #endif
00083
00084 namespace mrpt
00085 {
00086 namespace gui
00087 {
00088 #if MRPT_HAS_WXWIDGETS
00089
00090
00091 #ifndef _U
00092 # ifdef wxUSE_UNICODE
00093 # define _U(x) wxString::From8BitData(x)
00094 # else
00095 # define _U(x) (x)
00096 # endif
00097 #endif
00098
00099
00100
00101
00102
00103 wxImage GUI_IMPEXP * MRPTImage2wxImage( const mrpt::utils::CImage &img );
00104
00105
00106
00107
00108 wxBitmap GUI_IMPEXP * MRPTImage2wxBitmap( const mrpt::utils::CImage &img );
00109
00110 #if MRPT_HAS_OPENCV
00111
00112
00113
00114 wxImage GUI_IMPEXP * IplImage2wxImage( void* img );
00115 #endif
00116
00117
00118
00119
00120
00121 mrpt::utils::CImage GUI_IMPEXP * wxImage2MRPTImage( const wxImage &img );
00122
00123
00124
00125
00126 mrpt::utils::CImagePtr GUI_IMPEXP wxImage2MRPTImagePtr( const wxImage &img );
00127
00128
00129 mrptKeyModifier keyEventToMrptKeyModifier( const wxKeyEvent &ev );
00130
00131
00132
00133 class GUI_IMPEXP wxMRPTImageControl : public wxPanel
00134 {
00135 protected:
00136 wxBitmap *m_img;
00137 mrpt::synch::CCriticalSection m_img_cs;
00138
00139 wxPoint m_last_mouse_point, m_last_mouse_click;
00140 mrpt::synch::CCriticalSection m_mouse_cs;
00141
00142 public:
00143 wxMRPTImageControl( wxWindow *parent,wxWindowID winID,int x, int y, int width, int height);
00144 virtual ~wxMRPTImageControl();
00145
00146 void AssignImage(wxBitmap *img);
00147 void AssignImage(const mrpt::utils::CImage &img);
00148 void GetBitmap(wxBitmap &bmp);
00149
00150 void OnPaint(wxPaintEvent &ev);
00151 void OnMouseMove(wxMouseEvent& ev);
00152 void OnMouseClick(wxMouseEvent& ev);
00153
00154 void OnEraseBackground(wxEraseEvent &ev) { }
00155 };
00156
00157
00158
00159 class GUI_IMPEXP CPanelCameraSelection: public wxPanel
00160 {
00161 public:
00162
00163 CPanelCameraSelection(wxWindow* parent,wxWindowID id=wxID_ANY);
00164 virtual ~CPanelCameraSelection();
00165
00166 void readConfigIntoVideoSourcePanel(
00167 const std::string §,
00168 const mrpt::utils::CConfigFileBase *cfg ) const;
00169
00170 void writeConfigFromVideoSourcePanel(
00171 const std::string §,
00172 mrpt::utils::CConfigFileBase *cfg ) const;
00173
00174
00175 wxNotebook* pagesCameras;
00176 wxPanel* Panel1;
00177 wxPanel* Panel6;
00178 wxPanel* pnSwissRanger;
00179 wxTextCtrl* edCustomCamConfig;
00180 wxCheckBox* cbSR_chRange;
00181 wxCheckBox* cbSR_chIntensity;
00182 wxTextCtrl* edIPcamURL;
00183 wxCheckBox* cbSR_ch3D;
00184 wxRadioBox* rbSR_usb;
00185 wxStaticText* StaticText1;
00186 wxStaticText* StaticText10;
00187 wxButton* btnBrowseVideo;
00188 wxPanel* Panel2;
00189 wxCheckBox* cbKinect_3D;
00190 wxStaticText* StaticText3;
00191 wxPanel* Panel4;
00192 wxTextCtrl* edRawlogFile;
00193 wxButton* btnBrowseRawlog;
00194 wxChoice* cbOpencvResolution;
00195 wxPanel* Panel5;
00196 wxStaticText* StaticText8;
00197 wxPanel* Panel3;
00198 wxStaticText* StaticText7;
00199 wxCheckBox* cbGrayscale;
00200 wxChoice* cbOpencvCamType;
00201 wxCheckBox* cbKinect_Depth;
00202 wxPanel* pnKinect;
00203 wxRadioBox* rbBumblebeeSel;
00204 wxTextCtrl* edRawlogLabel;
00205 wxStaticText* StaticText4;
00206 wxCheckBox* cbSR_chConf;
00207 wxCheckBox* cbKinect_Int;
00208 wxStaticText* StaticText5;
00209 wxStaticText* StaticText2;
00210 wxTextCtrl* edSR_IP;
00211 wxStaticText* StaticText6;
00212 wxCheckBox* cbBumblebeeRectif;
00213 wxButton* btnBrowseRawlogDir;
00214 wxTextCtrl* edRawlogImgDir;
00215 wxSpinCtrl* opencvCamIndex;
00216 wxStaticText* StaticText9;
00217 wxStaticText* StaticText11;
00218 wxTextCtrl* edVideoFile;
00219
00220
00221 protected:
00222
00223
00224 static const long ID_STATICTEXT1;
00225 static const long ID_SPINCTRL1;
00226 static const long ID_STATICTEXT3;
00227 static const long ID_CHOICE1;
00228 static const long ID_STATICTEXT6;
00229 static const long ID_CHOICE2;
00230 static const long ID_PANEL2;
00231 static const long ID_STATICTEXT7;
00232 static const long ID_TEXTCTRL1;
00233 static const long ID_PANEL3;
00234 static const long ID_TEXTCTRL6;
00235 static const long ID_PANEL4;
00236 static const long ID_STATICTEXT8;
00237 static const long ID_TEXTCTRL2;
00238 static const long ID_BUTTON7;
00239 static const long ID_PANEL5;
00240 static const long ID_STATICTEXT9;
00241 static const long ID_TEXTCTRL3;
00242 static const long ID_BUTTON8;
00243 static const long ID_STATICTEXT5;
00244 static const long ID_TEXTCTRL7;
00245 static const long ID_BUTTON9;
00246 static const long ID_STATICTEXT10;
00247 static const long ID_TEXTCTRL8;
00248 static const long ID_STATICTEXT11;
00249 static const long ID_PANEL6;
00250 static const long ID_RADIOBOX1;
00251 static const long ID_CHECKBOX1;
00252 static const long ID_STATICTEXT2;
00253 static const long ID_PANEL7;
00254 static const long ID_RADIOBOX2;
00255 static const long ID_STATICTEXT4;
00256 static const long ID_TEXTCTRL4;
00257 static const long ID_CHECKBOX3;
00258 static const long ID_CHECKBOX4;
00259 static const long ID_CHECKBOX5;
00260 static const long ID_CHECKBOX6;
00261 static const long ID_PANEL1;
00262 static const long ID_CHECKBOX7;
00263 static const long ID_CHECKBOX8;
00264 static const long ID_CHECKBOX9;
00265 static const long ID_PANEL8;
00266 static const long ID_NOTEBOOK1;
00267 static const long ID_CHECKBOX2;
00268
00269
00270 private:
00271
00272
00273
00274 void OnbtnBrowseVideoClick(wxCommandEvent& event);
00275 void OnbtnBrowseRawlogClick(wxCommandEvent& event);
00276 void OnbtnBrowseRawlogDirClick(wxCommandEvent& event);
00277
00278 DECLARE_EVENT_TABLE()
00279 };
00280
00281
00282
00283 namespace detail
00284 {
00285 struct TReturnAskUserOpenCamera
00286 {
00287 mrpt::utils::CConfigFileMemory selectedConfig;
00288 bool accepted_by_user;
00289 };
00290 }
00291
00292 #endif
00293
00294 }
00295 }
00296
00297 #endif