39 #include <visp3/core/vpConfig.h>
40 #ifndef DOXYGEN_SHOULD_SKIP_THIS
42 #include <visp3/gui/vpPlotGraph.h>
43 #include <visp3/core/vpMath.h>
44 #include <visp3/core/vpMeterPixelConversion.h>
45 #include <visp3/core/vpPixelMeterConversion.h>
48 #include <visp3/gui/vpDisplayOpenCV.h>
49 #include <visp3/gui/vpDisplayX.h>
50 #include <visp3/gui/vpDisplayGDI.h>
51 #include <visp3/gui/vpDisplayGTK.h>
52 #include <visp3/gui/vpDisplayD3D.h>
55 #include <visp3/core/vpMath.h>
58 #if defined(VISP_HAVE_DISPLAY)
60 int laFonctionSansNom (
const double delta);
64 vpPlotGraph::vpPlotGraph()
65 : xorg(0.), yorg(0.), zoomx(1.), zoomy(1.), xmax(10), ymax(10), xmin(0), ymin(-10),
66 xdelt(1), ydelt(1), gridx(true), gridy(true), gridColor(), curveNbr(1), curveList(NULL),
67 scaleInitialized(false), firstPoint(true), nbDivisionx(10), nbDivisiony(10), topLeft(),
68 width(0), height(0), graphZone(), dTopLeft(), dWidth(0), dHeight(0), dGraphZone(),
69 dTopLeft3D(), dGraphZone3D(), cam(), cMo(), cMf(), w_xval(0), w_xsize(0), w_yval(0), w_ysize(0),
70 w_zval(0), w_zsize(0), ptXorg(0), ptYorg(0), ptZorg(0), zoomx_3D(1.), zoomy_3D(1.), zoomz_3D(1.),
71 nbDivisionz(10), zorg(1.), zoomz(1.), zmax(10), zmin(-10), zdelt(1), old_iPr(), old_iPz(),
72 blockedr(false), blockedz(false), blocked(false), epsi(5), epsj(6),
73 dispUnit(false), dispTitle(false), dispLegend(false), gridThickness(1)
75 gridColor.setColor(200,200,200);
83 vpPlotGraph::~vpPlotGraph()
85 if (curveList != NULL)
93 vpPlotGraph::initGraph (
unsigned int nbCurve)
95 curveList =
new vpPlotCurve[nbCurve];
100 for (
unsigned int i = 0; i < curveNbr; i++)
102 (curveList+i)->color = colors[i%6];
103 (curveList+i)->curveStyle = line;
104 (curveList+i)->pointListx.clear();
105 (curveList+i)->pointListy.clear();
106 (curveList+i)->legend.clear();
111 vpPlotGraph::initSize (
vpImagePoint top_left,
unsigned int w,
unsigned int h,
unsigned int margei,
unsigned int margej)
113 this->topLeft = top_left;
116 graphZone.setTopLeft(topLeft);
117 graphZone.setWidth(width);
118 graphZone.setHeight(height);
120 this->dTopLeft =
vpImagePoint(topLeft.get_i()+margei,topLeft.get_j()+margej);
121 this->dWidth = width-margej-10;
122 this->dHeight = height-2*margei;
123 dGraphZone.setTopLeft(dTopLeft);
124 dGraphZone.setWidth(dWidth+1);
125 dGraphZone.setHeight(dHeight+1);
127 this->dTopLeft3D =
vpImagePoint(topLeft.get_i()+margei,topLeft.get_j()+10);
128 dGraphZone3D.setTopLeft(dTopLeft3D);
129 dGraphZone3D.setWidth(dWidth+1);
130 dGraphZone3D.setHeight(dHeight+1);
132 if (this->dWidth > this->dHeight)
135 w_xsize = this->dWidth/this->dHeight;
138 w_yval = w_ysize/2.0;
139 w_xval = w_xsize/2.0;
140 w_zval = w_zsize/2.0;
142 else if (this->dWidth == this->dHeight)
152 else if (this->dWidth < this->dHeight)
155 w_ysize = this->dHeight/this->dWidth;
158 w_yval = w_ysize/2.0;
159 w_xval = w_xsize/2.0;
160 w_zval = w_zsize/2.0;
167 cMf.buildFrom(0,0,cMo[2][3],0,0,0);
172 vpPlotGraph::findPose()
183 iP[2].
set_ij(dHeight-1,dWidth-1);
184 iP[3].
set_ij(dHeight-1,0);
192 for (
unsigned int i=0 ; i < 4 ; i++)
206 for(
unsigned int i=0; i< 4; i++) {
216 vpPlotGraph::computeGraphParameters()
218 zoomx = dWidth/(xmax-xmin);
219 zoomy = dHeight/(ymax-ymin);
220 xorg = dTopLeft.
get_j() - (xmin*zoomx);
221 yorg = dTopLeft.get_i() + (ymax*zoomy);
225 vpPlotGraph::setCurveColor(
const unsigned int curveNum,
const vpColor color)
227 (curveList+curveNum)->color = color;
231 vpPlotGraph::setTitle (
const std::string &title_)
238 vpPlotGraph::setUnitX (
const std::string &unit_x)
245 vpPlotGraph::setUnitY (
const std::string &unit_y)
252 vpPlotGraph::setUnitZ (
const std::string &unit_z)
259 vpPlotGraph::setLegend (
const unsigned int curveNum,
const std::string &newlegend)
261 (curveList+curveNum)->legend = newlegend;
266 vpPlotGraph::setCurveThickness(
const unsigned int curveNum,
const unsigned int thickness)
268 (curveList+curveNum)->thickness = thickness;
272 laFonctionSansNom (
const double delta)
304 computeGraphParameters();
306 xdelt = (xmax-xmin)/nbDivisionx;
307 ydelt = (ymax-ymin)/nbDivisiony;
313 power = laFonctionSansNom(xdelt);
314 for(t=xmin;t<=xmax;t=t+xdelt)
316 double x = xorg+(zoomx*t);
322 if (t+xdelt <= xmax+1e-10)
326 ttemp = t*pow(10.0,power);
328 sprintf(valeur,
"%.2f", ttemp);
329 #if defined VISP_HAVE_X11
331 #elif defined (VISP_HAVE_GDI) || defined (VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
338 sprintf(valeur,
"x10e%d", -power);
339 #if defined VISP_HAVE_X11
341 #elif defined (VISP_HAVE_GDI) || defined (VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
346 power = laFonctionSansNom(ydelt);
347 for(t=ymin;t<=ymax;t=t+ydelt)
349 double y = yorg-(zoomy*t);
357 ttemp = t*pow(10.0,power);
360 sprintf(valeur,
"%.2f", ttemp);
361 #if defined VISP_HAVE_X11
363 #elif defined (VISP_HAVE_GDI) || defined (VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
369 sprintf(valeur,
"x10e%d", -power);
370 #if defined VISP_HAVE_X11
372 #elif defined (VISP_HAVE_GDI) || defined (VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
394 #
if defined(VISP_HAVE_X11) || defined (VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
399 unsigned int offsetx = vpMath::minimum<unsigned int>((
unsigned int)unitx.size(), dWidth);
401 #if defined VISP_HAVE_X11
404 #elif defined (VISP_HAVE_GDI) || defined (VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
413 double size = (double)title.size();
417 dTopLeft.get_j()+dWidth/2.0-4*size),
426 for (
unsigned int i = 0; i < curveNbr; i++) {
427 size_t offset = epsj * (curveList+i)->legend.size();
430 if (offsetj > dWidth) offsetj = dWidth;
432 for (
unsigned int i = 0; i < curveNbr; i++) {
435 dTopLeft.get_j()+dWidth-offsetj),
436 (curveList+i)->legend.c_str(),
437 (curveList+i)->color);
442 vpPlotGraph::rescalex(
unsigned int side,
double extremity)
447 xmin = (3*extremity-xmax)/2;
450 xmax = (3*extremity-xmin)/2;
454 xdelt = (xmax-xmin)/(
double)nbDivisionx;
458 vpPlotGraph::rescaley(
unsigned int side,
double extremity)
463 ymin = (3*extremity-ymax)/2;
466 ymax = (3*extremity-ymin)/2;
470 ydelt = (ymax-ymin)/(
double)nbDivisiony;
474 vpPlotGraph::initScale(
vpImage<unsigned char> &I,
const double x_min,
const double x_max,
const int nbDivx,
475 const double y_min,
const double y_max,
const int nbDivy,
const bool gx,
const bool gy)
483 this->nbDivisionx = nbDivx;
484 this->nbDivisiony = nbDivy;
485 computeGraphParameters();
489 scaleInitialized =
true;
494 vpPlotGraph::initScale(
vpImage<unsigned char> &I,
const double x_min,
const double x_max,
const int nbDivx,
495 const double y_min,
const double y_max,
const int nbDivy,
496 const double z_min,
const double z_max,
const int nbDivz,
const bool gx,
const bool gy)
506 this->nbDivisionx = nbDivx;
507 this->nbDivisiony = nbDivy;
508 this->nbDivisionz = nbDivz;
509 computeGraphParameters();
513 scaleInitialized =
true;
519 if (!scaleInitialized)
541 scaleInitialized =
true;
542 computeGraphParameters();
546 if (std::fabs(y) <= std::numeric_limits<double>::epsilon())
547 scaleInitialized =
false;
559 double i = yorg-(zoomy*y);
560 double j = xorg+(zoomx*x);
566 if (x > xmax) rescalex(1,x);
567 else if(x < xmin) rescalex(0,x);
569 if (y > ymax) rescaley(1,y);
570 else if(y < ymin) rescaley(0,y);
572 computeGraphParameters();
581 (curveList+curveNb)->plotPoint(I, iP, x, y);
582 #if (!defined VISP_HAVE_X11 && defined FLUSH_ON_PLOT)
593 for (
unsigned int i = 0; i < curveNbr; i++)
594 (curveList+i)->plotList(I,xorg,yorg,zoomx,zoomy);
609 double x = (iP.
get_j()-xorg)/zoomx;
610 double y = (yorg-iP.
get_i())/zoomy;
614 sprintf(valeur,
" x: %f", x);
616 sprintf(valeur,
" y: %f", y);
626 vpPlotGraph::resetPointList(
const unsigned int curveNum)
628 (curveList+curveNum)->pointListx.clear();
629 (curveList+curveNum)->pointListy.clear();
630 (curveList+curveNum)->pointListz.clear();
631 (curveList+curveNum)->nbPoint = 0;
644 if (!iP1In || !iP2In)
646 double dTopLeft_i = dTopLeft3D.get_i();
647 double dTopLeft_j = dTopLeft3D.get_j();
648 double dBottomRight_i = dTopLeft_i+dHeight;
649 double dBottomRight_j = dTopLeft_j+dWidth;
656 if (!iP1In && !iP2In)
658 if (iP1.
get_i() < dTopLeft_i && iP2.
get_i() < dTopLeft_i)
660 if (iP1.
get_i() > dBottomRight_i && iP2.
get_i() > dBottomRight_i)
662 if (iP1.
get_j() < dTopLeft_j || iP1.
get_j() > dBottomRight_j)
664 if (iP1.
get_i() < dTopLeft_i) iP1.
set_i(dTopLeft_i);
665 else iP1.
set_i(dBottomRight_i);
666 if (iP2.
get_i() < dTopLeft_i) iP2.
set_i(dTopLeft_i);
667 else iP2.
set_i(dBottomRight_i);
671 if (iP1.
get_j() < dTopLeft_j) iP1.
set_j(dTopLeft_j);
672 if (iP1.
get_j() > dBottomRight_j) iP1.
set_j(dBottomRight_j);
673 if (iP1.
get_i() < dTopLeft_i) iP1.
set_i(dTopLeft_i);
674 if (iP1.
get_i() > dBottomRight_i) iP1.
set_i(dBottomRight_i);
679 if (iP2.
get_j() < dTopLeft_j) iP2.
set_j(dTopLeft_j);
680 if (iP2.
get_j() > dBottomRight_j) iP2.
set_j(dBottomRight_j);
681 if (iP2.
get_i() < dTopLeft_i) iP2.
set_i(dTopLeft_i);
682 if (iP2.
get_i() > dBottomRight_i) iP2.
set_i(dBottomRight_i);
689 if (!iP1In && !iP2In)
691 if (iP1.
get_j() < dTopLeft_j && iP2.
get_j() < dTopLeft_j)
693 if (iP1.
get_j() > dBottomRight_j && iP2.
get_j() > dBottomRight_j)
695 if (iP1.
get_i() < dTopLeft_i || iP1.
get_i() > dBottomRight_i)
697 if (iP1.
get_j() < dTopLeft_j) iP1.
set_j(dTopLeft_j);
698 else iP1.
set_j(dBottomRight_j);
699 if (iP2.
get_j() < dTopLeft_j) iP2.
set_j(dTopLeft_j);
700 else iP2.
set_j(dBottomRight_j);
704 if (iP1.
get_j() < dTopLeft_j) iP1.
set_j(dTopLeft_j);
705 if (iP1.
get_j() > dBottomRight_j) iP1.
set_j(dBottomRight_j);
706 if (iP1.
get_i() < dTopLeft_i) iP1.
set_i(dTopLeft_i);
707 if (iP1.
get_i() > dBottomRight_i) iP1.
set_i(dBottomRight_i);
712 if (iP2.
get_j() < dTopLeft_j) iP2.
set_j(dTopLeft_j);
713 if (iP2.
get_j() > dBottomRight_j) iP2.
set_j(dBottomRight_j);
714 if (iP2.
get_i() < dTopLeft_i) iP2.
set_i(dTopLeft_i);
715 if (iP2.
get_i() > dBottomRight_i) iP2.
set_i(dBottomRight_i);
724 double jtop = (dTopLeft_i-b)/a;
725 double jlow = (dBottomRight_i-b)/a;
727 double ileft = dTopLeft_j*a+b;
728 double iright = (dBottomRight_j)*a+b;
733 if(jtop >= dTopLeft_j && jtop <= dBottomRight_j)
735 iP[n].
set_ij(dTopLeft_i,jtop);
738 if(jlow >= dTopLeft_j && jlow <= dBottomRight_j)
740 iP[n].
set_ij(dBottomRight_i,jlow);
743 if(ileft >= dTopLeft_i && ileft <= dBottomRight_i && n <2)
745 iP[n].
set_ij(ileft,dTopLeft_j);
748 if(iright >= dTopLeft_i && iright <= dBottomRight_i && n <2)
750 iP[n].
set_ij(iright,dBottomRight_j);
757 if (!iP1In && !iP2In)
766 iP1 = iP[0]; iP2 = iP[1];
770 iP1 = iP[1]; iP2 = iP[0];
780 iP1 = iP[0];iP2 = iP[1];
784 iP1 = iP[1];iP2 = iP[0];
794 if (fabs(iP[0].get_j()-iP2.
get_j()) > 5)
808 if (fabs(iP[0].get_i()-iP2.
get_i()) > 5)
831 if (fabs(iP[0].get_j()-iP1.
get_j()) > 5)
845 if (fabs(iP[0].get_i()-iP1.
get_i()) > 5)
871 if (iP.
get_i() < dTopLeft3D.get_i())
872 iP.
set_i(dTopLeft3D.get_i());
873 else if (iP.
get_i() > dTopLeft3D.get_i()+dHeight)
874 iP.
set_i(dTopLeft3D.get_i()+dHeight-1);
875 if (iP.
get_j() <dTopLeft3D.get_j())
876 iP.
set_j(dTopLeft3D.get_j());
877 else if (iP.
get_j() > dTopLeft3D.get_j()+dWidth)
878 iP.
set_j(dTopLeft3D.get_j()+dWidth-1);
885 vpPlotGraph::computeGraphParameters3D()
887 zoomx_3D = w_xsize/(xmax-xmin);
888 zoomy_3D = w_ysize/(ymax-ymin);
889 zoomz_3D = w_zsize/(zmax-zmin);
890 ptXorg = w_xval - zoomx_3D*xmax;
891 ptYorg = w_yval + zoomy_3D*ymin;
892 ptZorg = w_zval - zoomz_3D*zmax;
914 computeGraphParameters3D();
916 xdelt = (xmax-xmin)/nbDivisionx;
917 ydelt = (ymax-ymin)/nbDivisiony;
918 zdelt = (zmax-zmin)/nbDivisionz;
929 for (
unsigned int i = 0; i < 6; i++)
935 iP[i] = iP[i] + dTopLeft3D;
949 power = laFonctionSansNom(xdelt);
952 if (std::fabs(iP[0].get_j()-iP[1].get_j()) >
953 vpMath::maximum(std::fabs(iP[0].get_j()), std::fabs(iP[1].get_j()))* std::numeric_limits<double>::epsilon())
954 pente = fabs((iP[0].get_i()-iP[1].get_i())/(iP[0].get_j()-iP[1].get_j()));
957 unsigned int count = 1;
958 for(t=xmin;t<=xmax;t=t+xdelt)
960 double x = ptXorg+(zoomx_3D*t);
966 iPunit = iPunit + dTopLeft3D;
968 getGrid3DPoint(pente,iPunit,ip1,ip2,ip3);
970 if(check3Dline(ip1,ip2))
977 ttemp = t*pow(10.0,power);
979 sprintf(valeur,
"%.1f", ttemp);
988 sprintf(valeur,
"x10e%d", -power);
989 if(check3Dpoint(ip4))
993 power = laFonctionSansNom(ydelt);
996 if (std::fabs(iP[2].get_j()-iP[3].get_j()) >
997 vpMath::maximum(std::fabs(iP[2].get_j()), std::fabs(iP[3].get_j()))* std::numeric_limits<double>::epsilon())
998 pente = fabs((iP[2].get_i()-iP[3].get_i())/(iP[2].get_j()-iP[3].get_j()));
1001 for(t=ymin;t<=ymax;t=t+ydelt)
1003 double y = ptYorg-(zoomy_3D*t);
1006 double u=0.0, v=0.0;
1009 iPunit = iPunit + dTopLeft3D;
1011 getGrid3DPoint(pente,iPunit,ip1,ip2,ip3);
1013 if(check3Dline(ip1,ip2))
1020 ttemp = t*pow(10.0,power);
1022 sprintf(valeur,
"%.1f", ttemp);
1031 sprintf(valeur,
"x10e%d", -power);
1032 if(check3Dpoint(ip4))
1036 power = laFonctionSansNom(zdelt);
1039 if (std::fabs(iP[4].get_j()-iP[5].get_j()) >
1040 vpMath::maximum(std::fabs(iP[4].get_j()), std::fabs(iP[5].get_j()))* std::numeric_limits<double>::epsilon())
1041 pente = fabs((iP[4].get_i()-iP[5].get_i())/(iP[4].get_j()-iP[5].get_j()));
1044 for(t=zmin;t<=zmax;t=t+zdelt)
1046 double z = ptZorg+(zoomz_3D*t);
1049 double u=0.0, v=0.0;
1052 iPunit = iPunit + dTopLeft3D;
1054 getGrid3DPoint(pente,iPunit,ip1,ip2,ip3);
1056 if(check3Dline(ip1,ip2))
1063 ttemp = t*pow(10.0,power);
1065 sprintf(valeur,
"%.1f", ttemp);
1074 sprintf(valeur,
"x10e%d", -power);
1075 if(check3Dpoint(ip4))
1081 if (check3Dline(iP[0],iP[1]))
1086 iPunit.
set_ij(iP[1].get_i(),iP[1].get_j()-10*epsj);
1087 check3Dpoint (iPunit);
1091 if (check3Dline(iP[3],iP[2]))
1096 iPunit.
set_ij(iP[2].get_i(),iP[2].get_j()-10*epsj);
1097 check3Dpoint (iPunit);
1101 if (check3Dline(iP[4],iP[5]))
1106 iPunit.
set_ij(iP[5].get_i(),iP[5].get_j()-10*epsj);
1107 check3Dpoint (iPunit);
1119 vpPlotGraph::plot (
vpImage<unsigned char> &I,
const unsigned int curveNb,
const double x,
const double y,
const double z)
1121 if (!scaleInitialized)
1153 scaleInitialized =
true;
1154 computeGraphParameters3D();
1158 if (std::fabs(y) <= std::numeric_limits<double>::epsilon() || std::fabs(z) <= std::numeric_limits<double>::epsilon())
1159 scaleInitialized =
false;
1170 bool changed =
false;
1171 if (x > xmax) {rescalex(1,x); changed =
true;}
1172 else if(x < xmin) {rescalex(0,x);changed =
true;}
1174 if (y > ymax) {rescaley(1,y);changed =
true;}
1175 else if(y < ymin) {rescaley(0,y);changed =
true;}
1177 if (z > zmax) {rescalez(1,z);changed =
true;}
1178 else if(z < zmin) {rescalez(0,z);changed =
true;}
1182 if (changed || move(I, button))
1184 computeGraphParameters3D();
1189 pointPlot.
setWorldCoordinates(ptXorg+(zoomx_3D*x),ptYorg-(zoomy_3D*y),ptZorg+(zoomz_3D*z));
1190 pointPlot.
track(cMo);
1191 double u=0.0, v=0.0;
1195 iP = iP + dTopLeft3D;
1197 (curveList+curveNb)->pointListz.end();
1198 if((curveList+curveNb)->nbPoint)
1200 if (check3Dline((curveList+curveNb)->lastPoint,iP))
1201 vpDisplay::displayLine(I,(curveList+curveNb)->lastPoint, iP, (curveList+curveNb)->color, (curveList+curveNb)->thickness);
1203 #if( defined VISP_HAVE_X11 || defined VISP_HAVE_GDI )
1209 if (iP.get_i() <= (curveList+curveNb)->lastPoint.get_i()) {top = iP.get_i()-5; height_ = (curveList+curveNb)->lastPoint.get_i() - top+10;}
1210 else {top = (curveList+curveNb)->lastPoint.get_i()-5; height_ = iP.get_i() - top+10;}
1211 if (iP.get_j() <= (curveList+curveNb)->lastPoint.get_j()) {left = iP.get_j()-5; width_ = (curveList+curveNb)->lastPoint.get_j() - left+10;}
1212 else {left = (curveList+curveNb)->lastPoint.get_j()-5; width_ = iP.get_j() - left+10;}
1216 (curveList+curveNb)->lastPoint = iP;
1217 (curveList+curveNb)->pointListx.push_back(x);
1218 (curveList+curveNb)->pointListy.push_back(y);
1219 (curveList+curveNb)->pointListz.push_back(z);
1220 (curveList+curveNb)->nbPoint++;
1222 #if( !defined VISP_HAVE_X11 && defined FLUSH_ON_PLOT)
1234 for (
unsigned int i = 0; i < curveNbr; i++)
1236 std::list<double>::const_iterator it_ptListx = (curveList+i)->pointListx.begin();
1237 std::list<double>::const_iterator it_ptListy = (curveList+i)->pointListy.begin();
1238 std::list<double>::const_iterator it_ptListz = (curveList+i)->pointListz.begin();
1243 while (k < (curveList+i)->nbPoint)
1245 double x = *it_ptListx;
1246 double y = *it_ptListy;
1247 double z = *it_ptListz;
1248 pointPlot.
setWorldCoordinates(ptXorg+(zoomx_3D*x),ptYorg-(zoomy_3D*y),ptZorg+(zoomz_3D*z));
1249 pointPlot.
track(cMo);
1250 double u=0.0, v=0.0;
1253 iP = iP + dTopLeft3D;
1258 if (check3Dline((curveList+i)->lastPoint,iP))
1263 (curveList+i)->lastPoint = iP;
1277 vpPlotGraph::rescalez(
unsigned int side,
double extremity)
1282 zmin = (3*extremity-zmax)/2;
1285 zmax = (3*extremity-zmin)/2;
1289 zdelt = (zmax-zmin)/(
double)nbDivisionz;
1299 bool changed =
false;
1303 if (std::fabs(displacement[2][3]) > std::numeric_limits<double>::epsilon())
1304 cMf = cMf*displacement;
1307 cMo = cMf* displacement * fMo;
1316 bool clicked =
false;
1317 bool clickedUp =
false;
1353 if (!(blockedr || blockedz))
1367 double diffi = iP.
get_i() - old_iPr.get_i();
1368 double diffj = iP.
get_j() - old_iPr.get_j();
1370 double anglei = diffi*360/width_;
1371 double anglej = diffj*360/width_;
1376 if (blockedr) old_iPr = iP;
1380 double diffi = iP.
get_i() - old_iPz.get_i();
1381 mov.buildFrom(0,0,diffi*0.01,0,0,0);
1385 if (blockedz) old_iPz = iP;
1390 #elif !defined(VISP_BUILD_SHARED_LIBS)
1392 void dummy_vpPlotGraph() {};
void set_oZ(const double oZ)
Set the point Z coordinate in the object frame.
bool inRectangle(const vpRect &rect) const
static bool getPointerPosition(const vpImage< unsigned char > &I, vpImagePoint &ip)
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
unsigned int getWidth() const
Implementation of an homogeneous matrix and operations on such kind of matrices.
static const vpColor black
static void convertPoint(const vpCameraParameters &cam, const double &x, const double &y, double &u, double &v)
Point coordinates conversion from normalized coordinates in meter to pixel coordinates ...
Class to define colors available for display functionnalities.
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
static bool getClickUp(const vpImage< unsigned char > &I, vpImagePoint &ip, vpMouseButton::vpMouseButtonType &button, bool blocking=true)
void set_x(const double x)
Set the point x coordinate in the image plane.
void track(const vpHomogeneousMatrix &cMo)
static void convertPoint(const vpCameraParameters &cam, const double &u, const double &v, double &x, double &y)
Point coordinates conversion from pixel coordinates to normalized coordinates in meter...
double get_y() const
Get the point y coordinate in the image plane.
static const vpColor green
Class that defines what is a point.
static Type maximum(const Type &a, const Type &b)
static const vpColor orange
void initPersProjWithoutDistortion(const double px, const double py, const double u0, const double v0)
void set_i(const double ii)
static const vpColor cyan
static void displayArrow(const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color=vpColor::white, unsigned int w=4, unsigned int h=2, unsigned int thickness=1)
VISP_EXPORT void sleepMs(double t)
Class used for pose computation from N points (pose from point only). Some of the algorithms implemen...
void set_y(const double y)
Set the point y coordinate in the image plane.
void set_oX(const double oX)
Set the point X coordinate in the object frame.
bool computePose(vpPoseMethodType method, vpHomogeneousMatrix &cMo, bool(*func)(vpHomogeneousMatrix *)=NULL)
double get_x() const
Get the point x coordinate in the image plane.
static Type minimum(const Type &a, const Type &b)
static double rad(double deg)
void set_j(const double jj)
void setWorldCoordinates(const double oX, const double oY, const double oZ)
void set_oY(const double oY)
Set the point Y coordinate in the object frame.
vpHomogeneousMatrix inverse() const
unsigned int getHeight() const
void set_uv(const double u, const double v)
Defines a rectangle in the plane.
static void flushROI(const vpImage< unsigned char > &I, const vpRect &roi)
static void displayROI(const vpImage< unsigned char > &I, const vpRect &roi)
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
static void displayLine(const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1)
static int() sign(double x)
void addPoint(const vpPoint &P)
static const vpColor purple
static void displayDotLine(const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1)
static double distance(const vpImagePoint &iP1, const vpImagePoint &iP2)
void set_ij(const double ii, const double jj)
static const vpColor blue