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

#include <Ieee80211CanvasVisualizer.h>

Inheritance diagram for inet::visualizer::Ieee80211CanvasVisualizer:
inet::visualizer::Ieee80211VisualizerBase inet::visualizer::VisualizerBase

Classes

class  Ieee80211CanvasVisualization
 

Protected Member Functions

virtual void initialize (int stage) override
 
virtual Ieee80211VisualizationcreateIeee80211Visualization (cModule *networkNode, InterfaceEntry *interfaceEntry, std::string ssid) override
 
virtual void addIeee80211Visualization (const Ieee80211Visualization *ieee80211Visualization) override
 
virtual void removeIeee80211Visualization (const Ieee80211Visualization *ieee80211Visualization) override
 
- Protected Member Functions inherited from inet::visualizer::Ieee80211VisualizerBase
virtual void handleParameterChange (const char *name) override
 
virtual void subscribe ()
 
virtual void unsubscribe ()
 
virtual const Ieee80211VisualizationgetIeee80211Visualization (cModule *networkNode, InterfaceEntry *interfaceEntry)
 
virtual void removeAllIeee80211Visualizations ()
 
- 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
 
NetworkNodeCanvasVisualizernetworkNodeVisualizer = nullptr
 
- Protected Attributes inherited from inet::visualizer::Ieee80211VisualizerBase
std::map< std::pair< int, int >, const Ieee80211Visualization * > ieee80211Visualizations
 
bool displayAssociations = false
 
NetworkNodeFilter nodeFilter
 
InterfaceFilter interfaceFilter
 
const char * icon = nullptr
 
ColorSet iconColorSet
 
cFigure::Font labelFont
 
cFigure::Color labelColor
 
Displacement displacementHint
 
double displacementPriority
 
- Protected Attributes inherited from inet::visualizer::VisualizerBase
cModule * visualizerTargetModule = nullptr
 
const char * tags = nullptr
 

Additional Inherited Members

- Public Member Functions inherited from inet::visualizer::Ieee80211VisualizerBase
virtual ~Ieee80211VisualizerBase ()
 
virtual void receiveSignal (cComponent *source, simsignal_t signal, cObject *object, cObject *details) override
 

Member Function Documentation

void inet::visualizer::Ieee80211CanvasVisualizer::addIeee80211Visualization ( const Ieee80211Visualization ieee80211Visualization)
overrideprotectedvirtual

Reimplemented from inet::visualizer::Ieee80211VisualizerBase.

68 {
70  auto ieee80211CanvasVisualization = static_cast<const Ieee80211CanvasVisualization *>(ieee80211Visualization);
71  ieee80211CanvasVisualization->networkNodeVisualization->addAnnotation(ieee80211CanvasVisualization->figure, ieee80211CanvasVisualization->figure->getBounds().getSize(), displacementHint, displacementPriority);
72 }
Displacement displacementHint
Definition: Ieee80211VisualizerBase.h:55
double displacementPriority
Definition: Ieee80211VisualizerBase.h:56
virtual void addIeee80211Visualization(const Ieee80211Visualization *ieee80211Visualization)
Definition: Ieee80211VisualizerBase.cc:101
Ieee80211VisualizerBase::Ieee80211Visualization * inet::visualizer::Ieee80211CanvasVisualizer::createIeee80211Visualization ( cModule *  networkNode,
InterfaceEntry interfaceEntry,
std::string  ssid 
)
overrideprotectedvirtual

Implements inet::visualizer::Ieee80211VisualizerBase.

45 {
46  std::hash<std::string> hasher;
47  std::string icon(this->icon);
48  auto labeledIconFigure = new LabeledIconFigure("ieee80211Association");
49  labeledIconFigure->setTags((std::string("ieee80211_association ") + tags).c_str());
50  labeledIconFigure->setAssociatedObject(interfaceEntry);
51  labeledIconFigure->setZIndex(zIndex);
52  auto iconFigure = labeledIconFigure->getIconFigure();
53  iconFigure->setTooltip("This icon represents an IEEE 802.11 association");
54  iconFigure->setImageName(icon.substr(0, icon.find_first_of(".")).c_str());
55  iconFigure->setTintColor(iconColorSet.getColor(hasher(ssid)));
56  iconFigure->setTintAmount(1);
57  auto labelFigure = labeledIconFigure->getLabelFigure();
58  labelFigure->setTooltip("This label represents the SSID of an IEEE 802.11 association");
59  labelFigure->setFont(labelFont);
60  labelFigure->setColor(labelColor);
61  labelFigure->setText(ssid.c_str());
62  labelFigure->setPosition(iconFigure->getBounds().getSize() / 2);
63  auto networkNodeVisualization = networkNodeVisualizer->getNetworkNodeVisualization(networkNode);
64  return new Ieee80211CanvasVisualization(networkNodeVisualization, labeledIconFigure, networkNode->getId(), interfaceEntry->getInterfaceId());
65 }
const char * tags
Definition: VisualizerBase.h:32
double zIndex
Definition: Ieee80211CanvasVisualizer.h:42
ColorSet iconColorSet
Definition: Ieee80211VisualizerBase.h:52
virtual NetworkNodeCanvasVisualization * getNetworkNodeVisualization(const cModule *networkNode) const
Definition: NetworkNodeCanvasVisualizer.cc:63
NetworkNodeCanvasVisualizer * networkNodeVisualizer
Definition: Ieee80211CanvasVisualizer.h:43
cFigure::Font labelFont
Definition: Ieee80211VisualizerBase.h:53
const char * icon
Definition: Ieee80211VisualizerBase.h:51
cFigure::Color getColor(int index) const
Definition: ColorSet.cc:43
cFigure::Color labelColor
Definition: Ieee80211VisualizerBase.h:54
void inet::visualizer::Ieee80211CanvasVisualizer::initialize ( int  stage)
overrideprotectedvirtual

Reimplemented from inet::visualizer::Ieee80211VisualizerBase.

35 {
37  if (!hasGUI()) return;
38  if (stage == INITSTAGE_LOCAL) {
39  zIndex = par("zIndex");
40  networkNodeVisualizer = getModuleFromPar<NetworkNodeCanvasVisualizer>(par("networkNodeVisualizerModule"), this);
41  }
42 }
double zIndex
Definition: Ieee80211CanvasVisualizer.h:42
Local initializations.
Definition: InitStages.h:35
virtual void initialize(int stage) override
Definition: Ieee80211VisualizerBase.cc:43
NetworkNodeCanvasVisualizer * networkNodeVisualizer
Definition: Ieee80211CanvasVisualizer.h:43
void inet::visualizer::Ieee80211CanvasVisualizer::removeIeee80211Visualization ( const Ieee80211Visualization ieee80211Visualization)
overrideprotectedvirtual

Reimplemented from inet::visualizer::Ieee80211VisualizerBase.

75 {
77  auto ieee80211CanvasVisualization = static_cast<const Ieee80211CanvasVisualization *>(ieee80211Visualization);
78  ieee80211CanvasVisualization->networkNodeVisualization->removeAnnotation(ieee80211CanvasVisualization->figure);
79 }
virtual void removeIeee80211Visualization(const Ieee80211Visualization *ieee80211Visualization)
Definition: Ieee80211VisualizerBase.cc:107

Member Data Documentation

NetworkNodeCanvasVisualizer* inet::visualizer::Ieee80211CanvasVisualizer::networkNodeVisualizer = nullptr
protected
double inet::visualizer::Ieee80211CanvasVisualizer::zIndex = NaN
protected

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