INET Framework for OMNeT++/OMNEST
inet::visualizer::NetworkConnectionCanvasVisualizer Class Reference

#include <NetworkConnectionCanvasVisualizer.h>

Inheritance diagram for inet::visualizer::NetworkConnectionCanvasVisualizer:
inet::visualizer::NetworkConnectionVisualizerBase inet::visualizer::VisualizerBase

Protected Member Functions

virtual void initialize (int stage) override
 
void createNetworkConnectionVisualization (cModule *startNetworkNode, cModule *endNetworkNode) override
 
- Protected Member Functions inherited from inet::visualizer::NetworkConnectionVisualizerBase
virtual void handleParameterChange (const char *name) override
 
- Protected Member Functions inherited from inet::visualizer::VisualizerBase
virtual int numInitStages () const override
 
virtual Coord getPosition (const cModule *networkNode) const
 
virtual Coord getContactPosition (const cModule *networkNode, const Coord &fromPosition, const char *contactMode, double contactSpacing) const
 
virtual InterfaceEntrygetInterfaceEntry (cModule *networkNode, cModule *module) const
 

Protected Attributes

double zIndex = NaN
 
const CanvasProjectioncanvasProjection = nullptr
 
- Protected Attributes inherited from inet::visualizer::NetworkConnectionVisualizerBase
NetworkNodeFilter nodeFilter
 
cFigure::Color lineColor
 
cFigure::LineStyle lineStyle = cFigure::LINE_SOLID
 
double lineWidth = NaN
 
- Protected Attributes inherited from inet::visualizer::VisualizerBase
cModule * visualizerTargetModule = nullptr
 
const char * tags = nullptr
 

Member Function Documentation

void inet::visualizer::NetworkConnectionCanvasVisualizer::createNetworkConnectionVisualization ( cModule *  startNetworkNode,
cModule *  endNetworkNode 
)
overrideprotectedvirtual

Implements inet::visualizer::NetworkConnectionVisualizerBase.

38 {
39  auto lineFigure = new cLineFigure("connection");
40  lineFigure->setLineColor(lineColor);
41  lineFigure->setLineStyle(lineStyle);
42  lineFigure->setLineWidth(lineWidth);
43  lineFigure->setStart(canvasProjection->computeCanvasPoint(getPosition(startNetworkNode)));
44  lineFigure->setEnd(canvasProjection->computeCanvasPoint(getPosition(endNetworkNode)));
45  lineFigure->setEndArrowhead(cFigure::ARROW_BARBED);
46  lineFigure->setZIndex(zIndex);
47  visualizerTargetModule->getCanvas()->addFigure(lineFigure);
48 }
const CanvasProjection * canvasProjection
Definition: NetworkConnectionCanvasVisualizer.h:32
double zIndex
Definition: NetworkConnectionCanvasVisualizer.h:31
virtual Coord getPosition(const cModule *networkNode) const
Definition: VisualizerBase.cc:42
cFigure::Color lineColor
Definition: NetworkConnectionVisualizerBase.h:32
cFigure::LineStyle lineStyle
Definition: NetworkConnectionVisualizerBase.h:33
cModule * visualizerTargetModule
Definition: VisualizerBase.h:31
double lineWidth
Definition: NetworkConnectionVisualizerBase.h:34
cFigure::Point computeCanvasPoint(const Coord &point) const
Definition: CanvasProjection.cc:32
void inet::visualizer::NetworkConnectionCanvasVisualizer::initialize ( int  stage)
overrideprotectedvirtual

Reimplemented from inet::visualizer::NetworkConnectionVisualizerBase.

28 {
30  if (!hasGUI()) return;
31  if (stage == INITSTAGE_LOCAL) {
32  zIndex = par("zIndex");
34  }
35 }
const CanvasProjection * canvasProjection
Definition: NetworkConnectionCanvasVisualizer.h:32
double zIndex
Definition: NetworkConnectionCanvasVisualizer.h:31
virtual void initialize(int stage) override
Definition: NetworkConnectionVisualizerBase.cc:25
Local initializations.
Definition: InitStages.h:35
cModule * visualizerTargetModule
Definition: VisualizerBase.h:31
static const CanvasProjection * getCanvasProjection(const cCanvas *canvas)
Definition: CanvasProjection.cc:38

Member Data Documentation

const CanvasProjection* inet::visualizer::NetworkConnectionCanvasVisualizer::canvasProjection = nullptr
protected
double inet::visualizer::NetworkConnectionCanvasVisualizer::zIndex = NaN
protected

The documentation for this class was generated from the following files: