35#include <visp3/core/vpConfig.h>
36#ifndef DOXYGEN_SHOULD_SKIP_THIS
38#include <visp3/core/vpMath.h>
39#include <visp3/core/vpMeterPixelConversion.h>
40#include <visp3/core/vpPixelMeterConversion.h>
41#include <visp3/gui/vpPlotGraph.h>
43#include <visp3/gui/vpDisplayD3D.h>
44#include <visp3/gui/vpDisplayGDI.h>
45#include <visp3/gui/vpDisplayGTK.h>
46#include <visp3/gui/vpDisplayOpenCV.h>
47#include <visp3/gui/vpDisplayX.h>
53#if defined(VISP_HAVE_DISPLAY)
57int laFonctionSansNom(
double delta);
60vpPlotGraph::vpPlotGraph()
61 : xorg(0.), yorg(0.), zoomx(1.), zoomy(1.), xmax(10), ymax(10), xmin(0), ymin(-10), xdelt(1), ydelt(1), gridx(true),
62 gridy(true), gridColor(), curveNbr(1), curveList(nullptr), scaleInitialized(false), firstPoint(true), nbDivisionx(10),
63 nbDivisiony(10), topLeft(),
width(0),
height(0), graphZone(), dTopLeft(), dWidth(0), dHeight(0), dGraphZone(),
64 dTopLeft3D(), dGraphZone3D(),
cam(),
cMo(), cMf(), w_xval(0), w_xsize(0), w_yval(0), w_ysize(0), w_zval(0),
65 w_zsize(0), ptXorg(0), ptYorg(0), ptZorg(0), zoomx_3D(1.), zoomy_3D(1.), zoomz_3D(1.), nbDivisionz(10), zorg(1.),
66 zoomz(1.), zmax(10), zmin(-10), zdelt(1), old_iPr(), old_iPz(), blockedr(false), blockedz(false), blocked(false),
67 epsi(5), epsj(6), dispUnit(false), dispTitle(false), dispLegend(false), gridThickness(1)
69 gridColor.setColor(200, 200, 200);
77vpPlotGraph::~vpPlotGraph()
79 if (curveList !=
nullptr) {
85void vpPlotGraph::initGraph(
unsigned int nbCurve)
87 curveList =
new vpPlotCurve[nbCurve];
92 for (
unsigned int i = 0;
i < curveNbr; ++
i) {
93 (curveList +
i)->color = colors[i % 6];
94 (curveList +
i)->curveStyle = vpPlotCurve::line;
95 (curveList +
i)->pointListx.clear();
96 (curveList +
i)->pointListy.clear();
97 (curveList +
i)->legend.clear();
101void vpPlotGraph::initSize(
vpImagePoint top_left,
unsigned int w,
unsigned int h,
unsigned int margei,
104 this->topLeft = top_left;
107 graphZone.setTopLeft(topLeft);
108 graphZone.setWidth(width);
109 graphZone.setHeight(height);
111 this->dTopLeft =
vpImagePoint(topLeft.get_i() + margei, topLeft.get_j() + margej);
112 this->dWidth =
width - margej - 10;
113 this->dHeight =
height - 2 * margei;
114 dGraphZone.setTopLeft(dTopLeft);
115 dGraphZone.setWidth(dWidth + 1);
116 dGraphZone.setHeight(dHeight + 1);
118 this->dTopLeft3D =
vpImagePoint(topLeft.get_i() + margei, topLeft.get_j() + 10);
119 dGraphZone3D.setTopLeft(dTopLeft3D);
120 dGraphZone3D.setWidth(dWidth + 1);
121 dGraphZone3D.setHeight(dHeight + 1);
123 if (this->dWidth > this->dHeight) {
125 w_xsize = this->dWidth / this->dHeight;
128 w_yval = w_ysize / 2.0;
129 w_xval = w_xsize / 2.0;
130 w_zval = w_zsize / 2.0;
132 else if (this->dWidth == this->dHeight) {
141 else if (this->dWidth < this->dHeight) {
143 w_ysize = this->dHeight / this->dWidth;
146 w_yval = w_ysize / 2.0;
147 w_xval = w_xsize / 2.0;
148 w_zval = w_zsize / 2.0;
151 cam.initPersProjWithoutDistortion(1000, 1000, this->dWidth / 2.0, this->dHeight / 2.0);
155 cMf.buildFrom(0, 0, cMo[2][3], 0, 0, 0);
158void vpPlotGraph::findPose()
168 iP[1].
set_ij(0, dWidth - 1);
169 iP[2].
set_ij(dHeight - 1, dWidth - 1);
170 iP[3].
set_ij(dHeight - 1, 0);
176 const unsigned int val_4 = 4;
177 for (
unsigned int i = 0;
i < val_4; ++
i) {
185void vpPlotGraph::computeGraphParameters()
187 zoomx = dWidth / (xmax - xmin);
188 zoomy = dHeight / (ymax - ymin);
189 xorg = dTopLeft.get_j() - (xmin * zoomx);
190 yorg = dTopLeft.get_i() + (ymax * zoomy);
193void vpPlotGraph::setCurveColor(
unsigned int curveNum,
const vpColor &color) { (curveList + curveNum)->color = color; }
195void vpPlotGraph::setTitle(
const std::string &title_)
201void vpPlotGraph::setUnitX(
const std::string &unit_x)
207void vpPlotGraph::setUnitY(
const std::string &unit_y)
213void vpPlotGraph::setUnitZ(
const std::string &unit_z)
219void vpPlotGraph::setLegend(
unsigned int curveNum,
const std::string &newlegend)
221 (curveList + curveNum)->legend = newlegend;
225void vpPlotGraph::setCurveThickness(
unsigned int curveNum,
unsigned int thickness)
227 (curveList + curveNum)->thickness = thickness;
230int laFonctionSansNom(
double delta)
257 computeGraphParameters();
259 xdelt = (xmax - xmin) / nbDivisionx;
260 ydelt = (ymax - ymin) / nbDivisiony;
265 power = laFonctionSansNom(xdelt);
266 for (t = xmin;
t <= xmax;
t =
t + xdelt) {
267 double x = xorg + (zoomx *
t);
270 gridColor, gridThickness);
274 if (t + xdelt <= xmax + 1e-10) {
277 ttemp =
t * pow(10.0, power);
280 std::stringstream valeur;
283#if defined(VISP_HAVE_X11)
285#elif defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
291 std::stringstream ss;
294#if defined(VISP_HAVE_X11)
297#elif defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
303 power = laFonctionSansNom(ydelt);
304 for (t = ymin;
t <= ymax;
t =
t + ydelt) {
305 double y = yorg - (zoomy *
t);
308 gridColor, gridThickness);
314 ttemp =
t * pow(10.0, power);
318 std::stringstream valeur;
321#if defined(VISP_HAVE_X11)
323#elif defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
328 std::stringstream ss;
331#if defined(VISP_HAVE_X11)
334#elif defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
342 vpColor::black, 4 * gridThickness, 2 * gridThickness, gridThickness);
345 vpColor::black, 4 * gridThickness, 2 * gridThickness, gridThickness);
358#
if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || \
359 defined(VISP_HAVE_GTK)
366#if defined(VISP_HAVE_X11)
370#elif defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
379 double size =
static_cast<double>(title.size());
388 for (
unsigned int i = 0;
i < curveNbr; ++
i) {
389 size_t offset = epsj * (curveList +
i)->legend.size();
392 if (offsetj > dWidth)
395 for (
unsigned int i = 0;
i < curveNbr; ++
i) {
397 (curveList + i)->legend.c_str(), (curveList + i)->color);
401void vpPlotGraph::rescalex(
unsigned int side,
double extremity)
405 xmin = (3 * extremity - xmax) / 2;
408 xmax = (3 * extremity - xmin) / 2;
412 xdelt = (xmax - xmin) /
static_cast<double>(nbDivisionx);
415void vpPlotGraph::rescaley(
unsigned int side,
double extremity)
419 ymin = (3 * extremity - ymax) / 2;
422 ymax = (3 * extremity - ymin) / 2;
426 ydelt = (ymax - ymin) /
static_cast<double>(nbDivisiony);
429void vpPlotGraph::initScale(
vpImage<unsigned char> &I,
double x_min,
double x_max,
int nbDivx,
double y_min,
430 double y_max,
int nbDivy,
bool gx,
bool gy)
438 this->nbDivisionx = nbDivx;
439 this->nbDivisiony = nbDivy;
440 computeGraphParameters();
444 scaleInitialized =
true;
447void vpPlotGraph::initScale(
vpImage<unsigned char> &I,
double x_min,
double x_max,
int nbDivx,
double y_min,
448 double y_max,
int nbDivy,
double z_min,
double z_max,
int nbDivz,
bool gx,
bool gy)
458 this->nbDivisionx = nbDivx;
459 this->nbDivisiony = nbDivy;
460 this->nbDivisionz = nbDivz;
461 computeGraphParameters();
465 scaleInitialized =
true;
470 if (!scaleInitialized) {
487 scaleInitialized =
true;
488 computeGraphParameters();
492 if (std::fabs(y) <= std::numeric_limits<double>::epsilon())
493 scaleInitialized =
false;
504 double i = yorg - (zoomy *
y);
505 double j = xorg + (zoomx *
x);
520 computeGraphParameters();
523 i = yorg - (zoomy *
y);
524 j = xorg + (zoomx *
x);
529 (curveList + curveNb)->plotPoint(I, iP, x, y);
530#if (!defined VISP_HAVE_X11 && defined FLUSH_ON_PLOT)
540 for (
unsigned int i = 0;
i < curveNbr; ++
i)
541 (curveList + i)->plotList(I, xorg, yorg, zoomx, zoomy);
550 double x = (iP.
get_j() - xorg) / zoomx;
551 double y = (yorg - iP.
get_i()) / zoomy;
554 std::stringstream ss_x;
559 std::stringstream ss_y;
571void vpPlotGraph::resetPointList(
unsigned int curveNum)
573 (curveList + curveNum)->pointListx.clear();
574 (curveList + curveNum)->pointListy.clear();
575 (curveList + curveNum)->pointListz.clear();
576 (curveList + curveNum)->nbPoint = 0;
585 if (!iP1In || !iP2In) {
586 double dTopLeft_i = dTopLeft3D.get_i();
587 double dTopLeft_j = dTopLeft3D.get_j();
588 double dBottomRight_i = dTopLeft_i + dHeight;
589 double dBottomRight_j = dTopLeft_j + dWidth;
595 if (!iP1In && !iP2In) {
596 if (iP1.
get_i() < dTopLeft_i && iP2.
get_i() < dTopLeft_i)
598 if (iP1.
get_i() > dBottomRight_i && iP2.
get_i() > dBottomRight_i)
600 if (iP1.
get_j() < dTopLeft_j || iP1.
get_j() > dBottomRight_j)
602 if (iP1.
get_i() < dTopLeft_i)
603 iP1.
set_i(dTopLeft_i);
605 iP1.
set_i(dBottomRight_i);
606 if (iP2.
get_i() < dTopLeft_i)
607 iP2.
set_i(dTopLeft_i);
609 iP2.
set_i(dBottomRight_i);
612 if (iP1.
get_j() < dTopLeft_j)
613 iP1.
set_j(dTopLeft_j);
614 if (iP1.
get_j() > dBottomRight_j)
615 iP1.
set_j(dBottomRight_j);
616 if (iP1.
get_i() < dTopLeft_i)
617 iP1.
set_i(dTopLeft_i);
618 if (iP1.
get_i() > dBottomRight_i)
619 iP1.
set_i(dBottomRight_i);
623 if (iP2.
get_j() < dTopLeft_j)
624 iP2.
set_j(dTopLeft_j);
625 if (iP2.
get_j() > dBottomRight_j)
626 iP2.
set_j(dBottomRight_j);
627 if (iP2.
get_i() < dTopLeft_i)
628 iP2.
set_i(dTopLeft_i);
629 if (iP2.
get_i() > dBottomRight_i)
630 iP2.
set_i(dBottomRight_i);
635 else if (fabs(iP2.
get_i() - iP1.
get_i()) <= 2) {
636 if (!iP1In && !iP2In) {
637 if (iP1.
get_j() < dTopLeft_j && iP2.
get_j() < dTopLeft_j)
639 if (iP1.
get_j() > dBottomRight_j && iP2.
get_j() > dBottomRight_j)
641 if (iP1.
get_i() < dTopLeft_i || iP1.
get_i() > dBottomRight_i)
643 if (iP1.
get_j() < dTopLeft_j)
644 iP1.
set_j(dTopLeft_j);
646 iP1.
set_j(dBottomRight_j);
647 if (iP2.
get_j() < dTopLeft_j)
648 iP2.
set_j(dTopLeft_j);
650 iP2.
set_j(dBottomRight_j);
653 if (iP1.
get_j() < dTopLeft_j)
654 iP1.
set_j(dTopLeft_j);
655 if (iP1.
get_j() > dBottomRight_j)
656 iP1.
set_j(dBottomRight_j);
657 if (iP1.
get_i() < dTopLeft_i)
658 iP1.
set_i(dTopLeft_i);
659 if (iP1.
get_i() > dBottomRight_i)
660 iP1.
set_i(dBottomRight_i);
664 if (iP2.
get_j() < dTopLeft_j)
665 iP2.
set_j(dTopLeft_j);
666 if (iP2.
get_j() > dBottomRight_j)
667 iP2.
set_j(dBottomRight_j);
668 if (iP2.
get_i() < dTopLeft_i)
669 iP2.
set_i(dTopLeft_i);
670 if (iP2.
get_i() > dBottomRight_i)
671 iP2.
set_i(dBottomRight_i);
680 double jtop = (dTopLeft_i - b) / a;
681 double jlow = (dBottomRight_i - b) / a;
683 double ileft = dTopLeft_j * a + b;
684 double iright = (dBottomRight_j)*a + b;
689 if (jtop >= dTopLeft_j && jtop <= dBottomRight_j) {
690 iP[n].
set_ij(dTopLeft_i, jtop);
693 if (jlow >= dTopLeft_j && jlow <= dBottomRight_j) {
694 iP[n].
set_ij(dBottomRight_i, jlow);
697 if (ileft >= dTopLeft_i && ileft <= dBottomRight_i && n < 2) {
698 iP[n].
set_ij(ileft, dTopLeft_j);
701 if (iright >= dTopLeft_i && iright <= dBottomRight_i && n < 2) {
702 iP[n].
set_ij(iright, dBottomRight_j);
709 if (!iP1In && !iP2In) {
714 if (sign ==
vpMath::sign(iP[0].get_j() - iP[1].get_j())) {
727 if (sign ==
vpMath::sign(iP[0].get_i() - iP[1].get_i())) {
741 if (fabs(iP[0].get_j() - iP2.
get_j()) > 5) {
756 if (fabs(iP[0].get_i() - iP2.
get_i()) > 5) {
778 if (fabs(iP[0].get_j() - iP1.
get_j()) > 5) {
793 if (fabs(iP[0].get_i() - iP1.
get_i()) > 5) {
818 if (iP.
get_i() < dTopLeft3D.get_i())
819 iP.
set_i(dTopLeft3D.get_i());
820 else if (iP.
get_i() > dTopLeft3D.get_i() + dHeight)
821 iP.
set_i(dTopLeft3D.get_i() + dHeight - 1);
822 if (iP.
get_j() < dTopLeft3D.get_j())
823 iP.
set_j(dTopLeft3D.get_j());
824 else if (iP.
get_j() > dTopLeft3D.get_j() + dWidth)
825 iP.
set_j(dTopLeft3D.get_j() + dWidth - 1);
831void vpPlotGraph::computeGraphParameters3D()
833 zoomx_3D = w_xsize / (xmax - xmin);
834 zoomy_3D = w_ysize / (ymax - ymin);
835 zoomz_3D = w_zsize / (zmax - zmin);
836 ptXorg = w_xval - zoomx_3D * xmax;
837 ptYorg = w_yval + zoomy_3D * ymin;
838 ptZorg = w_zval - zoomz_3D * zmax;
857 const unsigned int nparam = 6;
858 computeGraphParameters3D();
860 xdelt = (xmax - xmin) / nbDivisionx;
861 ydelt = (ymax - ymin) / nbDivisiony;
862 zdelt = (zmax - zmin) / nbDivisionz;
873 for (
unsigned int i = 0;
i < nparam; ++
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;
1109 else if (x < xmin) {
1118 else if (y < ymin) {
1127 else if (z < zmin) {
1134 if (changed || move(I, button)) {
1135 computeGraphParameters3D();
1140 pointPlot.
setWorldCoordinates(ptXorg + (zoomx_3D * x), ptYorg - (zoomy_3D * y), ptZorg + (zoomz_3D * z));
1141 pointPlot.
track(cMo);
1142 double u = 0.0,
v = 0.0;
1146 iP = iP + dTopLeft3D;
1148 if ((curveList + curveNb)->nbPoint) {
1149 if (check3Dline((curveList + curveNb)->lastPoint, iP))
1151 (curveList + curveNb)->thickness);
1153#if (defined VISP_HAVE_X11 || defined VISP_HAVE_GDI)
1159 if (iP.
get_i() <= (curveList + curveNb)->lastPoint.get_i()) {
1160 top = iP.
get_i() - 5;
1161 height_ = (curveList + curveNb)->lastPoint.get_i() - top + 10;
1164 top = (curveList + curveNb)->lastPoint.get_i() - 5;
1165 height_ = iP.
get_i() - top + 10;
1167 if (iP.
get_j() <= (curveList + curveNb)->lastPoint.get_j()) {
1168 left = iP.
get_j() - 5;
1169 width_ = (curveList + curveNb)->lastPoint.get_j() - left + 10;
1172 left = (curveList + curveNb)->lastPoint.get_j() - 5;
1173 width_ = iP.
get_j() - left + 10;
1178 (curveList + curveNb)->lastPoint = iP;
1179 (curveList + curveNb)->pointListx.push_back(x);
1180 (curveList + curveNb)->pointListy.push_back(y);
1181 (curveList + curveNb)->pointListz.push_back(z);
1182 (curveList + curveNb)->nbPoint++;
1184#if (!defined VISP_HAVE_X11 && defined FLUSH_ON_PLOT)
1195 for (
unsigned int i = 0;
i < curveNbr; ++
i) {
1196 std::list<double>::const_iterator it_ptListx = (curveList +
i)->pointListx.begin();
1197 std::list<double>::const_iterator it_ptListy = (curveList +
i)->pointListy.begin();
1198 std::list<double>::const_iterator it_ptListz = (curveList +
i)->pointListz.begin();
1203 while (k < (curveList + i)->nbPoint) {
1204 double x = *it_ptListx;
1205 double y = *it_ptListy;
1206 double z = *it_ptListz;
1207 pointPlot.
setWorldCoordinates(ptXorg + (zoomx_3D * x), ptYorg - (zoomy_3D * y), ptZorg + (zoomz_3D * z));
1208 pointPlot.
track(cMo);
1209 double u = 0.0,
v = 0.0;
1212 iP = iP + dTopLeft3D;
1216 if (check3Dline((curveList + i)->lastPoint, iP))
1221 (curveList +
i)->lastPoint = iP;
1232void vpPlotGraph::rescalez(
unsigned int side,
double extremity)
1236 zmin = (3 * extremity - zmax) / 2;
1239 zmax = (3 * extremity - zmin) / 2;
1243 zdelt = (zmax - zmin) /
static_cast<double>(nbDivisionz);
1252 bool changed =
false;
1256 if (std::fabs(displacement[2][3]) > std::numeric_limits<double>::epsilon())
1257 cMf = cMf * displacement;
1260 cMo = cMf * displacement * fMo;
1269 bool clicked =
false;
1270 bool clickedUp =
false;
1296 else if (clickedUp) {
1305 if (!(blockedr || blockedz)) {
1317 double diffi = iP.
get_i() - old_iPr.get_i();
1318 double diffj = iP.
get_j() - old_iPr.get_j();
1320 double anglei = diffi * 360 / width_;
1321 double anglej = diffj * 360 / width_;
1330 double diffi = iP.
get_i() - old_iPz.get_i();
1331 mov.buildFrom(0, 0, diffi * 0.01, 0, 0, 0);
1343#elif !defined(VISP_BUILD_SHARED_LIBS)
1345void 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)
Definition of the vpImage class member functions.
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)