44 #include <visp3/core/vpConfig.h>
50 #include <visp3/core/vpPolygon.h>
51 #include <visp3/mbt/vpMbtPolygon.h>
57 : index(-1), isvisible(false), isappearing(false), useLod(false), minLineLengthThresh(50.0),
58 minPolygonAreaThresh(2500.0), name(
""), hasOrientation(true)
63 :
vpPolygon3D(mbtp), index(mbtp.index), isvisible(mbtp.isvisible), isappearing(mbtp.isappearing), useLod(mbtp.useLod),
64 minLineLengthThresh(mbtp.minLineLengthThresh), minPolygonAreaThresh(mbtp.minPolygonAreaThresh), name(mbtp.name),
65 hasOrientation(mbtp.hasOrientation)
122 std::vector<vpImagePoint> roiImagePoints;
125 if (roiImagePoints.size() == 2) {
126 double x1 = roiImagePoints[0].get_u();
127 double y1 = roiImagePoints[0].get_v();
128 double x2 = roiImagePoints[1].get_u();
129 double y2 = roiImagePoints[1].get_v();
130 double length = std::sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
163 for (
unsigned int i = 0; i <
nbpt; i++) {
164 currentVertex =
p[i].
cP;
165 nextVertex =
p[(i + 1) %
nbpt].cP;
167 faceNormal[0] += (currentVertex[1] - nextVertex[1]) * (currentVertex[2] + nextVertex[2]);
168 faceNormal[1] += (currentVertex[2] - nextVertex[2]) * (currentVertex[0] + nextVertex[0]);
169 faceNormal[2] += (currentVertex[0] - nextVertex[0]) * (currentVertex[1] + nextVertex[1]);
175 for (
unsigned int i = 0; i <
nbpt; i += 1) {
190 if (angle < alpha || (modulo && (M_PI - angle) < alpha)) {
200 std::vector<vpImagePoint> roiImagePoints;
204 double area = roiPolygon.
getArea();
220 }
else if (modulo && (M_PI - angle) < alpha +
vpMath::rad(1)) {