104 virtual void setPixel(
int x,
int y,
size_t color) =0;
108 virtual size_t getWidth()
const = 0;
112 virtual size_t getHeight()
const = 0;
129 unsigned int width = 1,
130 TPenStyle penStyle = psSolid);
147 unsigned int width = 1 );
164 bool inferior =
true,
165 unsigned int width = 1 );
177 virtual void filledRectangle(
193 virtual void textOut(
196 const std::string &str,
217 virtual void selectTextFont(
const std::string &fontName );
225 virtual void drawImage(
238 void cross (
int x0,
int y0,
const mrpt::utils::TColor color,
char type,
unsigned int size=5,
unsigned int width = 1);
248 virtual void drawImage(
262 virtual void drawCircle(
267 unsigned int width = 1 );
279 template <
class MATRIX2X2>
280 void ellipseGaussian(
281 const MATRIX2X2 *cov2D,
284 double confIntervalStds = 2,
286 unsigned int width = 1,
287 int nEllipsePoints = 20
291 int x1=0,y1=0,x2=0,y2=0;
293 MATRIX2X2 eigVal,eigVec;
297 cov2D->eigenVectors(eigVec,eigVal);
301 M.multiply_ABt(eigVal, eigVec);
304 for (i=0,ang=0;i<nEllipsePoints;i++,ang+= (
M_2PI/(nEllipsePoints-1)))
306 double ccos = cos(ang);
307 double ssin = sin(ang);
309 x2 =
round( mean_x + confIntervalStds * (ccos * M(0,0) + ssin * M(1,0)) );
310 y2 =
round( mean_y + confIntervalStds * (ccos * M(0,1) + ssin * M(1,1)) );
313 line( x1, y1,x2, y2,color,width );
320 std::cout <<
"Covariance matrix leading to error is:" << std::endl << *cov2D << std::endl; \
328 template <
class FEATURELIST>
329 void drawFeaturesSimple(
const FEATURELIST &list,
const TColor &color =
TColor::red,
const int cross_size = 5 )
331 for(
size_t i=0;i<list.size(); ++i )
333 const int x =
round( list.getFeatureX(i) );
334 const int y =
round( list.getFeatureY(i) );
335 this->cross( x,y, color,
'+', cross_size );
346 template <
class FEATURELIST>
347 void drawFeatures(
const FEATURELIST &list,
const TColor &color =
TColor::red,
const bool showIDs =
false,
const bool showResponse =
false )
349 for(
size_t i=0;i<list.size(); ++i )
351 const int x =
round( list.getFeatureX(i) );
352 const int y =
round( list.getFeatureY(i) );
353 this->cross(x,y, color,
'+' );
354 if( showIDs ) this->textOut(x,y,
format(
"%u", static_cast<unsigned int>(list.getFeatureID(i))),
TColor::red );
355 if (showResponse) this->textOut( x,y+10,
format(
"R:%u", static_cast<unsigned int>(list.getFeatureResponse(i))),
TColor::red );
356 if( ! list.isPointFeature(i) ) this->drawCircle(x,y, list.getScale(i),
TColor::red );