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 wxTextCtrl* edRawlogLabel;
00176 wxStaticText* StaticText10;
00177 wxStaticText* StaticText9;
00178 wxPanel* Panel5;
00179 wxButton* btnBrowseRawlogDir;
00180 wxRadioBox* rbBumblebeeSel;
00181 wxButton* btnBrowseVideo;
00182 wxStaticText* StaticText2;
00183 wxPanel* Panel4;
00184 wxCheckBox* cbKinect_3D;
00185 wxRadioBox* rbKinect_int;
00186 wxCheckBox* cbSR_chConf;
00187 wxStaticText* StaticText6;
00188 wxSpinCtrl* opencvCamIndex;
00189 wxTextCtrl* edIPcamURL;
00190 wxStaticText* StaticText8;
00191 wxStaticText* StaticText11;
00192 wxTextCtrl* edCustomCamConfig;
00193 wxTextCtrl* edSR_IP;
00194 wxPanel* Panel1;
00195 wxChoice* cbOpencvCamType;
00196 wxStaticText* StaticText1;
00197 wxStaticText* StaticText3;
00198 wxRadioBox* rbSR_usb;
00199 wxPanel* Panel6;
00200 wxButton* btnBrowseRawlog;
00201 wxPanel* Panel3;
00202 wxCheckBox* cbGrayscale;
00203 wxCheckBox* cbSR_chRange;
00204 wxStaticText* StaticText5;
00205 wxStaticText* StaticText7;
00206 wxPanel* pnKinect;
00207 wxTextCtrl* edVideoFile;
00208 wxCheckBox* cbBumblebeeRectif;
00209 wxCheckBox* cbKinect_Int;
00210 wxCheckBox* cbSR_chIntensity;
00211 wxCheckBox* cbKinect_Depth;
00212 wxNotebook* pagesCameras;
00213 wxPanel* pnSwissRanger;
00214 wxTextCtrl* edRawlogFile;
00215 wxTextCtrl* edRawlogImgDir;
00216 wxPanel* Panel2;
00217 wxCheckBox* cbSR_ch3D;
00218 wxStaticText* StaticText4;
00219 wxChoice* cbOpencvResolution;
00220
00221
00222 protected:
00223
00224
00225 static const long ID_STATICTEXT1;
00226 static const long ID_SPINCTRL1;
00227 static const long ID_STATICTEXT3;
00228 static const long ID_CHOICE1;
00229 static const long ID_STATICTEXT6;
00230 static const long ID_CHOICE2;
00231 static const long ID_PANEL2;
00232 static const long ID_STATICTEXT7;
00233 static const long ID_TEXTCTRL1;
00234 static const long ID_PANEL3;
00235 static const long ID_TEXTCTRL6;
00236 static const long ID_PANEL4;
00237 static const long ID_STATICTEXT8;
00238 static const long ID_TEXTCTRL2;
00239 static const long ID_BUTTON7;
00240 static const long ID_PANEL5;
00241 static const long ID_STATICTEXT9;
00242 static const long ID_TEXTCTRL3;
00243 static const long ID_BUTTON8;
00244 static const long ID_STATICTEXT5;
00245 static const long ID_TEXTCTRL7;
00246 static const long ID_BUTTON9;
00247 static const long ID_STATICTEXT10;
00248 static const long ID_TEXTCTRL8;
00249 static const long ID_STATICTEXT11;
00250 static const long ID_PANEL6;
00251 static const long ID_RADIOBOX1;
00252 static const long ID_CHECKBOX1;
00253 static const long ID_STATICTEXT2;
00254 static const long ID_PANEL7;
00255 static const long ID_RADIOBOX2;
00256 static const long ID_STATICTEXT4;
00257 static const long ID_TEXTCTRL4;
00258 static const long ID_CHECKBOX3;
00259 static const long ID_CHECKBOX4;
00260 static const long ID_CHECKBOX5;
00261 static const long ID_CHECKBOX6;
00262 static const long ID_PANEL1;
00263 static const long ID_CHECKBOX7;
00264 static const long ID_CHECKBOX8;
00265 static const long ID_CHECKBOX9;
00266 static const long ID_RADIOBOX3;
00267 static const long ID_PANEL8;
00268 static const long ID_NOTEBOOK1;
00269 static const long ID_CHECKBOX2;
00270
00271
00272 private:
00273
00274
00275
00276 void OnbtnBrowseVideoClick(wxCommandEvent& event);
00277 void OnbtnBrowseRawlogClick(wxCommandEvent& event);
00278 void OnbtnBrowseRawlogDirClick(wxCommandEvent& event);
00279
00280 DECLARE_EVENT_TABLE()
00281 };
00282
00283
00284
00285 namespace detail
00286 {
00287 struct TReturnAskUserOpenCamera
00288 {
00289 mrpt::utils::CConfigFileMemory selectedConfig;
00290 bool accepted_by_user;
00291 };
00292 }
00293
00294 #endif
00295
00296 }
00297 }
00298
00299 #endif