INET Framework for OMNeT++/OMNEST
inet::visualizer::NetworkConnectionVisualizerBase Class Referenceabstract

#include <NetworkConnectionVisualizerBase.h>

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

Protected Member Functions

virtual void initialize (int stage) override
 
virtual void handleParameterChange (const char *name) override
 
virtual void createNetworkConnectionVisualization (cModule *startNetworkNode, cModule *endNetworkNode)=0
 
- 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

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

virtual void inet::visualizer::NetworkConnectionVisualizerBase::createNetworkConnectionVisualization ( cModule *  startNetworkNode,
cModule *  endNetworkNode 
)
protectedpure virtual
void inet::visualizer::NetworkConnectionVisualizerBase::handleParameterChange ( const char *  name)
overrideprotectedvirtual
51 {
52  if (name != nullptr) {
53  if (!strcmp(name, "nodeFilter"))
54  nodeFilter.setPattern(par("nodeFilter"));
55  // TODO:
56  }
57 }
void setPattern(const char *pattern)
Definition: NetworkNodeFilter.cc:24
NetworkNodeFilter nodeFilter
Definition: NetworkConnectionVisualizerBase.h:31
void inet::visualizer::NetworkConnectionVisualizerBase::initialize ( int  stage)
overrideprotectedvirtual

Reimplemented from inet::visualizer::VisualizerBase.

Reimplemented in inet::visualizer::NetworkConnectionOsgVisualizer, and inet::visualizer::NetworkConnectionCanvasVisualizer.

Referenced by inet::visualizer::NetworkConnectionCanvasVisualizer::initialize().

26 {
28  if (!hasGUI()) return;
29  if (stage == INITSTAGE_LOCAL) {
30  nodeFilter.setPattern(par("nodeFilter"));
31  lineColor = cFigure::Color(par("lineColor"));
32  lineStyle = cFigure::parseLineStyle(par("lineStyle"));
33  lineWidth = par("lineWidth");
34  }
35  else if (stage == INITSTAGE_LAST) {
36  for (cModule::SubmoduleIterator it(getSystemModule()); !it.end(); it++) {
37  auto networkNode = *it;
38  if (isNetworkNode(networkNode) && nodeFilter.matches(networkNode)) {
39  for (cModule::GateIterator gt(networkNode); !gt.end(); gt++) {
40  auto gate = *gt;
41  auto startNetworkNode = getContainingNode(gate->getPathStartGate()->getOwnerModule());
42  auto endNetworkNode = getContainingNode(gate->getPathEndGate()->getOwnerModule());
43  createNetworkConnectionVisualization(startNetworkNode, endNetworkNode);
44  }
45  }
46  }
47  }
48 }
virtual void createNetworkConnectionVisualization(cModule *startNetworkNode, cModule *endNetworkNode)=0
bool matches(const cModule *module) const
Definition: NetworkNodeFilter.cc:29
void setPattern(const char *pattern)
Definition: NetworkNodeFilter.cc:24
bool isNetworkNode(const cModule *mod)
Returns true if the given module is a network node, i.e.
Definition: ModuleAccess.cc:28
Operations that no other initializations can depend on, e.g.
Definition: InitStages.h:111
virtual void initialize(int stage) override
Definition: VisualizerBase.cc:29
cFigure::Color lineColor
Definition: NetworkConnectionVisualizerBase.h:32
NetworkNodeFilter nodeFilter
Definition: NetworkConnectionVisualizerBase.h:31
Local initializations.
Definition: InitStages.h:35
cModule * getContainingNode(const cModule *from)
Find the node containing the given module.
Definition: ModuleAccess.cc:65
Color
Definition: DiffservUtil.h:30
cFigure::LineStyle lineStyle
Definition: NetworkConnectionVisualizerBase.h:33
double lineWidth
Definition: NetworkConnectionVisualizerBase.h:34

Member Data Documentation

cFigure::Color inet::visualizer::NetworkConnectionVisualizerBase::lineColor
protected
cFigure::LineStyle inet::visualizer::NetworkConnectionVisualizerBase::lineStyle = cFigure::LINE_SOLID
protected
double inet::visualizer::NetworkConnectionVisualizerBase::lineWidth = NaN
protected
NetworkNodeFilter inet::visualizer::NetworkConnectionVisualizerBase::nodeFilter
protected

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