Go to the documentation of this file.
26 void* winobj_voidptr,
int CMD_CREATE_WIN,
int CMD_DESTROY_WIN,
28 : m_CMD_CREATE_WIN(CMD_CREATE_WIN),
29 m_CMD_DESTROY_WIN(CMD_DESTROY_WIN),
30 m_winobj_voidptr(winobj_voidptr),
31 m_caption(initial_caption),
43 unsigned int initialWidth,
unsigned int initialHeight)
48 #if MRPT_HAS_WXWIDGETS
62 REQ->
x = initialWidth;
63 REQ->
y = initialHeight;
70 std::this_thread::sleep_for(
72 wxApp::GetInstance()->Yield(
true);
82 const char* envVal = getenv(
"MRPT_WXSUBSYS_TIMEOUT_MS");
83 if (envVal) maxTimeout = atoi(envVal);
86 if (future.wait_for(std::chrono::milliseconds(maxTimeout)) ==
87 std::future_status::timeout)
89 cerr <<
"[CBaseGUIWindow::ctor] Timeout waiting window creation."
108 #if MRPT_HAS_WXWIDGETS
125 std::this_thread::sleep_for(20ms);
128 wxApp::GetInstance()->Yield(
true);
130 const int maxTimeout =
137 std::chrono::milliseconds(maxTimeout)) ==
138 std::future_status::timeout)
140 cerr <<
"[CBaseGUIWindow::dtor] Timeout waiting window destruction."
181 std::this_thread::sleep_for(10ms);
204 std::this_thread::sleep_for(10ms);
bool kbhit() noexcept
An OS-independent version of kbhit, which returns true if a key has been pushed.
volatile int m_keyPushedCode
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.
void createWxWindow(unsigned int initialWidth, unsigned int initialHeight)
Must be called by child classes just within the constructor.
static bool createOneInstanceMainThread()
Thread-safe method to create one single instance of the main wxWidgets thread: it will create the thr...
static void pushPendingWxRequest(TRequestToWxMainThread *data)
Thread-safe method to insert a new pending request (The memory must be dinamically allocated with "ne...
const int m_CMD_DESTROY_WIN
can be 299,399,499...
volatile mrptKeyModifier m_keyPushedModifier
#define MRPT_UNUSED_PARAM(a)
Determines whether this is an X86 or AMD64 platform.
const int m_CMD_CREATE_WIN
can be 200,300,400...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define THROW_EXCEPTION(msg)
static bool isConsoleApp()
Will be set to true at runtime if it's not detected a running wxApp instance.
std::promise< void > m_windowDestroyed
This semaphore will be signaled when the wx window is destroyed.
mrpt::gui::CDisplayWindow * source2D
Only one of source* can be non-nullptr, indicating the class that generated the request.
void notifySemThreadReady()
Called by wx main thread to signal the semaphore that the wx window is built and ready.
std::string str
Parameters, depending on OPCODE.
bool isOpen()
Returns false if the user has already closed the window.
The data structure for each inter-thread request:
int getPushedKey(mrptKeyModifier *out_pushModifier=nullptr)
Returns the latest pushed key, or 0 if there is no new key stroke.
std::string m_caption
The caption of the window.
mrpt::void_ptr_noncopy m_hwnd
The window handle.
int OPCODE
Valid codes are: For CDisplayWindow:
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.
void notifyChildWindowDestruction()
Called by wx main thread to set m_hwnd to NULL.
Create a GUI window and display plots with MATLAB-like interfaces and commands.
static void waitWxShutdownsIfNoWindows()
This method must be called in the destructor of the user class FROM THE MAIN THREAD,...
virtual ~CBaseGUIWindow()
std::promise< void > m_threadReady
This semaphore will be signaled when the wx window is built and ready.
int getch() noexcept
An OS-independent version of getch, which waits until a key is pushed.
volatile bool m_keyPushed
GLsizei const GLchar ** string
void destroyWxWindow()
Must be called by child classes in their destructors.
mrpt::gui::CDisplayWindow3D * source3D
Only one of source* can be non-nullptr, indicating the class that generated the request.
int waitForKey(bool ignoreControlKeys=true, mrptKeyModifier *out_pushModifier=nullptr)
Waits for any key to be pushed on the image or the console, and returns the key code.
A graphical user interface (GUI) for efficiently rendering 3D scenes in real-time.
CBaseGUIWindow(void *winobj_voidptr, int CMD_CREATE_WIN, int CMD_DESTROY_WIN, const std::string &initial_caption=std::string())
CMD_DESTROY_WIN can be 299,399,499...
This namespace provides a OS-independent interface to many useful functions: filenames manipulation,...
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 | |