70 void createWxWindow(
unsigned int initialWidth,
unsigned int initialHeight);
88 void* winobj_voidptr,
int CMD_CREATE_WIN,
int CMD_DESTROY_WIN,
132 bool ignoreControlKeys =
true,
The base class for GUI window classes.
int getPushedKey(mrptKeyModifier *out_pushModifier=nullptr)
Returns the latest pushed key, or 0 if there is no new key stroke.
virtual void setPos(int x, int y)=0
Changes the position of the window on the screen.
virtual bool getLastMousePosition(int &x, int &y) const =0
Gets the last x,y pixel coordinates of the mouse.
std::string m_caption
The caption of the window.
std::promise< void > m_threadReady
This semaphore will be signaled when the wx window is built and ready.
void notifyChildWindowDestruction()
Called by wx main thread to set m_hwnd to NULL.
bool keyHit() const
Returns true if a key has been pushed, without blocking waiting for a new key being pushed.
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.
bool isOpen()
Returns false if the user has already closed the window.
std::promise< void > m_windowDestroyed
This semaphore will be signaled when the wx window is destroyed.
void createWxWindow(unsigned int initialWidth, unsigned int initialHeight)
Must be called by child classes just within the constructor.
const int m_CMD_DESTROY_WIN
can be 299,399,499...
void destroyWxWindow()
Must be called by child classes in their destructors.
void * getWxObject()
Read-only access to the wxDialog object.
virtual ~CBaseGUIWindow()
mrpt::void_ptr_noncopy m_hwnd
The window handle.
virtual void setCursorCross(bool cursorIsCross)=0
Set cursor style to default (cursorIsCross=false) or to a cross (cursorIsCross=true)
void clearKeyHitFlag()
Assure that "keyHit" will return false until the next pushed key.
virtual void resize(unsigned int width, unsigned int height)=0
Resizes the window, stretching the image to fit into the display area.
volatile int m_keyPushedCode
volatile mrptKeyModifier m_keyPushedModifier
void notifySemThreadReady()
Called by wx main thread to signal the semaphore that the wx window is built and ready.
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...
const int m_CMD_CREATE_WIN
can be 200,300,400...
volatile bool m_keyPushed
virtual void setWindowTitle(const std::string &str)=0
Changes the window title text.
The wx dialog for gui::CDisplayWindow.
The wx dialog for gui::CDisplayWindowPlots.
An event sent by a window upon a mouse click, giving the (x,y) pixel coordinates.
virtual void do_nothing() override
Just to allow this class to be polymorphic.
mrpt::img::TPixelCoord coords
mrptEventMouseDown(CBaseGUIWindow *obj, mrpt::img::TPixelCoord _coords, bool _leftButton, bool _rightButton)
CBaseGUIWindow * source_object
An event sent by a window when the mouse is moved over it.
virtual void do_nothing() override
Just to allow this class to be polymorphic.
mrpt::img::TPixelCoord coords
mrptEventMouseMove(CBaseGUIWindow *obj, mrpt::img::TPixelCoord _coords, bool _leftButton, bool _rightButton)
CBaseGUIWindow * source_object
An event sent by a window upon a char pressed by the user.
virtual void do_nothing() override
Just to allow this class to be polymorphic.
mrptKeyModifier key_modifiers
Modifiers (Shift, Control, etc...)
int char_code
The virtual key code, as defined in <mrpt/gui/keycodes.h> (a replication of wxWidgets key codes).
CBaseGUIWindow * source_object
mrptEventWindowChar(CBaseGUIWindow *obj, int _char_code, mrptKeyModifier _key_mod)
An event sent by a window upon when it's about to be closed, either manually by the user or programma...
mrptEventWindowClosed(CBaseGUIWindow *obj, bool _allow_close=true)
virtual void do_nothing() override
Just to allow this class to be polymorphic.
CBaseGUIWindow * source_object
An event sent by a window upon resize.
mrptEventWindowResize(CBaseGUIWindow *obj, size_t _new_width, size_t _new_height)
CBaseGUIWindow * source_object
virtual void do_nothing() override
Just to allow this class to be polymorphic.
Inherit from this class for those objects capable of being observed by a CObserver class.
The basic event type for the observer-observable pattern in MRPT.
GLsizei GLsizei GLuint * obj
GLenum GLsizei GLsizei height
GLsizei const GLchar ** string
Classes for creating GUI windows for 2D and 3D visualization.
A pair (x,y) of pixel coordinates (integer resolution).