Go to the documentation of this file.
9 #ifndef CDisplayWindow_H
10 #define CDisplayWindow_H
43 CDisplayWindow(
const std::string &windowCaption = std::string(),
unsigned int initWidth = 400,
unsigned int initHeight = 400 );
47 const std::string &windowCaption,
48 unsigned int initWidth = 400,
49 unsigned int initHeight = 400 );
72 template <
class FEATURELIST>
78 imgColor.drawFeatures(list,color,showIDs);
87 template <
class FEATURELIST>
96 unsigned int w = imgColor.
getWidth();
98 imgColor.
line( 0, h/2, w-1, h/2, TColor::green );
99 imgColor.
line( w/4, 0, w/4, h, TColor::green );
100 imgColor.
line( w/2, 0, w/2, h, TColor::green );
101 imgColor.
line( 3*w/4, 0, 3*w/4, h, TColor::green );
103 showImageAndPoints( imgColor, list, color );
112 template <
class MATCHEDLIST>
127 imgColor.drawCircle(
round( i->first->x ),
round( i->first->y ), 4, color );
128 imgColor.drawCircle(
round( i->second->x + w ),
round( i->second->y ), 4, color );
134 imgColor.textOut(
round( i->first->x ) - 10,
round( i->first->y ), buf, color );
136 imgColor.textOut(
round( i->second->x + w ) + 10,
round( i->second->y ), buf, color );
148 template <
class FEATURELIST>
156 ASSERT_( leftList.size() == rightList.size() );
157 imgColor.joinImagesHorz( img1, img2 );
163 imgColor.drawCircle(
round( (*iL)->x ),
round( (*iL)->y ), 4, color );
164 imgColor.drawCircle(
round( (*iR)->x + w ),
round( (*iR)->y ), 4, color );
165 imgColor.line(
round( (*iL)->x ),
round( (*iL)->y ),
round( (*iR)->x + w ),
round( (*iR)->y ), color );
197 m_enableCursorCoordinates = enable;
void plot(const mrpt::math::CVectorFloat &x, const mrpt::math::CVectorFloat &y)
Plots a graph in MATLAB-like style.
void plot(const mrpt::math::CVectorFloat &y)
Plots a graph in MATLAB-like style.
int round(const T value)
Returns the closer integer (int) to x.
void showImageAndPoints(const mrpt::utils::CImage &img, const mrpt::math::CVectorFloat &x, const mrpt::math::CVectorFloat &y, const mrpt::utils::TColor &color=mrpt::utils::TColor::red, const bool &showNumbers=false)
Show a given color or grayscale image on the window and print a set of points on it.
void showImageAndPoints(const mrpt::utils::CImage &img, const FEATURELIST &list, const mrpt::utils::TColor &color=mrpt::utils::TColor::red, const bool &showIDs=false)
Show a given color or grayscale image on the window and print a set of points on it.
void showImageAndPoints(const mrpt::utils::CImage &img, const std::vector< float > &x, const std::vector< float > &y, const mrpt::utils::TColor &color=mrpt::utils::TColor::red, const bool &showNumbers=false)
This is an overloaded member function, provided for convenience. It differs from the above function o...
const Scalar * const_iterator
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction.
virtual bool getLastMousePosition(int &x, int &y) const MRPT_OVERRIDE
Gets the last x,y pixel coordinates of the mouse.
static TColor red
Predefined colors.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
virtual ~CDisplayWindow()
Destructor.
A class for storing images as grayscale or RGB bitmaps.
void joinImagesHorz(const CImage &im1, const CImage &im2)
Joins two images side-by-side horizontally.
void colorImage(CImage &ret) const
Returns a RGB version of the grayscale image, or itself if it is already a RGB image.
void showImagesAndMatchedPoints(const mrpt::utils::CImage &img1, const mrpt::utils::CImage &img2, const FEATURELIST &leftList, const FEATURELIST &rightList, const mrpt::utils::TColor &color=mrpt::utils::TColor::red)
Show a pair of given color or grayscale images (put together) on the window and print a set of matche...
The base class for GUI window classes.
virtual void setCursorCross(bool cursorIsCross) MRPT_OVERRIDE
Set cursor style to default (cursorIsCross=false) or to a cross (cursorIsCross=true)
void showImagesAndMatchedPoints(const mrpt::utils::CImage &img1, const mrpt::utils::CImage &img2, const MATCHEDLIST &mList, const mrpt::utils::TColor &color=mrpt::utils::TColor::red, bool showNumbers=false)
Show a pair of given color or grayscale images (put together) on the window and print a set of matche...
size_t getWidth() const MRPT_OVERRIDE
Returns the width of the image in pixels.
bool m_enableCursorCoordinates
Enables or disables the visualization of cursor coordinates on the window caption.
void setPos(int x, int y) MRPT_OVERRIDE
Changes the position of the window on the screen.
void showTiledImageAndPoints(const mrpt::utils::CImage &img, const FEATURELIST &list, const mrpt::utils::TColor &color=mrpt::utils::TColor::red)
Show a given color or grayscale image on the window and print a set of points on it and a set of line...
size_t getHeight() const MRPT_OVERRIDE
Returns the height of the image in pixels.
void resize(unsigned int width, unsigned int height) MRPT_OVERRIDE
Resizes the window, stretching the image to fit into the display area.
This class creates a window as a graphical user interface (GUI) for displaying images to the user.
void setWindowTitle(const std::string &str) MRPT_OVERRIDE
Changes the window title text.
#define DEFINE_MRPT_OBJECT_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
int BASE_IMPEXP sprintf(char *buf, size_t bufSize, const char *format,...) MRPT_NO_THROWS MRPT_printf_format_check(3
An OS-independent version of sprintf (Notice the bufSize param, which may be ignored in some compiler...
void showImage(const mrpt::utils::CImage &img)
Show a given color or grayscale image on the window.
void line(int x0, int y0, int x1, int y1, const mrpt::utils::TColor color, unsigned int width=1, TPenStyle penStyle=psSolid) MRPT_OVERRIDE
Draws a line.
static CDisplayWindowPtr Create(const std::string &windowCaption, unsigned int initWidth=400, unsigned int initHeight=400)
Class factory returning a smart pointer.
void enableCursorCoordinatesVisualization(bool enable)
Enables or disables the visualization of cursor coordinates on the window caption (default = enabled)...
CDisplayWindow(const std::string &windowCaption=std::string(), unsigned int initWidth=400, unsigned int initHeight=400)
Constructor.
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
#define DEFINE_MRPT_OBJECT_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
#define DEFINE_MRPT_OBJECT(class_name)
This declaration must be inserted in all CObject classes definition, within the class declaration.
Page generated by Doxygen 1.8.20 for MRPT 1.4.0 SVN: at Thu Aug 27 02:40:23 UTC 2020 | | |