MRPT  2.0.4
WxSubsystem.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
11 #include <mrpt/config.h>
12 #include <mrpt/gui/gui_frwds.h>
14 #include <mrpt/math/TPoint2D.h>
16 #include <future>
17 #include <map>
18 #include <mutex>
19 #include <queue>
20 #include <thread>
21 
22 #if MRPT_HAS_WXWIDGETS
23 
24 #include <wx/app.h>
25 #include <wx/artprov.h>
26 #include <wx/bitmap.h>
27 #include <wx/busyinfo.h>
28 #include <wx/colordlg.h>
29 #include <wx/dcmemory.h>
30 #include <wx/dirdlg.h>
31 #include <wx/filedlg.h>
32 #include <wx/frame.h>
33 #include <wx/image.h>
34 #include <wx/imaglist.h>
35 #include <wx/intl.h>
36 #include <wx/log.h>
37 #include <wx/menu.h>
38 #include <wx/msgdlg.h>
39 #include <wx/pen.h>
40 #include <wx/progdlg.h>
41 #include <wx/sizer.h>
42 #include <wx/statbmp.h>
43 #include <wx/statusbr.h>
44 #include <wx/string.h>
45 #include <wx/textdlg.h>
46 #include <wx/timer.h>
47 #include <wx/toolbar.h>
48 
49 // The wxMathPlot library
50 #include <mrpt/3rdparty/mathplot/mathplot.h>
51 
52 #if 0
53 // The wxFreeChart library
54 #include <wx/bars/barplot.h>
55 #include <wx/chartpanel.h>
56 
57 #include <wx/axis/categoryaxis.h>
58 #include <wx/axis/dateaxis.h>
59 #include <wx/axis/numberaxis.h>
60 
61 #include <wx/xy/xydataset.h>
62 #include <wx/xy/xyhistorenderer.h>
63 #include <wx/xy/xylinerenderer.h>
64 #include <wx/xy/xyplot.h>
65 #include <wx/xy/xysimpledataset.h>
66 
67 #include <wx/xyz/bubbleplot.h>
68 #include <wx/xyz/xyzdataset.h>
69 
70 #include <wx/category/categorydataset.h>
71 #include <wx/category/categorysimpledataset.h>
72 #endif
73 
74 #endif
75 #include <mrpt/gui/gui_frwds.h>
76 
77 namespace mrpt::gui
78 {
79 /** This class implements the GUI thread required for the wxWidgets-based GUI.
80  * This system is employed internally by gui::CDisplayWindow and
81  * gui::CDisplayWindow3D, and must be not used in any way directly by the MRPT
82  * user.
83  *
84  * The system works by creating a invisible wxFrame that process timer events
85  * where it checks a queue of requests sent from the main MRPT thread. The
86  * requests include the creation, deletion,... of windows (2D/3D). In that
87  * way, just one thread is required for all the GUI windows, and the wxWidgets
88  * is initialized and clean-up correctly.
89  *
90  * This header should be included just from the implementation files of
91  * CDisplayWindow and CDisplayWindow3D, since it uses wxWidgets classes.
92  *
93  * \sa gui::CDisplayWindow, gui::CDisplayWindow3D
94  * \ingroup mrpt_gui_grp
95  */
97 {
98 #if MRPT_HAS_WXWIDGETS
99 
100  public:
101  /** This method must be called in the destructor of the user class FROM THE
102  * MAIN THREAD, in order to wait for the shutdown of the wx thread if this
103  * was the last open window.
104  */
105  static void waitWxShutdownsIfNoWindows();
106 
107  /** Will be set to true at runtime if it's not detected a running wxApp
108  * instance.
109  * For console apps, we'll create a new thread and run wxEntry from there.
110  * For GUI apps (MRPT-based Windows are a part of a user wxWidget apps),
111  * we must leave the control of
112  * message dispatching to the current main loop, so we cannot create a
113  * different threads, making things a little different (hence this
114  * variable).
115  */
116  static bool isConsoleApp();
117 
118  /** An auxiliary global object used just to launch a final request to the
119  * wxSubsystem for shutdown:
120  */
122  {
123  public:
126  };
127 
129 
130  /** The main frame of the wxWidgets application
131  */
132  class CWXMainFrame : public wxFrame
133  {
135 
136  public:
137  CWXMainFrame(wxWindow* parent, wxWindowID id = -1);
138  ~CWXMainFrame() override;
139 
140  /** Atomically increments the number of windows created with the main
141  * frame as parent.
142  * \return The updated number of windows.
143  */
144  static int notifyWindowCreation();
145 
146  /** Atomically decrements the number of windows created with the main
147  * frame as parent.
148  * \return The updated number of windows (0 if the calling was the last
149  * one).
150  */
151  static int notifyWindowDestruction();
152 
153  static volatile CWXMainFrame* oneInstance;
154 
155  private:
156  static std::mutex cs_windowCount;
157  static int m_windowCount;
158 
159  wxTimer* m_theTimer;
160 
161  void OnTimerProcessRequests(wxTimerEvent& event);
162 
163  DECLARE_EVENT_TABLE()
164 
165  }; // end class CWXMainFrame
166 
168  {
169  /** The thread ID of wxMainThread, or 0 if it is not running. */
170  std::thread m_wxMainThreadId;
171  /** This is signaled when wxMainThread is ready. */
172  std::promise<void> m_semWxMainThreadReady;
173  std::promise<void> m_done;
174  /** The critical section for accessing "m_wxMainThreadId" */
175  std::mutex m_csWxMainThreadId;
176  };
177 
179 
180  /** This will be the "MAIN" of wxWidgets: It starts an application object
181  * and does not end until all the windows are closed.
182  * Only one instance of this thread can be running at a given instant, no
183  * matter how many windows are open.
184  */
185  static void wxMainThread();
186 
187  /** The data structure for each inter-thread request:
188  */
190  {
191  TRequestToWxMainThread() = default;
192 
193  /** Only one of source* can be non-nullptr, indicating the class that
194  * generated the request. */
196 
197  /** Only one of source* can be non-nullptr, indicating the class that
198  * generated the request. */
200 
201  /** Only one of source* can be non-nullptr, indicating the class that
202  * generated the request. */
204 
205  /** Only one of source* can be non-nullptr, indicating the class that
206  * generated the request. */
208 
209  /** Parameters, depending on OPCODE.
210  */
211  std::string str;
212 
213  /** Parameters, depending on OPCODE.
214  */
215  void *voidPtr{nullptr}, *voidPtr2{nullptr};
216  int x{400}, y{400};
217  bool boolVal{false};
219  std::string plotName;
220 
221  /** Valid codes are:
222  * For CDisplayWindow:
223  * - 200: Create a new 2D window, with caption "str" and initial
224  *size "x" & "y", and save the "wxFrame*" in the "void**" passed in
225  *voidPtr.
226  * - 201: Updates the image shown in the window, from a "wxImage*"
227  *passed in voidPtr2. The wxImage object will be freed with delete
228  *after that. voidPtr must be a "wxFrame*", a "CWindowDialog*"
229  *actually.
230  * - 202: Set position to x,y
231  * - 203: Change size to x,y
232  * - 204: Change title to "str"
233  * - 299: Delete the window associated with this source object.
234  *
235  * For CDisplayWindow3D:
236  * - 300: Create a new 3D window, with caption "str" and initial
237  *size "x" & "y", and save the "wxFrame*" in the "void**" passed in
238  *voidPtr.
239  * - 302: Set position to x,y
240  * - 303: Change size to x,y
241  * - 304: Change title to "str"
242  * - 350: Force refresh
243  * - [Removed in MRPT2] 360: Add a 2D text message:
244  * - [Removed in MRPT2] 361: Clear all 2D text messages.
245  * - [Removed in MRPT2] 362: Add a 2D text message (vector font)
246  * - 370: Change min/max range: min=vector_x[0], max=vector_x[1]
247  * - 399: Delete the window associated with this source object.
248  *
249  * For CDisplayWindowPlots:
250  * - 400: Create a new Plots window, with caption "str" and initial
251  *size "x" & "y",and save the "wxFrame*" in the "void**" passed in
252  *voidPtr.
253  * - 402: Set position to x,y
254  * - 403: Change size to x,y
255  * - 404: Change title to "str"
256  * - 499: Delete the window associated with this source object.
257  * - 410: Depending on "boolVal", enable/disable the mouse-zoom &
258  *pan
259  * - 411: Depending on "boolVal", enable/disable the aspect ratio
260  *fix
261  * - 412: Zoom over a rectangle vectorx[0-1] & vectory[0-1]
262  * - 413: Axis fit, with aspect ratio fix to boolVal.
263  * - 414: Clear all plot objects.
264  * - 420: Add/update a 2D line/points plot: x/y data=
265  *vector_x/vector_y, format string=str, plot name =plotName.
266  * - 421: Add/update a 2D ellipse: format string=str, plot name
267  *=plotName, vector_x[0,1]:X/Y center, vector_x[2]:quantiles,
268  *vector_y[0,1,2]: Covariance matrix entries 00,11,01,
269  *boolVal=showName?
270  * - 422: Add/update a bitmap: plot name =plotName,
271  *vector_x[0,1]:X/Y
272  *corner, vector_x[2,3]: X/Y widths, voidPtr2: pointer to a newly
273  *created wxImage with the bitmap.
274  * - 440: Insert submenu in the popup menu. plotName=menu label,
275  *x=user-defined ID.
276  * - 700: Shows a camera-pick-dialog and wait for user selection.
277  *"voidPtr" must point to a CSemaphore, which will be signaled twice
278  *(1st upon construction, 2nd upon dialog close); voidPtr2 must point
279  *to a "mrpt::gui::CPanelCameraSelection*" which will be filled with
280  *the selection (the panel must be deleted by the caller)
281  *
282  */
283  int OPCODE;
284  };
285 
286  /** Thread-safe method to return the next pending request, or nullptr if
287  * there is none (After usage, FREE the memory!)
288  */
290 
291  /** Thread-safe method to insert a new pending request (The memory must be
292  * dinamically allocated with "new T[1]", will be freed by receiver.)
293  */
295 
296  /** Thread-safe method to create one single instance of the main wxWidgets
297  * thread: it will create the thread only if it is not running yet.
298  */
299  static bool createOneInstanceMainThread();
300 
301  static wxBitmap getMRPTDefaultIcon();
302 
303  private:
304  /** Do not access directly to this, use the thread-safe functions
305  */
306  static std::queue<TRequestToWxMainThread*>* listPendingWxRequests;
307  static std::mutex* cs_listPendingWxRequests;
308 #endif
309 }; // End of class def.
310 
311 #if MRPT_HAS_WXWIDGETS
312 
313 /** The wx dialog for gui::CDisplayWindow
314  */
315 class CWindowDialog : public wxFrame
316 {
317  public:
318  /** A custom control to display the bitmap and avoid flicker
319  */
320  class wxMRPTImageControl : public wxPanel
321  {
322  protected:
323  std::unique_ptr<wxBitmap> m_img;
324  std::mutex m_img_cs;
326 
327  public:
329  wxWindow* parent, wxWindowID winID, int x, int y, int width,
330  int height);
331  ~wxMRPTImageControl() override;
332 
334  // std::mutex m_mouse_cs;
335 
336  /** Assigns this image. This object has the ownship of the image and
337  * will delete it when appropriate. */
338  void AssignImage(wxBitmap* img);
339  void GetBitmap(wxBitmap& bmp);
340 
341  void OnPaint(wxPaintEvent& ev);
342  void OnMouseMove(wxMouseEvent& ev);
343  void OnMouseClick(wxMouseEvent& ev);
344  void OnChar(wxKeyEvent& ev);
345 
346  void OnEraseBackground(wxEraseEvent& ev)
347  { /* Do nothing */
348  }
349  };
350 
351  public:
354  wxWindowID id = -1,
355  const std::string& caption = std::string("[MRPT-CDisplayWindow]"),
356  wxSize initialSize = wxDefaultSize);
357  ~CWindowDialog() override;
358 
361 
362  // wxStaticBitmap *m_image;
364 
365  static const long ID_IMAGE_BITMAP;
366 
367  private:
368  void OnClose(wxCloseEvent& event);
369  void OnMenuClose(wxCommandEvent& event);
370  void OnMenuAbout(wxCommandEvent& event);
371  void OnMenuSave(wxCommandEvent& event);
372  void OnChar(wxKeyEvent& event);
373  void OnKeyDown(wxKeyEvent& event);
374  void OnResize(wxSizeEvent& event);
375  void OnMouseDown(wxMouseEvent& event);
376  void OnMouseMove(wxMouseEvent& event);
377 
378  DECLARE_EVENT_TABLE()
379 }; // end class CWindowDialog
380 
381 class C3DWindowDialog : public wxFrame
382 {
384 
385  public:
388  wxWindowID id = -1,
389  const std::string& caption = std::string("[MRPT-CDisplayWindow3D]"),
390  wxSize initialSize = wxDefaultSize);
391  ~C3DWindowDialog() override;
392 
395 
396  CMyGLCanvas_DisplayWindow3D* m_canvas;
397 
398  private:
399  void OnClose(wxCloseEvent& event);
400  void OnMenuClose(wxCommandEvent& event);
401  void OnMenuAbout(wxCommandEvent& event);
402  void OnChar(wxKeyEvent& event);
403  void OnResize(wxSizeEvent& event);
404 
405  static const long ID_MENUITEM1;
406  static const long ID_MENUITEM2;
407 
408  DECLARE_EVENT_TABLE()
409 };
410 
411 /** The wx dialog for gui::CDisplayWindowPlots
412  */
413 class CWindowDialogPlots : public wxFrame
414 {
415  public:
418  wxWindowID id = -1,
419  const std::string& caption = std::string("[MRPT-CDisplayWindowPlots]"),
420  wxSize initialSize = wxDefaultSize);
421  ~CWindowDialogPlots() override;
422 
425 
426  mpWindow* m_plot;
427  // wxChartPanel *m_chartPanel;
428  static const long ID_PLOT;
429  static const long ID_MENU_PRINT;
430  /** to know whether to insert a separator the first time. */
432  /** wxIDs to user IDs for submenus. */
433  std::map<long, long> m_ID2ID;
434  /** In graph coords */
436  /** In pixels */
438 
439  void OnMenuSelected(wxCommandEvent& ev);
440  void OnMouseMove(wxMouseEvent& event);
441 
442  /** Redirected from CDisplayWindowPlots::plot
443  */
444  void plot(
446  const std::string& lineFormat, const std::string& plotName);
447 
448  /** Redirected from CDisplayWindowPlots::plotEllipse
449  */
450  void plotEllipse(
452  const std::string& lineFormat, const std::string& plotName,
453  bool showName = false);
454 
455  /** Redirected from CDisplayWindowPlots::image
456  */
457  void image(
458  void* theWxImage, float x0, float y0, float w, float h,
459  const std::string& plotName);
460 
461  private:
462  void OnClose(wxCloseEvent& event);
463  void OnMenuPrint(wxCommandEvent& event);
464  void OnMenuClose(wxCommandEvent& event);
465  void OnMenuAbout(wxCommandEvent& event);
466  void OnChar(wxKeyEvent& event);
467  void OnResize(wxSizeEvent& event);
468  void OnMouseDown(wxMouseEvent& event);
469 
470  DECLARE_EVENT_TABLE()
471 }; // end class CWindowDialog
472 
473 #endif
474 
475 } // namespace mrpt::gui
mrpt::gui::WxSubsystem::TRequestToWxMainThread::sourcePlots
mrpt::gui::CDisplayWindowPlots * sourcePlots
Only one of source* can be non-nullptr, indicating the class that generated the request.
Definition: WxSubsystem.h:203
mrpt::gui::WxSubsystem::TRequestToWxMainThread::voidPtr
void * voidPtr
Parameters, depending on OPCODE.
Definition: WxSubsystem.h:215
mrpt::opengl::internal::data
static struct FontData data
Definition: gltext.cpp:144
mrpt::gui::CWindowDialog::wxMRPTImageControl::m_last_mouse_point
wxPoint m_last_mouse_point
Definition: WxSubsystem.h:333
mrpt::gui::C3DWindowDialog::ID_MENUITEM1
static const long ID_MENUITEM1
Definition: WxSubsystem.h:405
mrpt::gui::CWindowDialog::m_mainFrame
WxSubsystem::CWXMainFrame * m_mainFrame
Definition: WxSubsystem.h:360
mrpt::gui::CWindowDialogPlots::image
void image(void *theWxImage, float x0, float y0, float w, float h, const std::string &plotName)
Redirected from CDisplayWindowPlots::image.
Definition: CDisplayWindowPlots.cpp:599
mrpt::gui::C3DWindowDialog::~C3DWindowDialog
~C3DWindowDialog() override
Definition: CDisplayWindow3D.cpp:301
mrpt::gui::WxSubsystem::createOneInstanceMainThread
static bool createOneInstanceMainThread()
Thread-safe method to create one single instance of the main wxWidgets thread: it will create the thr...
Definition: WxSubsystem.cpp:1017
mrpt::gui::CWindowDialogPlots::m_curCursorPos
mrpt::math::TPoint2D m_curCursorPos
In graph coords.
Definition: WxSubsystem.h:435
mrpt::gui::CWindowDialog
The wx dialog for gui::CDisplayWindow.
Definition: WxSubsystem.h:315
gui_frwds.h
mrpt::gui::CWindowDialogPlots::ID_PLOT
static const long ID_PLOT
Definition: WxSubsystem.h:428
mrpt::gui::CWindowDialog::OnClose
void OnClose(wxCloseEvent &event)
Definition: CDisplayWindow.cpp:167
TPoint2D.h
mrpt::gui::WxSubsystem::pushPendingWxRequest
static void pushPendingWxRequest(TRequestToWxMainThread *data)
Thread-safe method to insert a new pending request (The memory must be dinamically allocated with "ne...
Definition: WxSubsystem.cpp:254
mrpt::gui::C3DWindowDialog::OnMenuAbout
void OnMenuAbout(wxCommandEvent &event)
Definition: CDisplayWindow3D.cpp:338
mrpt::gui::CWindowDialogPlots::m_last_mouse_point
wxPoint m_last_mouse_point
In pixels.
Definition: WxSubsystem.h:437
mrpt::gui::C3DWindowDialog::CMyGLCanvas_DisplayWindow3D
friend class gui::CMyGLCanvas_DisplayWindow3D
Definition: WxSubsystem.h:383
mrpt::math::TPoint2D_< double >
mrpt::gui::C3DWindowDialog::ID_MENUITEM2
static const long ID_MENUITEM2
Definition: WxSubsystem.h:406
mrpt::gui::CWindowDialog::OnMenuClose
void OnMenuClose(wxCommandEvent &event)
Definition: CDisplayWindow.cpp:276
mrpt::gui::CWindowDialog::wxMRPTImageControl::GetBitmap
void GetBitmap(wxBitmap &bmp)
Definition: CDisplayWindow.cpp:93
mrpt::gui::CWindowDialogPlots::OnResize
void OnResize(wxSizeEvent &event)
Definition: CDisplayWindowPlots.cpp:196
mrpt::gui::CWindowDialog::OnResize
void OnResize(wxSizeEvent &event)
Definition: CDisplayWindow.cpp:221
mrpt::gui::CWindowDialog::wxMRPTImageControl
A custom control to display the bitmap and avoid flicker.
Definition: WxSubsystem.h:320
mrpt::gui::CWindowDialogPlots::OnChar
void OnChar(wxKeyEvent &event)
Definition: CDisplayWindowPlots.cpp:173
mrpt::gui::WxSubsystem::CWXMainFrame::CWXMainFrame
CWXMainFrame(wxWindow *parent, wxWindowID id=-1)
Definition: WxSubsystem.cpp:154
mrpt::gui::C3DWindowDialog::OnClose
void OnClose(wxCloseEvent &event)
Definition: CDisplayWindow3D.cpp:307
mrpt::gui::WxSubsystem::TRequestToWxMainThread::TRequestToWxMainThread
TRequestToWxMainThread()=default
mrpt::gui::WxSubsystem::CWXMainFrame::m_windowCount
static int m_windowCount
Definition: WxSubsystem.h:157
mrpt::gui::CWindowDialogPlots::plotEllipse
void plotEllipse(const mrpt::math::CVectorFloat &x, const mrpt::math::CVectorFloat &y, const std::string &lineFormat, const std::string &plotName, bool showName=false)
Redirected from CDisplayWindowPlots::plotEllipse.
Definition: CDisplayWindowPlots.cpp:442
mrpt::gui::WxSubsystem::listPendingWxRequests
static std::queue< TRequestToWxMainThread * > * listPendingWxRequests
Do not access directly to this, use the thread-safe functions.
Definition: WxSubsystem.h:306
mrpt::gui::CWindowDialogPlots::OnMenuSelected
void OnMenuSelected(wxCommandEvent &ev)
Definition: CDisplayWindowPlots.cpp:248
mrpt::gui::C3DWindowDialog::C3DWindowDialog
C3DWindowDialog(CDisplayWindow3D *win3D, WxSubsystem::CWXMainFrame *parent, wxWindowID id=-1, const std::string &caption=std::string("[MRPT-CDisplayWindow3D]"), wxSize initialSize=wxDefaultSize)
Definition: CDisplayWindow3D.cpp:264
mrpt::gui::CWindowDialogPlots::OnMenuClose
void OnMenuClose(wxCommandEvent &event)
Definition: CDisplayWindowPlots.cpp:233
mrpt::gui::CWindowDialogPlots::plot
void plot(const mrpt::math::CVectorFloat &x, const mrpt::math::CVectorFloat &y, const std::string &lineFormat, const std::string &plotName)
Redirected from CDisplayWindowPlots::plot.
Definition: CDisplayWindowPlots.cpp:286
mrpt::gui::WxSubsystem::CAuxWxSubsystemShutdowner
An auxiliary global object used just to launch a final request to the wxSubsystem for shutdown:
Definition: WxSubsystem.h:121
mrpt::gui::C3DWindowDialog::m_canvas
CMyGLCanvas_DisplayWindow3D * m_canvas
Definition: WxSubsystem.h:396
mrpt::gui::WxSubsystem::TWxMainThreadData::m_done
std::promise< void > m_done
Definition: WxSubsystem.h:173
mrpt::gui::CWindowDialogPlots::OnMenuPrint
void OnMenuPrint(wxCommandEvent &event)
Definition: CDisplayWindowPlots.cpp:235
mrpt::gui::C3DWindowDialog::OnResize
void OnResize(wxSizeEvent &event)
Definition: CDisplayWindow3D.cpp:352
mrpt::gui::CWindowDialogPlots::OnMouseMove
void OnMouseMove(wxMouseEvent &event)
Definition: CDisplayWindowPlots.cpp:260
mrpt::gui::CWindowDialogPlots::m_firstSubmenu
bool m_firstSubmenu
to know whether to insert a separator the first time.
Definition: WxSubsystem.h:431
mrpt::gui::WxSubsystem::wxMainThread
static void wxMainThread()
This will be the "MAIN" of wxWidgets: It starts an application object and does not end until all the ...
Definition: WxSubsystem.cpp:939
mrpt::gui::CWindowDialog::wxMRPTImageControl::m_img
std::unique_ptr< wxBitmap > m_img
Definition: WxSubsystem.h:323
mrpt::gui::WxSubsystem::isConsoleApp
static bool isConsoleApp()
Will be set to true at runtime if it's not detected a running wxApp instance.
Definition: WxSubsystem.cpp:51
mrpt::gui::WxSubsystem::TWxMainThreadData::m_semWxMainThreadReady
std::promise< void > m_semWxMainThreadReady
This is signaled when wxMainThread is ready.
Definition: WxSubsystem.h:172
mrpt::gui::WxSubsystem
This class implements the GUI thread required for the wxWidgets-based GUI.
Definition: WxSubsystem.h:96
mrpt::gui::WxSubsystem::GetWxMainThreadInstance
static TWxMainThreadData & GetWxMainThreadInstance()
Definition: WxSubsystem.cpp:999
mrpt::gui::CWindowDialogPlots::~CWindowDialogPlots
~CWindowDialogPlots() override
mrpt::gui::WxSubsystem::TRequestToWxMainThread::vector_x
mrpt::math::CVectorFloat vector_x
Definition: WxSubsystem.h:218
mrpt::gui::CWindowDialog::wxMRPTImageControl::OnPaint
void OnPaint(wxPaintEvent &ev)
Definition: CDisplayWindow.cpp:79
mrpt::gui::WxSubsystem::getMRPTDefaultIcon
static wxBitmap getMRPTDefaultIcon()
Definition: WxSubsystem.cpp:769
mrpt::gui::WxSubsystem::CWXMainFrame::notifyWindowCreation
static int notifyWindowCreation()
Atomically increments the number of windows created with the main frame as parent.
Definition: WxSubsystem.cpp:193
mrpt::gui::CWindowDialog::wxMRPTImageControl::OnEraseBackground
void OnEraseBackground(wxEraseEvent &ev)
Definition: WxSubsystem.h:346
mrpt::gui::C3DWindowDialog::OnMenuClose
void OnMenuClose(wxCommandEvent &event)
Definition: CDisplayWindow3D.cpp:336
mrpt::gui::WxSubsystem::TRequestToWxMainThread::source2D
mrpt::gui::CDisplayWindow * source2D
Only one of source* can be non-nullptr, indicating the class that generated the request.
Definition: WxSubsystem.h:195
CVectorDynamic.h
mrpt::gui::C3DWindowDialog::m_mainFrame
WxSubsystem::CWXMainFrame * m_mainFrame
Definition: WxSubsystem.h:394
mrpt::gui::WxSubsystem::CWXMainFrame::notifyWindowDestruction
static int notifyWindowDestruction()
Atomically decrements the number of windows created with the main frame as parent.
Definition: WxSubsystem.cpp:199
mrpt::gui::WxSubsystem::CAuxWxSubsystemShutdowner::~CAuxWxSubsystemShutdowner
~CAuxWxSubsystemShutdowner()
Definition: WxSubsystem.cpp:56
mrpt::gui::WxSubsystem::TRequestToWxMainThread::str
std::string str
Parameters, depending on OPCODE.
Definition: WxSubsystem.h:211
mrpt::gui::CWindowDialog::wxMRPTImageControl::OnChar
void OnChar(wxKeyEvent &ev)
Definition: CDisplayWindow.cpp:72
mrpt::gui::WxSubsystem::TRequestToWxMainThread
The data structure for each inter-thread request:
Definition: WxSubsystem.h:189
mrpt::gui::CWindowDialogPlots::m_ID2ID
std::map< long, long > m_ID2ID
wxIDs to user IDs for submenus.
Definition: WxSubsystem.h:433
mrpt::gui::WxSubsystem::TWxMainThreadData
Definition: WxSubsystem.h:167
mrpt::gui::WxSubsystem::TRequestToWxMainThread::boolVal
bool boolVal
Definition: WxSubsystem.h:217
mrpt::gui::WxSubsystem::CAuxWxSubsystemShutdowner::CAuxWxSubsystemShutdowner
CAuxWxSubsystemShutdowner()
opengl_fonts.h
mrpt::gui::CWindowDialog::m_image
wxMRPTImageControl * m_image
Definition: WxSubsystem.h:363
mrpt::gui::WxSubsystem::popPendingWxRequest
static TRequestToWxMainThread * popPendingWxRequest()
Thread-safe method to return the next pending request, or nullptr if there is none (After usage,...
Definition: WxSubsystem.cpp:232
mrpt::gui::WxSubsystem::CWXMainFrame::OnTimerProcessRequests
void OnTimerProcessRequests(wxTimerEvent &event)
This method processes the pending requests from the main MRPT application thread.
Definition: WxSubsystem.cpp:282
mrpt::gui::CWindowDialogPlots::OnClose
void OnClose(wxCloseEvent &event)
Definition: CDisplayWindowPlots.cpp:146
mrpt::gui::WxSubsystem::TRequestToWxMainThread::OPCODE
int OPCODE
Valid codes are: For CDisplayWindow:
Definition: WxSubsystem.h:283
mrpt::gui::CWindowDialog::wxMRPTImageControl::wxMRPTImageControl
wxMRPTImageControl(wxWindow *parent, wxWindowID winID, int x, int y, int width, int height)
Definition: CDisplayWindow.cpp:38
mrpt::gui::CWindowDialogPlots::OnMenuAbout
void OnMenuAbout(wxCommandEvent &event)
Definition: CDisplayWindowPlots.cpp:240
mrpt::gui::WxSubsystem::global_wxsubsystem_shutdown
static CAuxWxSubsystemShutdowner global_wxsubsystem_shutdown
Definition: WxSubsystem.h:128
mrpt::gui::C3DWindowDialog
Definition: WxSubsystem.h:381
mrpt::gui::WxSubsystem::TRequestToWxMainThread::y
int y
Definition: WxSubsystem.h:216
mrpt::gui::WxSubsystem::TRequestToWxMainThread::plotName
std::string plotName
Definition: WxSubsystem.h:219
mrpt::gui::WxSubsystem::TWxMainThreadData::m_csWxMainThreadId
std::mutex m_csWxMainThreadId
The critical section for accessing "m_wxMainThreadId".
Definition: WxSubsystem.h:175
mrpt::gui::CWindowDialog::wxMRPTImageControl::OnMouseMove
void OnMouseMove(wxMouseEvent &ev)
Definition: CDisplayWindow.cpp:60
mrpt::gui::CWindowDialog::OnChar
void OnChar(wxKeyEvent &event)
Definition: CDisplayWindow.cpp:198
mrpt::gui::WxSubsystem::cs_listPendingWxRequests
static std::mutex * cs_listPendingWxRequests
Definition: WxSubsystem.h:307
mrpt::gui::CWindowDialog::wxMRPTImageControl::m_last_mouse_click
wxPoint m_last_mouse_click
Definition: WxSubsystem.h:333
mrpt::gui::CWindowDialog::CWindowDialog
CWindowDialog(CDisplayWindow *win2D, WxSubsystem::CWXMainFrame *parent, wxWindowID id=-1, const std::string &caption=std::string("[MRPT-CDisplayWindow]"), wxSize initialSize=wxDefaultSize)
Definition: CDisplayWindow.cpp:100
mrpt::gui::CWindowDialog::wxMRPTImageControl::AssignImage
void AssignImage(wxBitmap *img)
Assigns this image.
Definition: CDisplayWindow.cpp:73
mrpt::gui::CDisplayWindow
This class creates a window as a graphical user interface (GUI) for displaying images to the user.
Definition: CDisplayWindow.h:33
mrpt::gui::CWindowDialog::m_win2D
CDisplayWindow * m_win2D
Definition: WxSubsystem.h:359
mrpt::gui
Classes for creating GUI windows for 2D and 3D visualization.
Definition: about_box.h:14
mrpt::gui::WxSubsystem::CWXMainFrame
The main frame of the wxWidgets application.
Definition: WxSubsystem.h:132
mrpt::gui::CWindowDialog::OnMenuSave
void OnMenuSave(wxCommandEvent &event)
Definition: CDisplayWindow.cpp:286
mrpt::gui::CWindowDialogPlots::CWindowDialogPlots
CWindowDialogPlots(CDisplayWindowPlots *winPlots, WxSubsystem::CWXMainFrame *parent, wxWindowID id=-1, const std::string &caption=std::string("[MRPT-CDisplayWindowPlots]"), wxSize initialSize=wxDefaultSize)
Definition: CDisplayWindowPlots.cpp:39
mrpt::math::CVectorDynamic
Template for column vectors of dynamic size, compatible with Eigen.
Definition: CVectorDynamic.h:31
mrpt::gui::CWindowDialogPlots::m_winPlots
CDisplayWindowPlots * m_winPlots
Definition: WxSubsystem.h:423
mrpt::gui::CWindowDialog::OnMouseMove
void OnMouseMove(wxMouseEvent &event)
Definition: CDisplayWindow.cpp:257
mrpt::gui::CDisplayWindowPlots
Create a GUI window and display plots with MATLAB-like interfaces and commands.
Definition: CDisplayWindowPlots.h:33
mrpt::gui::CWindowDialog::wxMRPTImageControl::~wxMRPTImageControl
~wxMRPTImageControl() override
Definition: CDisplayWindow.cpp:54
mrpt::gui::C3DWindowDialog::m_win3D
CDisplayWindow3D * m_win3D
Definition: WxSubsystem.h:393
mrpt::gui::CWindowDialog::wxMRPTImageControl::m_img_cs
std::mutex m_img_cs
Definition: WxSubsystem.h:324
mrpt::gui::WxSubsystem::TRequestToWxMainThread::sourceCameraSelectDialog
bool sourceCameraSelectDialog
Only one of source* can be non-nullptr, indicating the class that generated the request.
Definition: WxSubsystem.h:207
mrpt::gui::CWindowDialog::ID_IMAGE_BITMAP
static const long ID_IMAGE_BITMAP
Definition: WxSubsystem.h:365
mrpt::gui::CWindowDialog::OnMouseDown
void OnMouseDown(wxMouseEvent &event)
Definition: CDisplayWindow.cpp:239
mrpt::gui::CWindowDialog::~CWindowDialog
~CWindowDialog() override
mrpt::gui::WxSubsystem::waitWxShutdownsIfNoWindows
static void waitWxShutdownsIfNoWindows()
This method must be called in the destructor of the user class FROM THE MAIN THREAD,...
Definition: WxSubsystem.cpp:835
mrpt::gui::CWindowDialog::wxMRPTImageControl::m_win2D
CDisplayWindow * m_win2D
Definition: WxSubsystem.h:325
mrpt::gui::WxSubsystem::CWXMainFrame::cs_windowCount
static std::mutex cs_windowCount
Definition: WxSubsystem.h:156
mrpt::gui::CWindowDialogPlots::m_mainFrame
WxSubsystem::CWXMainFrame * m_mainFrame
Definition: WxSubsystem.h:424
mrpt::gui::CWindowDialogPlots::m_plot
mpWindow * m_plot
Definition: WxSubsystem.h:426
mrpt::gui::WxSubsystem::CWXMainFrame::m_theTimer
wxTimer * m_theTimer
Definition: WxSubsystem.h:159
mrpt::gui::CWindowDialog::wxMRPTImageControl::OnMouseClick
void OnMouseClick(wxMouseEvent &ev)
Definition: CDisplayWindow.cpp:66
mrpt::gui::WxSubsystem::TRequestToWxMainThread::x
int x
Definition: WxSubsystem.h:216
mrpt::gui::WxSubsystem::TRequestToWxMainThread::vector_y
mrpt::math::CVectorFloat vector_y
Definition: WxSubsystem.h:218
mrpt::gui::CWindowDialogPlots::OnMouseDown
void OnMouseDown(wxMouseEvent &event)
Definition: CDisplayWindowPlots.cpp:214
mrpt::gui::C3DWindowDialog::OnChar
void OnChar(wxKeyEvent &event)
Definition: CDisplayWindow3D.cpp:345
mrpt::gui::WxSubsystem::TRequestToWxMainThread::source3D
mrpt::gui::CDisplayWindow3D * source3D
Only one of source* can be non-nullptr, indicating the class that generated the request.
Definition: WxSubsystem.h:199
mrpt::gui::CWindowDialog::OnMenuAbout
void OnMenuAbout(wxCommandEvent &event)
Definition: CDisplayWindow.cpp:278
mrpt::gui::WxSubsystem::CWXMainFrame::oneInstance
static volatile CWXMainFrame * oneInstance
Definition: WxSubsystem.h:153
mrpt::gui::CWindowDialogPlots
The wx dialog for gui::CDisplayWindowPlots.
Definition: WxSubsystem.h:413
mrpt::gui::CWindowDialogPlots::ID_MENU_PRINT
static const long ID_MENU_PRINT
Definition: WxSubsystem.h:429
mrpt::gui::CDisplayWindow3D
A graphical user interface (GUI) for efficiently rendering 3D scenes in real-time.
Definition: CDisplayWindow3D.h:117
mrpt::gui::CWindowDialog::OnKeyDown
void OnKeyDown(wxKeyEvent &event)
Definition: CDisplayWindow.cpp:193
mrpt::gui::WxSubsystem::CWXMainFrame::~CWXMainFrame
~CWXMainFrame() override
Definition: WxSubsystem.cpp:180
mrpt::gui::WxSubsystem::TRequestToWxMainThread::voidPtr2
void * voidPtr2
Definition: WxSubsystem.h:215
mrpt::gui::WxSubsystem::TWxMainThreadData::m_wxMainThreadId
std::thread m_wxMainThreadId
The thread ID of wxMainThread, or 0 if it is not running.
Definition: WxSubsystem.h:170



Page generated by Doxygen 1.8.17 for MRPT 2.0.4 at Sat Jun 27 14:00:59 UTC 2020