Go to the documentation of this file.
11 #include <mrpt/config.h>
22 #if MRPT_HAS_WXWIDGETS
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>
34 #include <wx/imaglist.h>
38 #include <wx/msgdlg.h>
40 #include <wx/progdlg.h>
42 #include <wx/statbmp.h>
43 #include <wx/statusbr.h>
44 #include <wx/string.h>
45 #include <wx/textdlg.h>
47 #include <wx/toolbar.h>
50 #include <mrpt/3rdparty/mathplot/mathplot.h>
54 #include <wx/bars/barplot.h>
55 #include <wx/chartpanel.h>
57 #include <wx/axis/categoryaxis.h>
58 #include <wx/axis/dateaxis.h>
59 #include <wx/axis/numberaxis.h>
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>
67 #include <wx/xyz/bubbleplot.h>
68 #include <wx/xyz/xyzdataset.h>
70 #include <wx/category/categorydataset.h>
71 #include <wx/category/categorysimpledataset.h>
98 #if MRPT_HAS_WXWIDGETS
163 DECLARE_EVENT_TABLE()
311 #if MRPT_HAS_WXWIDGETS
329 wxWindow* parent, wxWindowID winID,
int x,
int y,
int width,
341 void OnPaint(wxPaintEvent& ev);
344 void OnChar(wxKeyEvent& ev);
355 const std::string& caption = std::string(
"[MRPT-CDisplayWindow]"),
356 wxSize initialSize = wxDefaultSize);
368 void OnClose(wxCloseEvent& event);
372 void OnChar(wxKeyEvent& event);
378 DECLARE_EVENT_TABLE()
389 const std::string& caption = std::string(
"[MRPT-CDisplayWindow3D]"),
390 wxSize initialSize = wxDefaultSize);
399 void OnClose(wxCloseEvent& event);
402 void OnChar(wxKeyEvent& event);
408 DECLARE_EVENT_TABLE()
419 const std::string& caption = std::string(
"[MRPT-CDisplayWindowPlots]"),
420 wxSize initialSize = wxDefaultSize);
446 const std::string& lineFormat,
const std::string& plotName);
452 const std::string& lineFormat,
const std::string& plotName,
453 bool showName =
false);
458 void* theWxImage,
float x0,
float y0,
float w,
float h,
459 const std::string& plotName);
462 void OnClose(wxCloseEvent& event);
466 void OnChar(wxKeyEvent& event);
470 DECLARE_EVENT_TABLE()
mrpt::gui::CDisplayWindowPlots * sourcePlots
Only one of source* can be non-nullptr, indicating the class that generated the request.
void * voidPtr
Parameters, depending on OPCODE.
static struct FontData data
wxPoint m_last_mouse_point
static const long ID_MENUITEM1
WxSubsystem::CWXMainFrame * m_mainFrame
void image(void *theWxImage, float x0, float y0, float w, float h, const std::string &plotName)
Redirected from CDisplayWindowPlots::image.
~C3DWindowDialog() override
static bool createOneInstanceMainThread()
Thread-safe method to create one single instance of the main wxWidgets thread: it will create the thr...
mrpt::math::TPoint2D m_curCursorPos
In graph coords.
The wx dialog for gui::CDisplayWindow.
static const long ID_PLOT
void OnClose(wxCloseEvent &event)
static void pushPendingWxRequest(TRequestToWxMainThread *data)
Thread-safe method to insert a new pending request (The memory must be dinamically allocated with "ne...
void OnMenuAbout(wxCommandEvent &event)
wxPoint m_last_mouse_point
In pixels.
friend class gui::CMyGLCanvas_DisplayWindow3D
static const long ID_MENUITEM2
void OnMenuClose(wxCommandEvent &event)
void GetBitmap(wxBitmap &bmp)
void OnResize(wxSizeEvent &event)
void OnResize(wxSizeEvent &event)
A custom control to display the bitmap and avoid flicker.
void OnChar(wxKeyEvent &event)
CWXMainFrame(wxWindow *parent, wxWindowID id=-1)
void OnClose(wxCloseEvent &event)
TRequestToWxMainThread()=default
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.
static std::queue< TRequestToWxMainThread * > * listPendingWxRequests
Do not access directly to this, use the thread-safe functions.
void OnMenuSelected(wxCommandEvent &ev)
C3DWindowDialog(CDisplayWindow3D *win3D, WxSubsystem::CWXMainFrame *parent, wxWindowID id=-1, const std::string &caption=std::string("[MRPT-CDisplayWindow3D]"), wxSize initialSize=wxDefaultSize)
void OnMenuClose(wxCommandEvent &event)
void plot(const mrpt::math::CVectorFloat &x, const mrpt::math::CVectorFloat &y, const std::string &lineFormat, const std::string &plotName)
Redirected from CDisplayWindowPlots::plot.
An auxiliary global object used just to launch a final request to the wxSubsystem for shutdown:
CMyGLCanvas_DisplayWindow3D * m_canvas
std::promise< void > m_done
void OnMenuPrint(wxCommandEvent &event)
void OnResize(wxSizeEvent &event)
void OnMouseMove(wxMouseEvent &event)
bool m_firstSubmenu
to know whether to insert a separator the first time.
static void wxMainThread()
This will be the "MAIN" of wxWidgets: It starts an application object and does not end until all the ...
std::unique_ptr< wxBitmap > m_img
static bool isConsoleApp()
Will be set to true at runtime if it's not detected a running wxApp instance.
std::promise< void > m_semWxMainThreadReady
This is signaled when wxMainThread is ready.
This class implements the GUI thread required for the wxWidgets-based GUI.
static TWxMainThreadData & GetWxMainThreadInstance()
~CWindowDialogPlots() override
mrpt::math::CVectorFloat vector_x
void OnPaint(wxPaintEvent &ev)
static wxBitmap getMRPTDefaultIcon()
static int notifyWindowCreation()
Atomically increments the number of windows created with the main frame as parent.
void OnEraseBackground(wxEraseEvent &ev)
void OnMenuClose(wxCommandEvent &event)
mrpt::gui::CDisplayWindow * source2D
Only one of source* can be non-nullptr, indicating the class that generated the request.
WxSubsystem::CWXMainFrame * m_mainFrame
static int notifyWindowDestruction()
Atomically decrements the number of windows created with the main frame as parent.
~CAuxWxSubsystemShutdowner()
std::string str
Parameters, depending on OPCODE.
void OnChar(wxKeyEvent &ev)
The data structure for each inter-thread request:
std::map< long, long > m_ID2ID
wxIDs to user IDs for submenus.
CAuxWxSubsystemShutdowner()
wxMRPTImageControl * m_image
static TRequestToWxMainThread * popPendingWxRequest()
Thread-safe method to return the next pending request, or nullptr if there is none (After usage,...
void OnTimerProcessRequests(wxTimerEvent &event)
This method processes the pending requests from the main MRPT application thread.
void OnClose(wxCloseEvent &event)
int OPCODE
Valid codes are: For CDisplayWindow:
wxMRPTImageControl(wxWindow *parent, wxWindowID winID, int x, int y, int width, int height)
void OnMenuAbout(wxCommandEvent &event)
static CAuxWxSubsystemShutdowner global_wxsubsystem_shutdown
std::mutex m_csWxMainThreadId
The critical section for accessing "m_wxMainThreadId".
void OnMouseMove(wxMouseEvent &ev)
void OnChar(wxKeyEvent &event)
static std::mutex * cs_listPendingWxRequests
wxPoint m_last_mouse_click
CWindowDialog(CDisplayWindow *win2D, WxSubsystem::CWXMainFrame *parent, wxWindowID id=-1, const std::string &caption=std::string("[MRPT-CDisplayWindow]"), wxSize initialSize=wxDefaultSize)
void AssignImage(wxBitmap *img)
Assigns this image.
This class creates a window as a graphical user interface (GUI) for displaying images to the user.
Classes for creating GUI windows for 2D and 3D visualization.
The main frame of the wxWidgets application.
void OnMenuSave(wxCommandEvent &event)
CWindowDialogPlots(CDisplayWindowPlots *winPlots, WxSubsystem::CWXMainFrame *parent, wxWindowID id=-1, const std::string &caption=std::string("[MRPT-CDisplayWindowPlots]"), wxSize initialSize=wxDefaultSize)
Template for column vectors of dynamic size, compatible with Eigen.
CDisplayWindowPlots * m_winPlots
void OnMouseMove(wxMouseEvent &event)
Create a GUI window and display plots with MATLAB-like interfaces and commands.
~wxMRPTImageControl() override
CDisplayWindow3D * m_win3D
bool sourceCameraSelectDialog
Only one of source* can be non-nullptr, indicating the class that generated the request.
static const long ID_IMAGE_BITMAP
void OnMouseDown(wxMouseEvent &event)
~CWindowDialog() override
static void waitWxShutdownsIfNoWindows()
This method must be called in the destructor of the user class FROM THE MAIN THREAD,...
static std::mutex cs_windowCount
WxSubsystem::CWXMainFrame * m_mainFrame
void OnMouseClick(wxMouseEvent &ev)
mrpt::math::CVectorFloat vector_y
void OnMouseDown(wxMouseEvent &event)
void OnChar(wxKeyEvent &event)
mrpt::gui::CDisplayWindow3D * source3D
Only one of source* can be non-nullptr, indicating the class that generated the request.
void OnMenuAbout(wxCommandEvent &event)
static volatile CWXMainFrame * oneInstance
The wx dialog for gui::CDisplayWindowPlots.
static const long ID_MENU_PRINT
A graphical user interface (GUI) for efficiently rendering 3D scenes in real-time.
void OnKeyDown(wxKeyEvent &event)
std::thread m_wxMainThreadId
The thread ID of wxMainThread, or 0 if it is not running.
Page generated by Doxygen 1.8.17 for MRPT 2.0.4 at Sun Jul 19 17:54:30 UTC 2020 | |