36 #include <visp3/core/vpConfig.h>
37 #ifndef DOXYGEN_SHOULD_SKIP_THIS
39 #include <visp3/core/vpMath.h>
40 #include <visp3/core/vpMeterPixelConversion.h>
41 #include <visp3/core/vpPixelMeterConversion.h>
42 #include <visp3/gui/vpPlotGraph.h>
44 #include <visp3/gui/vpDisplayD3D.h>
45 #include <visp3/gui/vpDisplayGDI.h>
46 #include <visp3/gui/vpDisplayGTK.h>
47 #include <visp3/gui/vpDisplayOpenCV.h>
48 #include <visp3/gui/vpDisplayX.h>
54 #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(nullptr), 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 !=
nullptr) {
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;
133 else if (this->dWidth == this->dHeight) {
142 else if (this->dWidth < this->dHeight) {
144 w_ysize = this->dHeight / this->dWidth;
147 w_yval = w_ysize / 2.0;
148 w_xval = w_xsize / 2.0;
149 w_zval = w_zsize / 2.0;
152 cam.initPersProjWithoutDistortion(1000, 1000, this->dWidth / 2.0, this->dHeight / 2.0);
156 cMf.buildFrom(0, 0, cMo[2][3], 0, 0, 0);
159 void vpPlotGraph::findPose()
169 iP[1].
set_ij(0, dWidth - 1);
170 iP[2].
set_ij(dHeight - 1, dWidth - 1);
171 iP[3].
set_ij(dHeight - 1, 0);
177 const unsigned int val_4 = 4;
178 for (
unsigned int i = 0; i < val_4; ++i) {
186 void vpPlotGraph::computeGraphParameters()
188 zoomx = dWidth / (xmax - xmin);
189 zoomy = dHeight / (ymax - ymin);
190 xorg = dTopLeft.get_j() - (xmin * zoomx);
191 yorg = dTopLeft.get_i() + (ymax * zoomy);
194 void vpPlotGraph::setCurveColor(
unsigned int curveNum,
const vpColor &color) { (curveList + curveNum)->color = color; }
196 void vpPlotGraph::setTitle(
const std::string &title_)
202 void vpPlotGraph::setUnitX(
const std::string &unit_x)
208 void vpPlotGraph::setUnitY(
const std::string &unit_y)
214 void vpPlotGraph::setUnitZ(
const std::string &unit_z)
220 void vpPlotGraph::setLegend(
unsigned int curveNum,
const std::string &newlegend)
222 (curveList + curveNum)->legend = newlegend;
226 void vpPlotGraph::setCurveThickness(
unsigned int curveNum,
unsigned int thickness)
228 (curveList + curveNum)->thickness = thickness;
231 int laFonctionSansNom(
double delta)
258 computeGraphParameters();
260 xdelt = (xmax - xmin) / nbDivisionx;
261 ydelt = (ymax - ymin) / nbDivisiony;
266 power = laFonctionSansNom(xdelt);
267 for (t = xmin; t <= xmax; t = t + xdelt) {
268 double x = xorg + (zoomx * t);
271 gridColor, gridThickness);
275 if (t + xdelt <= xmax + 1e-10) {
278 ttemp = t * pow(10.0, power);
281 std::stringstream valeur;
284 #if defined(VISP_HAVE_X11)
286 #elif defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
292 std::stringstream ss;
295 #if defined(VISP_HAVE_X11)
298 #elif defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
304 power = laFonctionSansNom(ydelt);
305 for (t = ymin; t <= ymax; t = t + ydelt) {
306 double y = yorg - (zoomy * t);
309 gridColor, gridThickness);
315 ttemp = t * pow(10.0, power);
319 std::stringstream valeur;
322 #if defined(VISP_HAVE_X11)
324 #elif defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
329 std::stringstream ss;
332 #if defined(VISP_HAVE_X11)
335 #elif defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
343 vpColor::black, 4 * gridThickness, 2 * gridThickness, gridThickness);
346 vpColor::black, 4 * gridThickness, 2 * gridThickness, gridThickness);
359 #
if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || \
360 defined(VISP_HAVE_GTK)
365 unsigned int offsetx = vpMath::minimum<unsigned int>((
unsigned int)unitx.size(), dWidth);
367 #if defined(VISP_HAVE_X11)
371 #elif defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
380 double size = (double)title.size();
389 for (
unsigned int i = 0; i < curveNbr; ++i) {
390 size_t offset = epsj * (curveList + i)->legend.size();
393 if (offsetj > dWidth)
396 for (
unsigned int i = 0; i < curveNbr; ++i) {
398 (curveList + i)->legend.c_str(), (curveList + i)->color);
402 void vpPlotGraph::rescalex(
unsigned int side,
double extremity)
406 xmin = (3 * extremity - xmax) / 2;
409 xmax = (3 * extremity - xmin) / 2;
413 xdelt = (xmax - xmin) / (
double)nbDivisionx;
416 void vpPlotGraph::rescaley(
unsigned int side,
double extremity)
420 ymin = (3 * extremity - ymax) / 2;
423 ymax = (3 * extremity - ymin) / 2;
427 ydelt = (ymax - ymin) / (
double)nbDivisiony;
430 void vpPlotGraph::initScale(
vpImage<unsigned char> &I,
double x_min,
double x_max,
int nbDivx,
double y_min,
431 double y_max,
int nbDivy,
bool gx,
bool gy)
439 this->nbDivisionx = nbDivx;
440 this->nbDivisiony = nbDivy;
441 computeGraphParameters();
445 scaleInitialized =
true;
448 void vpPlotGraph::initScale(
vpImage<unsigned char> &I,
double x_min,
double x_max,
int nbDivx,
double y_min,
449 double y_max,
int nbDivy,
double z_min,
double z_max,
int nbDivz,
bool gx,
bool gy)
459 this->nbDivisionx = nbDivx;
460 this->nbDivisiony = nbDivy;
461 this->nbDivisionz = nbDivz;
462 computeGraphParameters();
466 scaleInitialized =
true;
471 if (!scaleInitialized) {
488 scaleInitialized =
true;
489 computeGraphParameters();
493 if (std::fabs(y) <= std::numeric_limits<double>::epsilon())
494 scaleInitialized =
false;
505 double i = yorg - (zoomy * y);
506 double j = xorg + (zoomx * x);
521 computeGraphParameters();
524 i = yorg - (zoomy * y);
525 j = xorg + (zoomx * x);
530 (curveList + curveNb)->plotPoint(I, iP, x, y);
531 #if (!defined VISP_HAVE_X11 && defined FLUSH_ON_PLOT)
541 for (
unsigned int i = 0; i < curveNbr; ++i)
542 (curveList + i)->plotList(I, xorg, yorg, zoomx, zoomy);
551 double x = (iP.
get_j() - xorg) / zoomx;
552 double y = (yorg - iP.
get_i()) / zoomy;
555 std::stringstream ss_x;
560 std::stringstream ss_y;
572 void vpPlotGraph::resetPointList(
unsigned int curveNum)
574 (curveList + curveNum)->pointListx.clear();
575 (curveList + curveNum)->pointListy.clear();
576 (curveList + curveNum)->pointListz.clear();
577 (curveList + curveNum)->nbPoint = 0;
588 if (!iP1In || !iP2In) {
589 double dTopLeft_i = dTopLeft3D.get_i();
590 double dTopLeft_j = dTopLeft3D.get_j();
591 double dBottomRight_i = dTopLeft_i + dHeight;
592 double dBottomRight_j = dTopLeft_j + dWidth;
598 if (!iP1In && !iP2In) {
599 if (iP1.
get_i() < dTopLeft_i && iP2.
get_i() < dTopLeft_i)
601 if (iP1.
get_i() > dBottomRight_i && iP2.
get_i() > dBottomRight_i)
603 if (iP1.
get_j() < dTopLeft_j || iP1.
get_j() > dBottomRight_j)
605 if (iP1.
get_i() < dTopLeft_i)
606 iP1.
set_i(dTopLeft_i);
608 iP1.
set_i(dBottomRight_i);
609 if (iP2.
get_i() < dTopLeft_i)
610 iP2.
set_i(dTopLeft_i);
612 iP2.
set_i(dBottomRight_i);
615 if (iP1.
get_j() < dTopLeft_j)
616 iP1.
set_j(dTopLeft_j);
617 if (iP1.
get_j() > dBottomRight_j)
618 iP1.
set_j(dBottomRight_j);
619 if (iP1.
get_i() < dTopLeft_i)
620 iP1.
set_i(dTopLeft_i);
621 if (iP1.
get_i() > dBottomRight_i)
622 iP1.
set_i(dBottomRight_i);
626 if (iP2.
get_j() < dTopLeft_j)
627 iP2.
set_j(dTopLeft_j);
628 if (iP2.
get_j() > dBottomRight_j)
629 iP2.
set_j(dBottomRight_j);
630 if (iP2.
get_i() < dTopLeft_i)
631 iP2.
set_i(dTopLeft_i);
632 if (iP2.
get_i() > dBottomRight_i)
633 iP2.
set_i(dBottomRight_i);
638 else if (fabs(iP2.
get_i() - iP1.
get_i()) <= 2) {
639 if (!iP1In && !iP2In) {
640 if (iP1.
get_j() < dTopLeft_j && iP2.
get_j() < dTopLeft_j)
642 if (iP1.
get_j() > dBottomRight_j && iP2.
get_j() > dBottomRight_j)
644 if (iP1.
get_i() < dTopLeft_i || iP1.
get_i() > dBottomRight_i)
646 if (iP1.
get_j() < dTopLeft_j)
647 iP1.
set_j(dTopLeft_j);
649 iP1.
set_j(dBottomRight_j);
650 if (iP2.
get_j() < dTopLeft_j)
651 iP2.
set_j(dTopLeft_j);
653 iP2.
set_j(dBottomRight_j);
656 if (iP1.
get_j() < dTopLeft_j)
657 iP1.
set_j(dTopLeft_j);
658 if (iP1.
get_j() > dBottomRight_j)
659 iP1.
set_j(dBottomRight_j);
660 if (iP1.
get_i() < dTopLeft_i)
661 iP1.
set_i(dTopLeft_i);
662 if (iP1.
get_i() > dBottomRight_i)
663 iP1.
set_i(dBottomRight_i);
667 if (iP2.
get_j() < dTopLeft_j)
668 iP2.
set_j(dTopLeft_j);
669 if (iP2.
get_j() > dBottomRight_j)
670 iP2.
set_j(dBottomRight_j);
671 if (iP2.
get_i() < dTopLeft_i)
672 iP2.
set_i(dTopLeft_i);
673 if (iP2.
get_i() > dBottomRight_i)
674 iP2.
set_i(dBottomRight_i);
683 double jtop = (dTopLeft_i - b) / a;
684 double jlow = (dBottomRight_i - b) / a;
686 double ileft = dTopLeft_j * a + b;
687 double iright = (dBottomRight_j)*a + b;
692 if (jtop >= dTopLeft_j && jtop <= dBottomRight_j) {
693 iP[n].
set_ij(dTopLeft_i, jtop);
696 if (jlow >= dTopLeft_j && jlow <= dBottomRight_j) {
697 iP[n].
set_ij(dBottomRight_i, jlow);
700 if (ileft >= dTopLeft_i && ileft <= dBottomRight_i && n < 2) {
701 iP[n].
set_ij(ileft, dTopLeft_j);
704 if (iright >= dTopLeft_i && iright <= dBottomRight_i && n < 2) {
705 iP[n].
set_ij(iright, dBottomRight_j);
712 if (!iP1In && !iP2In) {
717 if (sign ==
vpMath::sign(iP[0].get_j() - iP[1].get_j())) {
730 if (sign ==
vpMath::sign(iP[0].get_i() - iP[1].get_i())) {
744 if (fabs(iP[0].get_j() - iP2.
get_j()) > 5) {
759 if (fabs(iP[0].get_i() - iP2.
get_i()) > 5) {
781 if (fabs(iP[0].get_j() - iP1.
get_j()) > 5) {
796 if (fabs(iP[0].get_i() - iP1.
get_i()) > 5) {
821 if (iP.
get_i() < dTopLeft3D.get_i())
822 iP.
set_i(dTopLeft3D.get_i());
823 else if (iP.
get_i() > dTopLeft3D.get_i() + dHeight)
824 iP.
set_i(dTopLeft3D.get_i() + dHeight - 1);
825 if (iP.
get_j() < dTopLeft3D.get_j())
826 iP.
set_j(dTopLeft3D.get_j());
827 else if (iP.
get_j() > dTopLeft3D.get_j() + dWidth)
828 iP.
set_j(dTopLeft3D.get_j() + dWidth - 1);
834 void vpPlotGraph::computeGraphParameters3D()
836 zoomx_3D = w_xsize / (xmax - xmin);
837 zoomy_3D = w_ysize / (ymax - ymin);
838 zoomz_3D = w_zsize / (zmax - zmin);
839 ptXorg = w_xval - zoomx_3D * xmax;
840 ptYorg = w_yval + zoomy_3D * ymin;
841 ptZorg = w_zval - zoomz_3D * zmax;
860 const unsigned int nparam = 6;
861 computeGraphParameters3D();
863 xdelt = (xmax - xmin) / nbDivisionx;
864 ydelt = (ymax - ymin) / nbDivisiony;
865 zdelt = (zmax - zmin) / nbDivisionz;
876 for (
unsigned int i = 0; i < nparam; ++i) {
878 double u = 0.0, v = 0.0;
881 iP[i] = iP[i] + dTopLeft3D;
894 power = laFonctionSansNom(xdelt);
897 if (std::fabs(iP[0].get_j() - iP[1].get_j()) >
898 vpMath::maximum(std::fabs(iP[0].get_j()), std::fabs(iP[1].get_j())) * std::numeric_limits<double>::epsilon())
899 pente = fabs((iP[0].get_i() - iP[1].get_i()) / (iP[0].get_j() - iP[1].get_j()));
903 unsigned int count = 1;
904 for (t = xmin; t <= xmax; t = t + xdelt) {
905 double x = ptXorg + (zoomx_3D * t);
908 double u = 0.0, v = 0.0;
911 iPunit = iPunit + dTopLeft3D;
913 getGrid3DPoint(pente, iPunit, ip1, ip2, ip3);
915 if (check3Dline(ip1, ip2)) {
917 if (count % 2 == 1) {
920 ttemp = t * pow(10.0, power);
923 std::stringstream ss;
933 std::stringstream ss;
936 if (check3Dpoint(ip4))
940 power = laFonctionSansNom(ydelt);
943 if (std::fabs(iP[2].get_j() - iP[3].get_j()) >
944 vpMath::maximum(std::fabs(iP[2].get_j()), std::fabs(iP[3].get_j())) * std::numeric_limits<double>::epsilon())
945 pente = fabs((iP[2].get_i() - iP[3].get_i()) / (iP[2].get_j() - iP[3].get_j()));
949 for (t = ymin; t <= ymax; t = t + ydelt) {
950 double y = ptYorg - (zoomy_3D * t);
953 double u = 0.0, v = 0.0;
956 iPunit = iPunit + dTopLeft3D;
958 getGrid3DPoint(pente, iPunit, ip1, ip2, ip3);
960 if (check3Dline(ip1, ip2)) {
962 if (count % 2 == 1) {
965 ttemp = t * pow(10.0, power);
968 std::stringstream ss;
978 std::stringstream ss;
981 if (check3Dpoint(ip4))
985 power = laFonctionSansNom(zdelt);
988 if (std::fabs(iP[4].get_j() - iP[5].get_j()) >
989 vpMath::maximum(std::fabs(iP[4].get_j()), std::fabs(iP[5].get_j())) * std::numeric_limits<double>::epsilon())
990 pente = fabs((iP[4].get_i() - iP[5].get_i()) / (iP[4].get_j() - iP[5].get_j()));
994 for (t = zmin; t <= zmax; t = t + zdelt) {
995 double z = ptZorg + (zoomz_3D * t);
998 double u = 0.0, v = 0.0;
1001 iPunit = iPunit + dTopLeft3D;
1003 getGrid3DPoint(pente, iPunit, ip1, ip2, ip3);
1005 if (check3Dline(ip1, ip2)) {
1007 if (count % 2 == 1) {
1010 ttemp = t * pow(10.0, power);
1013 std::stringstream ss;
1023 std::stringstream ss;
1026 if (check3Dpoint(ip4))
1031 if (check3Dline(iP[0], iP[1])) {
1034 iPunit.
set_ij(iP[1].get_i(), iP[1].get_j() - 10 * epsj);
1035 check3Dpoint(iPunit);
1039 if (check3Dline(iP[3], iP[2])) {
1042 iPunit.
set_ij(iP[2].get_i(), iP[2].get_j() - 10 * epsj);
1043 check3Dpoint(iPunit);
1047 if (check3Dline(iP[4], iP[5])) {
1050 iPunit.
set_ij(iP[5].get_i(), iP[5].get_j() - 10 * epsj);
1051 check3Dpoint(iPunit);
1065 if (!scaleInitialized) {
1090 scaleInitialized =
true;
1091 computeGraphParameters3D();
1095 if (std::fabs(y) <= std::numeric_limits<double>::epsilon() ||
1096 std::fabs(z) <= std::numeric_limits<double>::epsilon())
1097 scaleInitialized =
false;
1107 bool changed =
false;
1112 else if (x < xmin) {
1121 else if (y < ymin) {
1130 else if (z < zmin) {
1137 if (changed || move(I, button)) {
1138 computeGraphParameters3D();
1143 pointPlot.
setWorldCoordinates(ptXorg + (zoomx_3D * x), ptYorg - (zoomy_3D * y), ptZorg + (zoomz_3D * z));
1144 pointPlot.
track(cMo);
1145 double u = 0.0, v = 0.0;
1149 iP = iP + dTopLeft3D;
1151 if ((curveList + curveNb)->nbPoint) {
1152 if (check3Dline((curveList + curveNb)->lastPoint, iP))
1154 (curveList + curveNb)->thickness);
1156 #if (defined VISP_HAVE_X11 || defined VISP_HAVE_GDI)
1162 if (iP.
get_i() <= (curveList + curveNb)->lastPoint.get_i()) {
1163 top = iP.
get_i() - 5;
1164 height_ = (curveList + curveNb)->lastPoint.get_i() - top + 10;
1167 top = (curveList + curveNb)->lastPoint.get_i() - 5;
1168 height_ = iP.
get_i() - top + 10;
1170 if (iP.
get_j() <= (curveList + curveNb)->lastPoint.get_j()) {
1171 left = iP.
get_j() - 5;
1172 width_ = (curveList + curveNb)->lastPoint.get_j() - left + 10;
1175 left = (curveList + curveNb)->lastPoint.get_j() - 5;
1176 width_ = iP.
get_j() - left + 10;
1181 (curveList + curveNb)->lastPoint = iP;
1182 (curveList + curveNb)->pointListx.push_back(x);
1183 (curveList + curveNb)->pointListy.push_back(y);
1184 (curveList + curveNb)->pointListz.push_back(z);
1185 (curveList + curveNb)->nbPoint++;
1187 #if (!defined VISP_HAVE_X11 && defined FLUSH_ON_PLOT)
1198 for (
unsigned int i = 0; i < curveNbr; ++i) {
1199 std::list<double>::const_iterator it_ptListx = (curveList + i)->pointListx.begin();
1200 std::list<double>::const_iterator it_ptListy = (curveList + i)->pointListy.begin();
1201 std::list<double>::const_iterator it_ptListz = (curveList + i)->pointListz.begin();
1206 while (k < (curveList + i)->nbPoint) {
1207 double x = *it_ptListx;
1208 double y = *it_ptListy;
1209 double z = *it_ptListz;
1210 pointPlot.
setWorldCoordinates(ptXorg + (zoomx_3D * x), ptYorg - (zoomy_3D * y), ptZorg + (zoomz_3D * z));
1211 pointPlot.
track(cMo);
1212 double u = 0.0, v = 0.0;
1215 iP = iP + dTopLeft3D;
1219 if (check3Dline((curveList + i)->lastPoint, iP))
1224 (curveList + i)->lastPoint = iP;
1235 void vpPlotGraph::rescalez(
unsigned int side,
double extremity)
1239 zmin = (3 * extremity - zmax) / 2;
1242 zmax = (3 * extremity - zmin) / 2;
1246 zdelt = (zmax - zmin) / (
double)nbDivisionz;
1255 bool changed =
false;
1259 if (std::fabs(displacement[2][3]) > std::numeric_limits<double>::epsilon())
1260 cMf = cMf * displacement;
1263 cMo = cMf * displacement * fMo;
1272 bool clicked =
false;
1273 bool clickedUp =
false;
1299 else if (clickedUp) {
1308 if (!(blockedr || blockedz)) {
1320 double diffi = iP.
get_i() - old_iPr.get_i();
1321 double diffj = iP.
get_j() - old_iPr.get_j();
1323 double anglei = diffi * 360 / width_;
1324 double anglej = diffj * 360 / width_;
1333 double diffi = iP.
get_i() - old_iPz.get_i();
1334 mov.buildFrom(0, 0, diffi * 0.01, 0, 0, 0);
1346 #elif !defined(VISP_BUILD_SHARED_LIBS)
1348 void dummy_vpPlotGraph() { };
Class to define RGB colors available for display functionalities.
static const vpColor cyan
static const vpColor orange
static const vpColor blue
static const vpColor purple
static const vpColor black
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)
void set_ij(double ii, double jj)
bool inRectangle(const vpRect &rect) const
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 ...
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)
Defines a rectangle in the plane.
VISP_EXPORT void sleepMs(double t)