56 auto object = obstaclePenetratedEvent->object;
57 auto intersection1 = obstaclePenetratedEvent->intersection1;
58 auto intersection2 = obstaclePenetratedEvent->intersection2;
59 auto normal1 = obstaclePenetratedEvent->normal1;
60 auto normal2 = obstaclePenetratedEvent->normal2;
61 auto loss = obstaclePenetratedEvent->loss;
62 const RotationMatrix rotation(object->getOrientation().toEulerAngles());
63 const Coord& position =
object->getPosition();
64 const Coord rotatedIntersection1 = rotation.rotateVector(intersection1);
65 const Coord rotatedIntersection2 = rotation.rotateVector(intersection2);
66 double intersectionDistance = intersection2.distance(intersection1);
67 LabeledLineFigure *intersectionLine =
nullptr;
69 intersectionLine =
new LabeledLineFigure(
"intersection");
70 intersectionLine->setTags((std::string(
"obstacle_loss ") +
tags).c_str());
71 intersectionLine->setTooltip(
"This line represents the intersection of a propagating signal and an obstructing physical object.");
74 auto lineFigure = intersectionLine->getLineFigure();
78 lineFigure->setZoomLineWidth(
false);
79 auto labelFigure = intersectionLine->getLabelFigure();
82 labelFigure->setText(tmp);
84 cLineFigure *faceNormal1Line =
nullptr;
85 cLineFigure *faceNormal2Line =
nullptr;
87 Coord normalVisualization1 = normal1 / normal1.length() * intersectionDistance / 10;
88 Coord normalVisualization2 = normal2 / normal2.length() * intersectionDistance / 10;
89 faceNormal1Line =
new cLineFigure(
"normal1");
90 faceNormal1Line->setTags((std::string(
"obstacle_loss face_normal_vector ") +
tags).c_str());
91 faceNormal1Line->setTooltip(
"This line represents the face normal vector at the intersection of a propagating signal and an obstructing physical object.");
97 faceNormal1Line->setZoomLineWidth(
false);
98 faceNormal2Line =
new cLineFigure(
"normal2");
99 faceNormal2Line->setTags((std::string(
"obstacle_loss face_normal_vector ") +
tags).c_str());
100 faceNormal2Line->setTooltip(
"This line represents the face normal vector at the intersection of a propagating signal and an obstructing physical object.");
106 faceNormal2Line->setZoomLineWidth(
false);
108 return new ObstacleLossCanvasVisualization(intersectionLine, faceNormal1Line, faceNormal2Line);