37 #include <visp3/core/vpConfig.h>
38 #ifndef DOXYGEN_SHOULD_SKIP_THIS
40 #include <visp3/core/vpMath.h>
41 #include <visp3/core/vpMeterPixelConversion.h>
42 #include <visp3/core/vpPixelMeterConversion.h>
43 #include <visp3/gui/vpPlotGraph.h>
46 #include <visp3/gui/vpDisplayD3D.h>
47 #include <visp3/gui/vpDisplayGDI.h>
48 #include <visp3/gui/vpDisplayGTK.h>
49 #include <visp3/gui/vpDisplayOpenCV.h>
50 #include <visp3/gui/vpDisplayX.h>
56 #if defined(VISP_HAVE_DISPLAY)
58 int laFonctionSansNom(
double delta);
61 vpPlotGraph::vpPlotGraph()
62 : xorg(0.), yorg(0.), zoomx(1.), zoomy(1.), xmax(10), ymax(10), xmin(0), ymin(-10), xdelt(1), ydelt(1), gridx(true),
63 gridy(true), gridColor(), curveNbr(1), curveList(NULL), scaleInitialized(false), firstPoint(true), nbDivisionx(10),
64 nbDivisiony(10), topLeft(), width(0), height(0), graphZone(), dTopLeft(), dWidth(0), dHeight(0), dGraphZone(),
65 dTopLeft3D(), dGraphZone3D(), cam(), cMo(), cMf(), w_xval(0), w_xsize(0), w_yval(0), w_ysize(0), w_zval(0),
66 w_zsize(0), ptXorg(0), ptYorg(0), ptZorg(0), zoomx_3D(1.), zoomy_3D(1.), zoomz_3D(1.), nbDivisionz(10), zorg(1.),
67 zoomz(1.), zmax(10), zmin(-10), zdelt(1), old_iPr(), old_iPz(), blockedr(false), blockedz(false), blocked(false),
68 epsi(5), epsj(6), dispUnit(false), dispTitle(false), dispLegend(false), gridThickness(1)
70 gridColor.setColor(200, 200, 200);
78 vpPlotGraph::~vpPlotGraph()
80 if (curveList != NULL) {
86 void vpPlotGraph::initGraph(
unsigned int nbCurve)
88 curveList =
new vpPlotCurve[nbCurve];
93 for (
unsigned int i = 0; i < curveNbr; i++) {
94 (curveList + i)->color = colors[i % 6];
95 (curveList + i)->curveStyle = vpPlotCurve::line;
96 (curveList + i)->pointListx.clear();
97 (curveList + i)->pointListy.clear();
98 (curveList + i)->legend.clear();
102 void vpPlotGraph::initSize(
vpImagePoint top_left,
unsigned int w,
unsigned int h,
unsigned int margei,
105 this->topLeft = top_left;
108 graphZone.setTopLeft(topLeft);
109 graphZone.setWidth(width);
110 graphZone.setHeight(height);
112 this->dTopLeft =
vpImagePoint(topLeft.get_i() + margei, topLeft.get_j() + margej);
113 this->dWidth = width - margej - 10;
114 this->dHeight = height - 2 * margei;
115 dGraphZone.setTopLeft(dTopLeft);
116 dGraphZone.setWidth(dWidth + 1);
117 dGraphZone.setHeight(dHeight + 1);
119 this->dTopLeft3D =
vpImagePoint(topLeft.get_i() + margei, topLeft.get_j() + 10);
120 dGraphZone3D.setTopLeft(dTopLeft3D);
121 dGraphZone3D.setWidth(dWidth + 1);
122 dGraphZone3D.setHeight(dHeight + 1);
124 if (this->dWidth > this->dHeight) {
126 w_xsize = this->dWidth / this->dHeight;
129 w_yval = w_ysize / 2.0;
130 w_xval = w_xsize / 2.0;
131 w_zval = w_zsize / 2.0;
132 }
else if (this->dWidth == this->dHeight) {
140 }
else if (this->dWidth < this->dHeight) {
142 w_ysize = this->dHeight / this->dWidth;
145 w_yval = w_ysize / 2.0;
146 w_xval = w_xsize / 2.0;
147 w_zval = w_zsize / 2.0;
150 cam.initPersProjWithoutDistortion(1000, 1000, this->dWidth / 2.0, this->dHeight / 2.0);
154 cMf.buildFrom(0, 0, cMo[2][3], 0, 0, 0);
157 void vpPlotGraph::findPose()
167 iP[1].
set_ij(0, dWidth - 1);
168 iP[2].
set_ij(dHeight - 1, dWidth - 1);
169 iP[3].
set_ij(dHeight - 1, 0);
177 for (
unsigned int i=0 ; i < 4 ; i++)
191 for (
unsigned int i = 0; i < 4; i++) {
200 void vpPlotGraph::computeGraphParameters()
202 zoomx = dWidth / (xmax - xmin);
203 zoomy = dHeight / (ymax - ymin);
204 xorg = dTopLeft.get_j() - (xmin * zoomx);
205 yorg = dTopLeft.get_i() + (ymax * zoomy);
208 void vpPlotGraph::setCurveColor(
unsigned int curveNum,
const vpColor &color) { (curveList + curveNum)->color = color; }
210 void vpPlotGraph::setTitle(
const std::string &title_)
216 void vpPlotGraph::setUnitX(
const std::string &unit_x)
222 void vpPlotGraph::setUnitY(
const std::string &unit_y)
228 void vpPlotGraph::setUnitZ(
const std::string &unit_z)
234 void vpPlotGraph::setLegend(
unsigned int curveNum,
const std::string &newlegend)
236 (curveList + curveNum)->legend = newlegend;
240 void vpPlotGraph::setCurveThickness(
unsigned int curveNum,
unsigned int thickness)
242 (curveList + curveNum)->thickness = thickness;
245 int laFonctionSansNom(
double delta)
272 computeGraphParameters();
274 xdelt = (xmax - xmin) / nbDivisionx;
275 ydelt = (ymax - ymin) / nbDivisiony;
280 power = laFonctionSansNom(xdelt);
281 for (t = xmin; t <= xmax; t = t + xdelt) {
282 double x = xorg + (zoomx * t);
285 gridColor, gridThickness);
289 if (t + xdelt <= xmax + 1e-10) {
292 ttemp = t * pow(10.0, power);
295 std::stringstream valeur;
298 #if defined VISP_HAVE_X11
300 #elif defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
306 std::stringstream ss;
309 #if defined VISP_HAVE_X11
312 #elif defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
318 power = laFonctionSansNom(ydelt);
319 for (t = ymin; t <= ymax; t = t + ydelt) {
320 double y = yorg - (zoomy * t);
323 gridColor, gridThickness);
329 ttemp = t * pow(10.0, power);
333 std::stringstream valeur;
336 #if defined VISP_HAVE_X11
338 #elif defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
343 std::stringstream ss;
346 #if defined VISP_HAVE_X11
349 #elif defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
357 vpColor::black, 4 * gridThickness, 2 * gridThickness, gridThickness);
360 vpColor::black, 4 * gridThickness, 2 * gridThickness, gridThickness);
373 #
if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || \
374 defined(VISP_HAVE_GTK)
379 unsigned int offsetx = vpMath::minimum<unsigned int>((
unsigned int)unitx.size(), dWidth);
381 #if defined VISP_HAVE_X11
385 #elif defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
394 double size = (double)title.size();
403 for (
unsigned int i = 0; i < curveNbr; i++) {
404 size_t offset = epsj * (curveList + i)->legend.size();
407 if (offsetj > dWidth)
410 for (
unsigned int i = 0; i < curveNbr; i++) {
412 (curveList + i)->legend.c_str(), (curveList + i)->color);
416 void vpPlotGraph::rescalex(
unsigned int side,
double extremity)
420 xmin = (3 * extremity - xmax) / 2;
423 xmax = (3 * extremity - xmin) / 2;
427 xdelt = (xmax - xmin) / (
double)nbDivisionx;
430 void vpPlotGraph::rescaley(
unsigned int side,
double extremity)
434 ymin = (3 * extremity - ymax) / 2;
437 ymax = (3 * extremity - ymin) / 2;
441 ydelt = (ymax - ymin) / (
double)nbDivisiony;
444 void vpPlotGraph::initScale(
vpImage<unsigned char> &I,
double x_min,
double x_max,
int nbDivx,
double y_min,
445 double y_max,
int nbDivy,
bool gx,
bool gy)
453 this->nbDivisionx = nbDivx;
454 this->nbDivisiony = nbDivy;
455 computeGraphParameters();
459 scaleInitialized =
true;
462 void vpPlotGraph::initScale(
vpImage<unsigned char> &I,
double x_min,
double x_max,
int nbDivx,
double y_min,
463 double y_max,
int nbDivy,
double z_min,
double z_max,
int nbDivz,
bool gx,
bool gy)
473 this->nbDivisionx = nbDivx;
474 this->nbDivisiony = nbDivy;
475 this->nbDivisionz = nbDivz;
476 computeGraphParameters();
480 scaleInitialized =
true;
485 if (!scaleInitialized) {
502 scaleInitialized =
true;
503 computeGraphParameters();
507 if (std::fabs(y) <= std::numeric_limits<double>::epsilon())
508 scaleInitialized =
false;
519 double i = yorg - (zoomy * y);
520 double j = xorg + (zoomx * x);
535 computeGraphParameters();
538 i = yorg - (zoomy * y);
539 j = xorg + (zoomx * x);
544 (curveList + curveNb)->plotPoint(I, iP, x, y);
545 #if (!defined VISP_HAVE_X11 && defined FLUSH_ON_PLOT)
555 for (
unsigned int i = 0; i < curveNbr; i++)
556 (curveList + i)->plotList(I, xorg, yorg, zoomx, zoomy);
565 double x = (iP.
get_j() - xorg) / zoomx;
566 double y = (yorg - iP.
get_i()) / zoomy;
569 std::stringstream ss_x;
574 std::stringstream ss_y;
586 void vpPlotGraph::resetPointList(
unsigned int curveNum)
588 (curveList + curveNum)->pointListx.clear();
589 (curveList + curveNum)->pointListy.clear();
590 (curveList + curveNum)->pointListz.clear();
591 (curveList + curveNum)->nbPoint = 0;
602 if (!iP1In || !iP2In) {
603 double dTopLeft_i = dTopLeft3D.get_i();
604 double dTopLeft_j = dTopLeft3D.get_j();
605 double dBottomRight_i = dTopLeft_i + dHeight;
606 double dBottomRight_j = dTopLeft_j + dWidth;
612 if (!iP1In && !iP2In) {
613 if (iP1.
get_i() < dTopLeft_i && iP2.
get_i() < dTopLeft_i)
615 if (iP1.
get_i() > dBottomRight_i && iP2.
get_i() > dBottomRight_i)
617 if (iP1.
get_j() < dTopLeft_j || iP1.
get_j() > dBottomRight_j)
619 if (iP1.
get_i() < dTopLeft_i)
620 iP1.
set_i(dTopLeft_i);
622 iP1.
set_i(dBottomRight_i);
623 if (iP2.
get_i() < dTopLeft_i)
624 iP2.
set_i(dTopLeft_i);
626 iP2.
set_i(dBottomRight_i);
628 if (iP1.
get_j() < dTopLeft_j)
629 iP1.
set_j(dTopLeft_j);
630 if (iP1.
get_j() > dBottomRight_j)
631 iP1.
set_j(dBottomRight_j);
632 if (iP1.
get_i() < dTopLeft_i)
633 iP1.
set_i(dTopLeft_i);
634 if (iP1.
get_i() > dBottomRight_i)
635 iP1.
set_i(dBottomRight_i);
638 if (iP2.
get_j() < dTopLeft_j)
639 iP2.
set_j(dTopLeft_j);
640 if (iP2.
get_j() > dBottomRight_j)
641 iP2.
set_j(dBottomRight_j);
642 if (iP2.
get_i() < dTopLeft_i)
643 iP2.
set_i(dTopLeft_i);
644 if (iP2.
get_i() > dBottomRight_i)
645 iP2.
set_i(dBottomRight_i);
650 else if (fabs(iP2.
get_i() - iP1.
get_i()) <= 2) {
651 if (!iP1In && !iP2In) {
652 if (iP1.
get_j() < dTopLeft_j && iP2.
get_j() < dTopLeft_j)
654 if (iP1.
get_j() > dBottomRight_j && iP2.
get_j() > dBottomRight_j)
656 if (iP1.
get_i() < dTopLeft_i || iP1.
get_i() > dBottomRight_i)
658 if (iP1.
get_j() < dTopLeft_j)
659 iP1.
set_j(dTopLeft_j);
661 iP1.
set_j(dBottomRight_j);
662 if (iP2.
get_j() < dTopLeft_j)
663 iP2.
set_j(dTopLeft_j);
665 iP2.
set_j(dBottomRight_j);
667 if (iP1.
get_j() < dTopLeft_j)
668 iP1.
set_j(dTopLeft_j);
669 if (iP1.
get_j() > dBottomRight_j)
670 iP1.
set_j(dBottomRight_j);
671 if (iP1.
get_i() < dTopLeft_i)
672 iP1.
set_i(dTopLeft_i);
673 if (iP1.
get_i() > dBottomRight_i)
674 iP1.
set_i(dBottomRight_i);
677 if (iP2.
get_j() < dTopLeft_j)
678 iP2.
set_j(dTopLeft_j);
679 if (iP2.
get_j() > dBottomRight_j)
680 iP2.
set_j(dBottomRight_j);
681 if (iP2.
get_i() < dTopLeft_i)
682 iP2.
set_i(dTopLeft_i);
683 if (iP2.
get_i() > dBottomRight_i)
684 iP2.
set_i(dBottomRight_i);
693 double jtop = (dTopLeft_i - b) / a;
694 double jlow = (dBottomRight_i - b) / a;
696 double ileft = dTopLeft_j * a + b;
697 double iright = (dBottomRight_j)*a + b;
702 if (jtop >= dTopLeft_j && jtop <= dBottomRight_j) {
703 iP[n].
set_ij(dTopLeft_i, jtop);
706 if (jlow >= dTopLeft_j && jlow <= dBottomRight_j) {
707 iP[n].
set_ij(dBottomRight_i, jlow);
710 if (ileft >= dTopLeft_i && ileft <= dBottomRight_i && n < 2) {
711 iP[n].
set_ij(ileft, dTopLeft_j);
714 if (iright >= dTopLeft_i && iright <= dBottomRight_i && n < 2) {
715 iP[n].
set_ij(iright, dBottomRight_j);
722 if (!iP1In && !iP2In) {
727 if (sign ==
vpMath::sign(iP[0].get_j() - iP[1].get_j())) {
738 if (sign ==
vpMath::sign(iP[0].get_i() - iP[1].get_i())) {
750 if (fabs(iP[0].get_j() - iP2.
get_j()) > 5) {
763 if (fabs(iP[0].get_i() - iP2.
get_i()) > 5) {
783 if (fabs(iP[0].get_j() - iP1.
get_j()) > 5) {
796 if (fabs(iP[0].get_i() - iP1.
get_i()) > 5) {
820 if (iP.
get_i() < dTopLeft3D.get_i())
821 iP.
set_i(dTopLeft3D.get_i());
822 else if (iP.
get_i() > dTopLeft3D.get_i() + dHeight)
823 iP.
set_i(dTopLeft3D.get_i() + dHeight - 1);
824 if (iP.
get_j() < dTopLeft3D.get_j())
825 iP.
set_j(dTopLeft3D.get_j());
826 else if (iP.
get_j() > dTopLeft3D.get_j() + dWidth)
827 iP.
set_j(dTopLeft3D.get_j() + dWidth - 1);
833 void vpPlotGraph::computeGraphParameters3D()
835 zoomx_3D = w_xsize / (xmax - xmin);
836 zoomy_3D = w_ysize / (ymax - ymin);
837 zoomz_3D = w_zsize / (zmax - zmin);
838 ptXorg = w_xval - zoomx_3D * xmax;
839 ptYorg = w_yval + zoomy_3D * ymin;
840 ptZorg = w_zval - zoomz_3D * zmax;
858 computeGraphParameters3D();
860 xdelt = (xmax - xmin) / nbDivisionx;
861 ydelt = (ymax - ymin) / nbDivisiony;
862 zdelt = (zmax - zmin) / nbDivisionz;
873 for (
unsigned int i = 0; i < 6; i++) {
875 double u = 0.0, v = 0.0;
878 iP[i] = iP[i] + dTopLeft3D;
891 power = laFonctionSansNom(xdelt);
894 if (std::fabs(iP[0].get_j() - iP[1].get_j()) >
895 vpMath::maximum(std::fabs(iP[0].get_j()), std::fabs(iP[1].get_j())) * std::numeric_limits<double>::epsilon())
896 pente = fabs((iP[0].get_i() - iP[1].get_i()) / (iP[0].get_j() - iP[1].get_j()));
900 unsigned int count = 1;
901 for (t = xmin; t <= xmax; t = t + xdelt) {
902 double x = ptXorg + (zoomx_3D * t);
905 double u = 0.0, v = 0.0;
908 iPunit = iPunit + dTopLeft3D;
910 getGrid3DPoint(pente, iPunit, ip1, ip2, ip3);
912 if (check3Dline(ip1, ip2)) {
914 if (count % 2 == 1) {
917 ttemp = t * pow(10.0, power);
920 std::stringstream ss;
930 std::stringstream ss;
933 if (check3Dpoint(ip4))
937 power = laFonctionSansNom(ydelt);
940 if (std::fabs(iP[2].get_j() - iP[3].get_j()) >
941 vpMath::maximum(std::fabs(iP[2].get_j()), std::fabs(iP[3].get_j())) * std::numeric_limits<double>::epsilon())
942 pente = fabs((iP[2].get_i() - iP[3].get_i()) / (iP[2].get_j() - iP[3].get_j()));
946 for (t = ymin; t <= ymax; t = t + ydelt) {
947 double y = ptYorg - (zoomy_3D * t);
950 double u = 0.0, v = 0.0;
953 iPunit = iPunit + dTopLeft3D;
955 getGrid3DPoint(pente, iPunit, ip1, ip2, ip3);
957 if (check3Dline(ip1, ip2)) {
959 if (count % 2 == 1) {
962 ttemp = t * pow(10.0, power);
965 std::stringstream ss;
975 std::stringstream ss;
978 if (check3Dpoint(ip4))
982 power = laFonctionSansNom(zdelt);
985 if (std::fabs(iP[4].get_j() - iP[5].get_j()) >
986 vpMath::maximum(std::fabs(iP[4].get_j()), std::fabs(iP[5].get_j())) * std::numeric_limits<double>::epsilon())
987 pente = fabs((iP[4].get_i() - iP[5].get_i()) / (iP[4].get_j() - iP[5].get_j()));
991 for (t = zmin; t <= zmax; t = t + zdelt) {
992 double z = ptZorg + (zoomz_3D * t);
995 double u = 0.0, v = 0.0;
998 iPunit = iPunit + dTopLeft3D;
1000 getGrid3DPoint(pente, iPunit, ip1, ip2, ip3);
1002 if (check3Dline(ip1, ip2)) {
1004 if (count % 2 == 1) {
1007 ttemp = t * pow(10.0, power);
1010 std::stringstream ss;
1020 std::stringstream ss;
1023 if (check3Dpoint(ip4))
1028 if (check3Dline(iP[0], iP[1])) {
1031 iPunit.
set_ij(iP[1].get_i(), iP[1].get_j() - 10 * epsj);
1032 check3Dpoint(iPunit);
1036 if (check3Dline(iP[3], iP[2])) {
1039 iPunit.
set_ij(iP[2].get_i(), iP[2].get_j() - 10 * epsj);
1040 check3Dpoint(iPunit);
1044 if (check3Dline(iP[4], iP[5])) {
1047 iPunit.
set_ij(iP[5].get_i(), iP[5].get_j() - 10 * epsj);
1048 check3Dpoint(iPunit);
1062 if (!scaleInitialized) {
1087 scaleInitialized =
true;
1088 computeGraphParameters3D();
1092 if (std::fabs(y) <= std::numeric_limits<double>::epsilon() ||
1093 std::fabs(z) <= std::numeric_limits<double>::epsilon())
1094 scaleInitialized =
false;
1104 bool changed =
false;
1108 }
else if (x < xmin) {
1116 }
else if (y < ymin) {
1124 }
else if (z < zmin) {
1131 if (changed || move(I, button)) {
1132 computeGraphParameters3D();
1137 pointPlot.
setWorldCoordinates(ptXorg + (zoomx_3D * x), ptYorg - (zoomy_3D * y), ptZorg + (zoomz_3D * z));
1138 pointPlot.
track(cMo);
1139 double u = 0.0, v = 0.0;
1143 iP = iP + dTopLeft3D;
1145 if ((curveList + curveNb)->nbPoint) {
1146 if (check3Dline((curveList + curveNb)->lastPoint, iP))
1148 (curveList + curveNb)->thickness);
1150 #if (defined VISP_HAVE_X11 || defined VISP_HAVE_GDI)
1156 if (iP.
get_i() <= (curveList + curveNb)->lastPoint.get_i()) {
1157 top = iP.
get_i() - 5;
1158 height_ = (curveList + curveNb)->lastPoint.get_i() - top + 10;
1160 top = (curveList + curveNb)->lastPoint.get_i() - 5;
1161 height_ = iP.
get_i() - top + 10;
1163 if (iP.
get_j() <= (curveList + curveNb)->lastPoint.get_j()) {
1164 left = iP.
get_j() - 5;
1165 width_ = (curveList + curveNb)->lastPoint.get_j() - left + 10;
1167 left = (curveList + curveNb)->lastPoint.get_j() - 5;
1168 width_ = iP.
get_j() - left + 10;
1173 (curveList + curveNb)->lastPoint = iP;
1174 (curveList + curveNb)->pointListx.push_back(x);
1175 (curveList + curveNb)->pointListy.push_back(y);
1176 (curveList + curveNb)->pointListz.push_back(z);
1177 (curveList + curveNb)->nbPoint++;
1179 #if (!defined VISP_HAVE_X11 && defined FLUSH_ON_PLOT)
1190 for (
unsigned int i = 0; i < curveNbr; i++) {
1191 std::list<double>::const_iterator it_ptListx = (curveList + i)->pointListx.begin();
1192 std::list<double>::const_iterator it_ptListy = (curveList + i)->pointListy.begin();
1193 std::list<double>::const_iterator it_ptListz = (curveList + i)->pointListz.begin();
1198 while (k < (curveList + i)->nbPoint) {
1199 double x = *it_ptListx;
1200 double y = *it_ptListy;
1201 double z = *it_ptListz;
1202 pointPlot.
setWorldCoordinates(ptXorg + (zoomx_3D * x), ptYorg - (zoomy_3D * y), ptZorg + (zoomz_3D * z));
1203 pointPlot.
track(cMo);
1204 double u = 0.0, v = 0.0;
1207 iP = iP + dTopLeft3D;
1211 if (check3Dline((curveList + i)->lastPoint, iP))
1216 (curveList + i)->lastPoint = iP;
1227 void vpPlotGraph::rescalez(
unsigned int side,
double extremity)
1231 zmin = (3 * extremity - zmax) / 2;
1234 zmax = (3 * extremity - zmin) / 2;
1238 zdelt = (zmax - zmin) / (
double)nbDivisionz;
1247 bool changed =
false;
1251 if (std::fabs(displacement[2][3]) > std::numeric_limits<double>::epsilon())
1252 cMf = cMf * displacement;
1255 cMo = cMf * displacement * fMo;
1264 bool clicked =
false;
1265 bool clickedUp =
false;
1291 else if (clickedUp) {
1300 if (!(blockedr || blockedz)) {
1312 double diffi = iP.
get_i() - old_iPr.get_i();
1313 double diffj = iP.
get_j() - old_iPr.get_j();
1315 double anglei = diffi * 360 / width_;
1316 double anglej = diffj * 360 / width_;
1325 double diffi = iP.
get_i() - old_iPz.get_i();
1326 mov.buildFrom(0, 0, diffi * 0.01, 0, 0, 0);
1336 #elif !defined(VISP_BUILD_SHARED_LIBS)
1339 void dummy_vpPlotGraph(){};
Class to define RGB colors available for display functionnalities.
static const vpColor black
static const vpColor cyan
static const vpColor orange
static const vpColor blue
static const vpColor purple
static const vpColor green
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static void displayROI(const vpImage< unsigned char > &I, const vpRect &roi)
static void displayLine(const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1, bool segment=true)
static void flushROI(const vpImage< unsigned char > &I, const vpRect &roi)
static bool getClickUp(const vpImage< unsigned char > &I, vpImagePoint &ip, vpMouseButton::vpMouseButtonType &button, bool blocking=true)
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)
static void displayDotLine(const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1)
static bool getPointerPosition(const vpImage< unsigned char > &I, vpImagePoint &ip)
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
void track(const vpHomogeneousMatrix &cMo)
Implementation of an homogeneous matrix and operations on such kind of matrices.
vpHomogeneousMatrix inverse() const
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
static double distance(const vpImagePoint &iP1, const vpImagePoint &iP2)
bool inRectangle(const vpRect &rect) const
void set_ij(double ii, double jj)
void set_uv(double u, double v)
unsigned int getWidth() const
unsigned int getHeight() const
static double rad(double deg)
static Type maximum(const Type &a, const Type &b)
static Type minimum(const Type &a, const Type &b)
static int sign(double x)
static void convertPoint(const vpCameraParameters &cam, const double &x, const double &y, double &u, double &v)
static void convertPoint(const vpCameraParameters &cam, const double &u, const double &v, double &x, double &y)
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
void set_x(double x)
Set the point x coordinate in the image plane.
double get_y() const
Get the point y coordinate in the image plane.
void set_oY(double oY)
Set the point oY coordinate in the object frame.
double get_x() const
Get the point x coordinate in the image plane.
void set_oZ(double oZ)
Set the point oZ coordinate in the object frame.
void set_oX(double oX)
Set the point oX coordinate in the object frame.
void setWorldCoordinates(double oX, double oY, double oZ)
void set_y(double y)
Set the point y coordinate in the image plane.
Class used for pose computation from N points (pose from point only). Some of the algorithms implemen...
void addPoint(const vpPoint &P)
bool computePose(vpPoseMethodType method, vpHomogeneousMatrix &cMo, bool(*func)(const vpHomogeneousMatrix &)=NULL)
Defines a rectangle in the plane.
VISP_EXPORT void sleepMs(double t)