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/synch.h>
00034
00035 #if MRPT_HAS_WXWIDGETS
00036
00037 #include <wx/sizer.h>
00038 #include <wx/statbmp.h>
00039 #include <wx/menu.h>
00040 #include <wx/toolbar.h>
00041 #include <wx/frame.h>
00042 #include <wx/timer.h>
00043 #include <wx/statusbr.h>
00044 #include <wx/msgdlg.h>
00045 #include <wx/artprov.h>
00046 #include <wx/bitmap.h>
00047 #include <wx/intl.h>
00048 #include <wx/image.h>
00049 #include <wx/string.h>
00050 #include <wx/msgdlg.h>
00051 #include <wx/panel.h>
00052 #include <wx/filedlg.h>
00053 #include <wx/progdlg.h>
00054 #include <wx/imaglist.h>
00055 #include <wx/busyinfo.h>
00056 #include <wx/log.h>
00057 #include <wx/textdlg.h>
00058 #include <wx/dirdlg.h>
00059 #include <wx/colordlg.h>
00060 #include <wx/dcmemory.h>
00061 #include <wx/app.h>
00062 #include <wx/pen.h>
00063 #include <wx/spinctrl.h>
00064 #include <wx/sizer.h>
00065 #include <wx/notebook.h>
00066 #include <wx/button.h>
00067 #include <wx/panel.h>
00068 #include <wx/stattext.h>
00069 #include <wx/textctrl.h>
00070 #include <wx/choice.h>
00071 #include <wx/radiobox.h>
00072 #include <wx/settings.h>
00073 #include <wx/checkbox.h>
00074
00075 #endif
00076
00077 namespace mrpt
00078 {
00079 namespace gui
00080 {
00081 #if MRPT_HAS_WXWIDGETS
00082
00083
00084
00085
00086 wxImage MRPTDLLIMPEXP * MRPTImage2wxImage( const mrpt::utils::CImage &img );
00087
00088
00089
00090
00091 wxBitmap MRPTDLLIMPEXP * MRPTImage2wxBitmap( const mrpt::utils::CImage &img );
00092
00093 #if MRPT_HAS_OPENCV
00094
00095
00096
00097 wxImage MRPTDLLIMPEXP * IplImage2wxImage( void* img );
00098 #endif
00099
00100
00101
00102
00103
00104 mrpt::utils::CImage MRPTDLLIMPEXP * wxImage2MRPTImage( const wxImage &img );
00105
00106
00107
00108
00109 mrpt::utils::CImagePtr MRPTDLLIMPEXP wxImage2MRPTImagePtr( const wxImage &img );
00110
00111
00112
00113
00114 class MRPTDLLIMPEXP wxMRPTImageControl : public wxPanel
00115 {
00116 protected:
00117 wxBitmap *m_img;
00118 mrpt::synch::CCriticalSection m_img_cs;
00119
00120 wxPoint m_last_mouse_point, m_last_mouse_click;
00121 mrpt::synch::CCriticalSection m_mouse_cs;
00122
00123 public:
00124 wxMRPTImageControl( wxWindow *parent,wxWindowID winID,int x, int y, int width, int height);
00125 virtual ~wxMRPTImageControl();
00126
00127 void AssignImage(wxBitmap *img);
00128 void AssignImage(const mrpt::utils::CImage &img);
00129 void GetBitmap(wxBitmap &bmp);
00130
00131 void OnPaint(wxPaintEvent &ev);
00132 void OnMouseMove(wxMouseEvent& ev);
00133 void OnMouseClick(wxMouseEvent& ev);
00134 void OnChar(wxKeyEvent& event);
00135
00136 void OnEraseBackground(wxEraseEvent &ev) { }
00137 };
00138
00139
00140
00141 class MRPTDLLIMPEXP CPanelCameraSelection: public wxPanel
00142 {
00143 public:
00144
00145 CPanelCameraSelection(wxWindow* parent,wxWindowID id=wxID_ANY);
00146 virtual ~CPanelCameraSelection();
00147
00148
00149 wxTextCtrl* edRawlogLabel;
00150 wxStaticText* StaticText10;
00151 wxStaticText* StaticText9;
00152 wxPanel* Panel5;
00153 wxButton* btnBrowseRawlogDir;
00154 wxRadioBox* rbBumblebeeSel;
00155 wxButton* btnBrowseVideo;
00156 wxPanel* Panel4;
00157 wxStaticText* StaticText6;
00158 wxSpinCtrl* opencvCamIndex;
00159 wxTextCtrl* edIPcamURL;
00160 wxStaticText* StaticText8;
00161 wxStaticText* StaticText11;
00162 wxTextCtrl* edCustomCamConfig;
00163 wxPanel* Panel1;
00164 wxChoice* cbOpencvCamType;
00165 wxStaticText* StaticText1;
00166 wxStaticText* StaticText3;
00167 wxPanel* Panel6;
00168 wxButton* btnBrowseRawlog;
00169 wxPanel* Panel3;
00170 wxCheckBox* cbGrayscale;
00171 wxStaticText* StaticText5;
00172 wxStaticText* StaticText7;
00173 wxTextCtrl* edVideoFile;
00174 wxCheckBox* cbBumblebeeRectif;
00175 wxNotebook* pagesCameras;
00176 wxTextCtrl* edRawlogFile;
00177 wxTextCtrl* edRawlogImgDir;
00178 wxPanel* Panel2;
00179 wxChoice* cbOpencvResolution;
00180
00181 protected:
00182
00183
00184 static const long ID_STATICTEXT1;
00185 static const long ID_SPINCTRL1;
00186 static const long ID_STATICTEXT3;
00187 static const long ID_CHOICE1;
00188 static const long ID_STATICTEXT6;
00189 static const long ID_CHOICE2;
00190 static const long ID_PANEL2;
00191 static const long ID_STATICTEXT7;
00192 static const long ID_TEXTCTRL1;
00193 static const long ID_PANEL3;
00194 static const long ID_TEXTCTRL6;
00195 static const long ID_PANEL4;
00196 static const long ID_STATICTEXT8;
00197 static const long ID_TEXTCTRL2;
00198 static const long ID_BUTTON7;
00199 static const long ID_PANEL5;
00200 static const long ID_STATICTEXT9;
00201 static const long ID_TEXTCTRL3;
00202 static const long ID_BUTTON8;
00203 static const long ID_STATICTEXT5;
00204 static const long ID_TEXTCTRL7;
00205 static const long ID_BUTTON9;
00206 static const long ID_STATICTEXT10;
00207 static const long ID_TEXTCTRL8;
00208 static const long ID_STATICTEXT11;
00209 static const long ID_PANEL6;
00210 static const long ID_RADIOBOX1;
00211 static const long ID_CHECKBOX1;
00212 static const long ID_PANEL7;
00213 static const long ID_NOTEBOOK1;
00214 static const long ID_CHECKBOX2;
00215
00216
00217 private:
00218
00219
00220
00221 void OnbtnBrowseVideoClick(wxCommandEvent& event);
00222 void OnbtnBrowseRawlogClick(wxCommandEvent& event);
00223 void OnbtnBrowseRawlogDirClick(wxCommandEvent& event);
00224
00225 DECLARE_EVENT_TABLE()
00226 };
00227
00228 #endif
00229
00230 }
00231 }
00232
00233 #endif