28 #ifndef CDisplayWindow_H
29 #define CDisplayWindow_H
39 using namespace mrpt::utils;
57 bool m_enableCursorCoordinates;
62 CDisplayWindow( const std::
string &windowCaption = std::
string(),
unsigned int initWidth = 400,
unsigned int initHeight = 400 );
66 const std::
string &windowCaption = std::
string(),
67 unsigned int initWidth = 400,
68 unsigned int initHeight = 400 )
78 virtual bool getLastMousePosition(
int &x,
int &y)
const;
81 virtual void setCursorCross(
bool cursorIsCross);
92 template <
class FEATURELIST>
93 void showImageAndPoints(
const CImage &img,
const FEATURELIST &list,
const TColor &color = TColor::red,
const bool &showIDs =
false )
98 imgColor.drawFeatures(list,color,showIDs);
107 template <
class FEATURELIST>
108 void showTiledImageAndPoints(
const CImage &img,
const FEATURELIST &list,
const TColor &color = TColor::red )
116 unsigned int w = imgColor.getWidth();
117 unsigned int h = imgColor.getHeight();
118 imgColor.line( 0, h/2, w-1, h/2, TColor::green );
119 imgColor.line( w/4, 0, w/4, h, TColor::green );
120 imgColor.line( w/2, 0, w/2, h, TColor::green );
121 imgColor.line( 3*w/4, 0, 3*w/4, h, TColor::green );
123 showImageAndPoints( imgColor, list, color );
132 template <
class MATCHEDLIST>
133 void showImagesAndMatchedPoints(
const CImage &img1,
const CImage &img2,
const MATCHEDLIST &mList,
const TColor &color = TColor::red,
bool showNumbers =
false )
147 imgColor.drawCircle(
round( i->first->x ),
round( i->first->y ), 4, color );
148 imgColor.drawCircle(
round( i->second->x + w ),
round( i->second->y ), 4, color );
154 imgColor.textOut(
round( i->first->x ) - 10,
round( i->first->y ), buf, color );
156 imgColor.textOut(
round( i->second->x + w ) + 10,
round( i->second->y ), buf, color );
168 template <
class FEATURELIST>
169 void showImagesAndMatchedPoints(
const CImage &img1,
const CImage &img2,
const FEATURELIST &leftList,
const FEATURELIST &rightList,
const TColor &color = TColor::red )
176 ASSERT_( leftList.size() == rightList.size() );
177 imgColor.joinImagesHorz( img1, img2 );
183 imgColor.drawCircle(
round( (*iL)->x ),
round( (*iL)->y ), 4, color );
184 imgColor.drawCircle(
round( (*iR)->x + w ),
round( (*iR)->y ), 4, color );
185 imgColor.line(
round( (*iL)->x ),
round( (*iL)->y ),
round( (*iR)->x + w ),
round( (*iR)->y ), color );
195 void showImage(
const CImage &img );
207 void resize(
unsigned int width,
unsigned int height );
211 void setPos(
int x,
int y );
215 inline void enableCursorCoordinatesVisualization(
bool enable)
217 m_enableCursorCoordinates = enable;
222 void setWindowTitle(
const std::string &str );