Go to the documentation of this file.
12 #include <mrpt/config.h>
22 #if MRPT_HAS_WXWIDGETS
25 #include <wx/statbmp.h>
27 #include <wx/toolbar.h>
30 #include <wx/statusbr.h>
31 #include <wx/msgdlg.h>
32 #include <wx/artprov.h>
33 #include <wx/bitmap.h>
36 #include <wx/string.h>
37 #include <wx/msgdlg.h>
38 #include <wx/filedlg.h>
39 #include <wx/progdlg.h>
40 #include <wx/imaglist.h>
41 #include <wx/busyinfo.h>
43 #include <wx/textdlg.h>
44 #include <wx/dirdlg.h>
45 #include <wx/colordlg.h>
46 #include <wx/dcmemory.h>
51 #include <mrpt/otherlibs/mathplot/mathplot.h>
55 #include <wx/chartpanel.h>
56 #include <wx/bars/barplot.h>
58 #include <wx/axis/numberaxis.h>
59 #include <wx/axis/categoryaxis.h>
60 #include <wx/axis/dateaxis.h>
62 #include <wx/xy/xyhistorenderer.h>
63 #include <wx/xy/xydataset.h>
64 #include <wx/xy/xylinerenderer.h>
65 #include <wx/xy/xyplot.h>
66 #include <wx/xy/xysimpledataset.h>
68 #include <wx/xyz/xyzdataset.h>
69 #include <wx/xyz/bubbleplot.h>
71 #include <wx/category/categorydataset.h>
72 #include <wx/category/categorysimpledataset.h>
101 #if MRPT_HAS_WXWIDGETS
166 DECLARE_EVENT_TABLE()
327 #if MRPT_HAS_WXWIDGETS
345 wxWindow* parent, wxWindowID winID,
int x,
int y,
int width,
357 void OnPaint(wxPaintEvent& ev);
360 void OnChar(wxKeyEvent& ev);
370 wxSize initialSize = wxDefaultSize);
382 void OnClose(wxCloseEvent& event);
386 void OnChar(wxKeyEvent& event);
392 DECLARE_EVENT_TABLE()
404 wxSize initialSize = wxDefaultSize);
414 const double x_frac,
const double y_frac,
const std::string& text,
418 const double x_frac,
const double y_frac,
const std::string& text,
421 const size_t unique_index,
const double font_spacing,
422 const double font_kerning,
const bool has_shadow,
426 void OnClose(wxCloseEvent& event);
429 void OnChar(wxKeyEvent& event);
435 DECLARE_EVENT_TABLE()
447 wxSize initialSize = wxDefaultSize);
480 bool showName =
false);
485 void* theWxImage,
const float& x0,
const float& y0,
const float&
w,
489 void OnClose(wxCloseEvent& event);
493 void OnChar(wxKeyEvent& event);
497 DECLARE_EVENT_TABLE()
502 #define _U(x) wxString((x), wxConvUTF8)
503 #define _UU(x, y) wxString((x), y)
506 #define _UU(x, y) (x)
TOpenGLFont
Existing fonts for 2D texts in mrpt::opengl methods.
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.
wxPoint m_last_mouse_point
static const long ID_MENUITEM1
WxSubsystem::CWXMainFrame * m_mainFrame
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
TOpenGLFontStyle
Different style for vectorized font rendering.
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...
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction.
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)
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:
virtual ~CWindowDialogPlots()
CMyGLCanvas_DisplayWindow3D * m_canvas
std::promise< void > m_done
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
GLubyte GLubyte GLubyte GLubyte w
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 ...
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()
mrpt::math::CVectorFloat vector_x
void addTextMessage(const double x_frac, const double y_frac, const std::string &text, const mrpt::img::TColorf &color, const size_t unique_index, const mrpt::opengl::TOpenGLFont font)
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)
GLsizei GLsizei GLenum GLenum const GLvoid * data
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
A RGB color - floats in the range [0,1].
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.
The main frame of the wxWidgets application.
GLenum GLsizei GLsizei height
void OnMenuSave(wxCommandEvent &event)
CWindowDialogPlots(CDisplayWindowPlots *winPlots, WxSubsystem::CWXMainFrame *parent, wxWindowID id=-1, const std::string &caption=std::string("[MRPT-CDisplayWindowPlots]"), wxSize initialSize=wxDefaultSize)
CDisplayWindowPlots * m_winPlots
void OnMouseMove(wxMouseEvent &event)
Create a GUI window and display plots with MATLAB-like interfaces and commands.
CDisplayWindow3D * m_win3D
virtual ~C3DWindowDialog()
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)
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)
virtual ~wxMRPTImageControl()
mrpt::math::CVectorFloat vector_y
void OnMouseDown(wxMouseEvent &event)
GLsizei const GLchar ** string
void image(void *theWxImage, const float &x0, const float &y0, const float &w, const float &h, const std::string &plotName)
Redirected from CDisplayWindowPlots::image.
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 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |