This class creates a window as a graphical user interface (GUI) for displaying images to the user.
For a list of supported events with the observer/observable pattern, see the discussion in mrpt::gui::CBaseGUIWindow.
Definition at line 48 of file CDisplayWindow.h.
#include <mrpt/gui/CDisplayWindow.h>

Public Member Functions | |
| CDisplayWindow (const std::string &windowCaption=std::string(), unsigned int initWidth=400, unsigned int initHeight=400) | |
| Constructor. | |
| virtual | ~CDisplayWindow () |
| Destructor. | |
| virtual bool | getLastMousePosition (int &x, int &y) const |
| Gets the last x,y pixel coordinates of the mouse. | |
| virtual void | setCursorCross (bool cursorIsCross) |
| Set cursor style to default (cursorIsCross=false) or to a cross (cursorIsCross=true) | |
| void | showImageAndPoints (const CImage &img, const vector_float &x, const vector_float &y, const TColor &color=TColor::red, const bool &showNumbers=false) |
| Show a given color or grayscale image on the window and print a set of points on it. | |
| template<class FEATURELIST > | |
| void | showImageAndPoints (const CImage &img, const FEATURELIST &list, const TColor &color=TColor::red, const bool &showIDs=false) |
| Show a given color or grayscale image on the window and print a set of points on it. | |
| template<class FEATURELIST > | |
| void | showTiledImageAndPoints (const CImage &img, const FEATURELIST &list, const TColor &color=TColor::red) |
| Show a given color or grayscale image on the window and print a set of points on it and a set of lines splitting the image in tiles. | |
| template<class MATCHEDLIST > | |
| void | showImagesAndMatchedPoints (const CImage &img1, const CImage &img2, const MATCHEDLIST &mList, const TColor &color=TColor::red, bool showNumbers=false) |
| Show a pair of given color or grayscale images (put together) on the window and print a set of matches on them. | |
| template<class FEATURELIST > | |
| void | showImagesAndMatchedPoints (const CImage &img1, const CImage &img2, const FEATURELIST &leftList, const FEATURELIST &rightList, const TColor &color=TColor::red) |
| Show a pair of given color or grayscale images (put together) on the window and print a set of matches on them. | |
| void | showImage (const CImage &img) |
| Show a given color or grayscale image on the window. | |
| void | plot (const vector_float &x, const vector_float &y) |
| Plots a graph in MATLAB-like style. | |
| void | plot (const vector_float &y) |
| Plots a graph in MATLAB-like style. | |
| void | resize (unsigned int width, unsigned int height) |
| Resizes the window, stretching the image to fit into the display area. | |
| void | setPos (int x, int y) |
| Changes the position of the window on the screen. | |
| void | enableCursorCoordinatesVisualization (bool enable) |
| Enables or disables the visualization of cursor coordinates on the window caption (default = enabled). | |
| void | setWindowTitle (const std::string &str) |
| Changes the window title text. | |
| void * | getWxObject () |
| Read-only access to the wxDialog object. | |
| void | notifyChildWindowDestruction () |
| Called by wx main thread to set m_hwnd to NULL. | |
| void | notifySemThreadReady () |
| Called by wx main thread to signal the semaphore that the wx window is built and ready. | |
| bool | isOpen () |
| Returns false if the user has already closed the window. | |
| int | waitForKey (bool ignoreControlKeys=true, mrptKeyModifier *out_pushModifier=NULL) |
| Waits for any key to be pushed on the image or the console, and returns the key code. | |
| bool | keyHit () const |
| Returns true if a key has been pushed, without blocking waiting for a new key being pushed. | |
| void | clearKeyHitFlag () |
| Assure that "keyHit" will return false until the next pushed key. | |
| int | getPushedKey (mrptKeyModifier *out_pushModifier=NULL) |
| Returns the latest pushed key, or 0 if there is no new key stroke. | |
| mrpt::utils::CObjectPtr | duplicateGetSmartPtr () const |
| Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer). | |
| CObject * | clone () const |
| Cloning interface for smart pointers. | |
Static Public Member Functions | |
| static CDisplayWindowPtr | Create (const std::string &windowCaption=std::string(), unsigned int initWidth=400, unsigned int initHeight=400) |
| Class factory returning a smart pointer. | |
Static Public Attributes | |
| static const mrpt::utils::TRuntimeClassId | classCObject |
RTTI stuff | |
| static const mrpt::utils::TRuntimeClassId | classCBaseGUIWindow |
Protected Member Functions | |
| void | createWxWindow (unsigned int initialWidth, unsigned int initialHeight) |
| Must be called by child classes just within the constructor. | |
| void | destroyWxWindow () |
| Must be called by child classes in their destructors. The code cannot be put into this class' destructor. | |
| void | publishEvent (const mrptEvent &e) const |
| Called when you want this object to emit an event to all the observers currently subscribed to this object. | |
| bool | hasSubscribers () const |
| Can be called by a derived class before preparing an event for publishing with publishEvent to determine if there is no one subscribed, so it can save the wasted time preparing an event that will be not read. | |
Protected Attributes | |
| bool | m_enableCursorCoordinates |
| Enables or disables the visualization of cursor coordinates on the window caption. | |
| synch::CSemaphore | m_semThreadReady |
| This semaphore will be signaled when the wx window is built and ready. | |
| synch::CSemaphore | m_semWindowDestroyed |
| This semaphore will be signaled when the wx window is destroyed. | |
| std::string | m_caption |
| The caption of the window. | |
| void_ptr_noncopy | m_hwnd |
| The window handle. | |
| volatile bool | m_keyPushed |
| volatile int | m_keyPushedCode |
| volatile mrptKeyModifier | m_keyPushedModifier |
RTTI stuff | |
| typedef CDisplayWindowPtr | SmartPtr |
| static mrpt::utils::CLASSINIT | _init_CDisplayWindow |
| static mrpt::utils::TRuntimeClassId | classCDisplayWindow |
| static const mrpt::utils::TRuntimeClassId * | classinfo |
| static const mrpt::utils::TRuntimeClassId * | _GetBaseClass () |
| virtual const mrpt::utils::TRuntimeClassId * | GetRuntimeClass () const |
| Returns information about the class of an object in runtime. | |
| virtual mrpt::utils::CObject * | duplicate () const |
| Returns a copy of the object, indepently of its class. | |
| static mrpt::utils::CObject * | CreateObject () |
| static CDisplayWindowPtr | Create () |
A typedef for the associated smart pointer
Definition at line 51 of file CDisplayWindow.h.
| mrpt::gui::CDisplayWindow::CDisplayWindow | ( | const std::string & | windowCaption = std::string(), |
| unsigned int | initWidth = 400, |
||
| unsigned int | initHeight = 400 |
||
| ) |
Constructor.
|
virtual |
Destructor.
|
staticprotected |
|
inlineinherited |
Assure that "keyHit" will return false until the next pushed key.
Definition at line 150 of file CBaseGUIWindow.h.
|
inlineinherited |
|
static |
|
inlinestatic |
Class factory returning a smart pointer.
Definition at line 65 of file CDisplayWindow.h.
|
static |
|
protectedinherited |
Must be called by child classes just within the constructor.
|
protectedinherited |
Must be called by child classes in their destructors. The code cannot be put into this class' destructor.
|
virtual |
Returns a copy of the object, indepently of its class.
Implements mrpt::utils::CObject.
|
inlineinherited |
|
inline |
Enables or disables the visualization of cursor coordinates on the window caption (default = enabled).
Definition at line 215 of file CDisplayWindow.h.
|
virtual |
Gets the last x,y pixel coordinates of the mouse.
Implements mrpt::gui::CBaseGUIWindow.
|
inherited |
Returns the latest pushed key, or 0 if there is no new key stroke.
| out_pushModifier | If set to !=NULL, the modifiers of the key stroke will be saved here. |
|
virtual |
Returns information about the class of an object in runtime.
Reimplemented from mrpt::gui::CBaseGUIWindow.
|
inlineinherited |
Read-only access to the wxDialog object.
Definition at line 98 of file CBaseGUIWindow.h.
References mrpt::utils::non_copiable_ptr_basic< T >::get().
|
inlineprotectedinherited |
Can be called by a derived class before preparing an event for publishing with publishEvent to determine if there is no one subscribed, so it can save the wasted time preparing an event that will be not read.
Definition at line 69 of file CObservable.h.
|
inherited |
Returns false if the user has already closed the window.
|
inlineinherited |
Returns true if a key has been pushed, without blocking waiting for a new key being pushed.
Definition at line 145 of file CBaseGUIWindow.h.
|
inherited |
Called by wx main thread to set m_hwnd to NULL.
|
inherited |
Called by wx main thread to signal the semaphore that the wx window is built and ready.
| void mrpt::gui::CDisplayWindow::plot | ( | const vector_float & | x, |
| const vector_float & | y | ||
| ) |
Plots a graph in MATLAB-like style.
| void mrpt::gui::CDisplayWindow::plot | ( | const vector_float & | y | ) |
Plots a graph in MATLAB-like style.
|
protectedinherited |
Called when you want this object to emit an event to all the observers currently subscribed to this object.
|
virtual |
Resizes the window, stretching the image to fit into the display area.
Implements mrpt::gui::CBaseGUIWindow.
|
virtual |
Set cursor style to default (cursorIsCross=false) or to a cross (cursorIsCross=true)
Implements mrpt::gui::CBaseGUIWindow.
|
virtual |
Changes the position of the window on the screen.
Implements mrpt::gui::CBaseGUIWindow.
|
virtual |
Changes the window title text.
Implements mrpt::gui::CBaseGUIWindow.
| void mrpt::gui::CDisplayWindow::showImage | ( | const CImage & | img | ) |
Show a given color or grayscale image on the window.
It adapts the size of the window to that of the image.
| void mrpt::gui::CDisplayWindow::showImageAndPoints | ( | const CImage & | img, |
| const vector_float & | x, | ||
| const vector_float & | y, | ||
| const TColor & | color = TColor::red, |
||
| const bool & | showNumbers = false |
||
| ) |
Show a given color or grayscale image on the window and print a set of points on it.
It adapts the size of the window to that of the image.
|
inline |
Show a given color or grayscale image on the window and print a set of points on it.
It adapts the size of the window to that of the image. The class of FEATURELIST can be: mrpt::vision::CFeatureList or any STL container of entities having "x","y" and "ID" fields.
Definition at line 93 of file CDisplayWindow.h.
References CH_RGB, mrpt::utils::CImage::colorImage(), MRPT_END, and MRPT_START.
|
inline |
Show a pair of given color or grayscale images (put together) on the window and print a set of matches on them.
It adapts the size of the window to that of the image. MATCHEDLIST can be of the class: mrpt::vision::CMatchedFeatureList, or any STL container of pairs of anything having ".x" and ".y" (e.g. mrpt::math::TPoint2D)
Definition at line 133 of file CDisplayWindow.h.
References mrpt::utils::CImage::getWidth(), mrpt::utils::CImage::joinImagesHorz(), MRPT_END, MRPT_START, mrpt::utils::round(), and mrpt::mrpt::system::os::sprintf().
|
inline |
Show a pair of given color or grayscale images (put together) on the window and print a set of matches on them.
It adapts the size of the window to that of the image. FEATURELIST can be of the class: mrpt::vision::CFeatureList
Definition at line 169 of file CDisplayWindow.h.
References ASSERT_, mrpt::utils::CImage::getWidth(), MRPT_END, MRPT_START, and mrpt::utils::round().
|
inline |
Show a given color or grayscale image on the window and print a set of points on it and a set of lines splitting the image in tiles.
It adapts the size of the window to that of the image. The class of FEATURELIST can be: mrpt::vision::CFeatureList
Definition at line 108 of file CDisplayWindow.h.
References mrpt::utils::CImage::colorImage(), MRPT_END, and MRPT_START.
|
inherited |
Waits for any key to be pushed on the image or the console, and returns the key code.
This method remove key strokes previous to its call, so it will always wait. To get the latest pushed key, see
| ignoreControlKeys | If set to false, any push of shift, cmd, control, etc... will make this method to return. |
| out_pushModifier | If set to !=NULL, the modifiers of the key stroke will be saved here. |
|
staticprotected |
Definition at line 51 of file CDisplayWindow.h.
|
staticinherited |
Definition at line 72 of file CBaseGUIWindow.h.
|
static |
Definition at line 51 of file CDisplayWindow.h.
|
staticinherited |
|
static |
Definition at line 51 of file CDisplayWindow.h.
|
protectedinherited |
The caption of the window.
Definition at line 86 of file CBaseGUIWindow.h.
|
protected |
Enables or disables the visualization of cursor coordinates on the window caption.
Definition at line 57 of file CDisplayWindow.h.
|
protectedinherited |
The window handle.
Definition at line 87 of file CBaseGUIWindow.h.
|
protectedinherited |
Definition at line 90 of file CBaseGUIWindow.h.
|
protectedinherited |
Definition at line 91 of file CBaseGUIWindow.h.
|
protectedinherited |
Definition at line 92 of file CBaseGUIWindow.h.
|
protectedinherited |
This semaphore will be signaled when the wx window is built and ready.
Definition at line 84 of file CBaseGUIWindow.h.
|
protectedinherited |
This semaphore will be signaled when the wx window is destroyed.
Definition at line 85 of file CBaseGUIWindow.h.
| Page generated by Doxygen 1.8.3 for MRPT 0.9.6 SVN: at Fri Feb 15 22:05:02 EST 2013 |