64 auto object = obstaclePenetratedEvent->object;
65 auto intersection1 = obstaclePenetratedEvent->intersection1;
66 auto intersection2 = obstaclePenetratedEvent->intersection2;
67 auto normal1 = obstaclePenetratedEvent->normal1;
68 auto normal2 = obstaclePenetratedEvent->normal2;
69 auto loss = obstaclePenetratedEvent->loss;
70 const Rotation rotation(object->getOrientation());
71 const Coord& position =
object->getPosition();
72 const Coord rotatedIntersection1 = rotation.rotateVectorClockwise(intersection1);
73 const Coord rotatedIntersection2 = rotation.rotateVectorClockwise(intersection2);
74 double intersectionDistance = intersection2.distance(intersection1);
75 LabeledLineFigure *intersectionLine =
nullptr;
77 intersectionLine =
new LabeledLineFigure(
"intersection");
78 intersectionLine->setTags((std::string(
"obstacle_loss ") +
tags).c_str());
79 intersectionLine->setTooltip(
"This line represents the intersection of a propagating signal and an obstructing physical object.");
82 auto lineFigure = intersectionLine->getLineFigure();
86 lineFigure->setZoomLineWidth(
false);
87 auto labelFigure = intersectionLine->getLabelFigure();
90 labelFigure->setText(tmp);
92 cLineFigure *faceNormal1Line =
nullptr;
93 cLineFigure *faceNormal2Line =
nullptr;
95 Coord normalVisualization1 = normal1 / normal1.length() * intersectionDistance / 10;
96 Coord normalVisualization2 = normal2 / normal2.length() * intersectionDistance / 10;
97 faceNormal1Line =
new cLineFigure(
"normal1");
98 faceNormal1Line->setTags((std::string(
"obstacle_loss face_normal_vector ") +
tags).c_str());
99 faceNormal1Line->setTooltip(
"This line represents the face normal vector at the intersection of a propagating signal and an obstructing physical object.");
105 faceNormal1Line->setZoomLineWidth(
false);
106 faceNormal2Line =
new cLineFigure(
"normal2");
107 faceNormal2Line->setTags((std::string(
"obstacle_loss face_normal_vector ") +
tags).c_str());
108 faceNormal2Line->setTooltip(
"This line represents the face normal vector at the intersection of a propagating signal and an obstructing physical object.");
114 faceNormal2Line->setZoomLineWidth(
false);
116 return new ObstacleLossCanvasVisualization(intersectionLine, faceNormal1Line, faceNormal2Line);
const char * tags
Definition: VisualizerBase.h:32
double intersectionLineWidth
Definition: TracingObstacleLossVisualizerBase.h:50
cFigure::Color intersectionLineColor
Definition: TracingObstacleLossVisualizerBase.h:48
double fraction2dB(double fraction)
Convert a fraction value to dB.
Definition: INETMath.h:171
cFigure::LineStyle intersectionLineStyle
Definition: TracingObstacleLossVisualizerBase.h:49
bool displayFaceNormalVectors
Definition: TracingObstacleLossVisualizerBase.h:51
cFigure::LineStyle faceNormalLineStyle
Definition: TracingObstacleLossVisualizerBase.h:53
double faceNormalLineWidth
Definition: TracingObstacleLossVisualizerBase.h:54
const CanvasProjection * canvasProjection
The 2D projection used on the canvas.
Definition: TracingObstacleLossCanvasVisualizer.h:56
cFigure::Point computeCanvasPoint(const Coord &point) const
Definition: CanvasProjection.cc:32
bool displayIntersections
Definition: TracingObstacleLossVisualizerBase.h:47
cFigure::Color faceNormalLineColor
Definition: TracingObstacleLossVisualizerBase.h:52