111 if (mobilityVisualization ==
nullptr) {
113 auto module =
const_cast<cModule *
>(
dynamic_cast<const cModule *
>(mobility));
116 cArcFigure *orientationFigure =
nullptr;
118 auto rectangle = getSimulation()->getEnvir()->getSubmoduleBounds(visualRepresentation);
119 int radius = rectangle.getSize().getLength() * 1.25 / 2;
120 orientationFigure =
new cArcFigure(
"orientation");
121 orientationFigure->setTags((std::string(
"orientation ") +
tags).c_str());
122 orientationFigure->setTooltip(
"This arc represents the current orientation of the mobility model");
123 orientationFigure->setZIndex(
zIndex);
124 orientationFigure->setBounds(cFigure::Rectangle(-radius, -radius, 2 * radius, 2 * radius));
128 visualization->addFigure(orientationFigure);
130 cLineFigure *velocityFigure =
nullptr;
132 velocityFigure =
new cLineFigure(
"velocity");
133 velocityFigure->setTags((std::string(
"velocity ") +
tags).c_str());
134 velocityFigure->setTooltip(
"This arrow represents the current velocity of the mobility model");
135 velocityFigure->setZIndex(
zIndex);
136 velocityFigure->setVisible(
false);
137 velocityFigure->setEndArrowhead(cFigure::ARROW_SIMPLE);
141 visualization->addFigure(velocityFigure);
143 TrailFigure *trailFigure =
nullptr;
145 trailFigure =
new TrailFigure(
trailLength,
true,
"movement trail");
146 trailFigure->setTags((std::string(
"movement_trail recent_history ") +
tags).c_str());
147 trailFigure->setZIndex(
zIndex);
148 canvas->addFigure(trailFigure);
150 mobilityVisualization =
new MobilityCanvasVisualization(visualization, visualRepresentation, orientationFigure, velocityFigure, trailFigure, mobility);
153 return mobilityVisualization;
double velocityLineWidth
Definition: MobilityVisualizerBase.h:57
int trailLength
Definition: MobilityVisualizerBase.h:64
const char * tags
Definition: VisualizerBase.h:32
cFigure::Color velocityLineColor
Definition: MobilityVisualizerBase.h:55
bool displayVelocities
Definition: MobilityVisualizerBase.h:53
cFigure::LineStyle velocityLineStyle
Definition: MobilityVisualizerBase.h:56
double zIndex
Definition: MobilityCanvasVisualizer.h:47
virtual NetworkNodeCanvasVisualization * getNetworkNodeVisualization(const cModule *networkNode) const
Definition: NetworkNodeCanvasVisualizer.cc:63
virtual cModule * findVisualRepresentation(cModule *module) const
Definition: MobilityCanvasVisualizer.cc:82
bool displayMovementTrails
Definition: MobilityVisualizerBase.h:59
virtual void setMobilityVisualization(const IMobility *mobility, MobilityCanvasVisualization *entry)
Definition: MobilityCanvasVisualizer.cc:98
cModule * getContainingNode(const cModule *from)
Find the node containing the given module.
Definition: ModuleAccess.cc:65
double orientationLineWidth
Definition: MobilityVisualizerBase.h:51
cFigure::LineStyle orientationLineStyle
Definition: MobilityVisualizerBase.h:50
cModule * visualizerTargetModule
Definition: VisualizerBase.h:31
virtual MobilityCanvasVisualization * getMobilityVisualization(const IMobility *mobility) const
Definition: MobilityCanvasVisualizer.cc:89
cFigure::Color orientationLineColor
Definition: MobilityVisualizerBase.h:49
bool displayOrientations
Definition: MobilityVisualizerBase.h:47
NetworkNodeCanvasVisualizer * networkNodeVisualizer
Definition: MobilityCanvasVisualizer.h:49