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

#include <SceneVisualizerBase.h>

Inheritance diagram for inet::visualizer::SceneVisualizerBase:
inet::visualizer::VisualizerBase inet::visualizer::SceneCanvasVisualizer inet::visualizer::SceneOsgVisualizerBase inet::visualizer::SceneOsgEarthVisualizer inet::visualizer::SceneOsgVisualizer

Protected Member Functions

virtual void initialize (int stage) override
 
virtual Box getPlaygroundBounds ()
 
- 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
 

Additional Inherited Members

- Protected Attributes inherited from inet::visualizer::VisualizerBase
cModule * visualizerTargetModule = nullptr
 
const char * tags = nullptr
 

Member Function Documentation

Box inet::visualizer::SceneVisualizerBase::getPlaygroundBounds ( )
protectedvirtual
38 {
39  auto physicalEnvironment = getModuleFromPar<IPhysicalEnvironment>(par("physicalEnvironmentModule"), this, false);
40  Coord playgroundMin = Coord::ZERO;
41  Coord playgroundMax = Coord::ZERO;
42  if (physicalEnvironment == nullptr) {
43  auto displayString = visualizerTargetModule->getDisplayString();
44  auto width = atof(displayString.getTagArg("bgb", 0));
45  auto height = atof(displayString.getTagArg("bgb", 1));
46  playgroundMin = Coord(0.0, 0.0, 0.0);
47  playgroundMax = Coord(width, height, 0.0);
48  }
49  else {
50  playgroundMin = physicalEnvironment->getSpaceMin();
51  playgroundMax = physicalEnvironment->getSpaceMax();
52  }
53  for (int id = 0; id <= getSimulation()->getLastComponentId(); id++) {
54  auto mobility = dynamic_cast<IMobility *>(getSimulation()->getModule(id));
55  if (mobility != nullptr) {
56  playgroundMin = playgroundMin.min(mobility->getConstraintAreaMin());
57  playgroundMax = playgroundMax.max(mobility->getConstraintAreaMax());
58  }
59  }
60  return Box(playgroundMin, playgroundMax);
61 }
cModule * visualizerTargetModule
Definition: VisualizerBase.h:31
static const Coord ZERO
Definition: Coord.h:41
void inet::visualizer::SceneVisualizerBase::initialize ( int  stage)
overrideprotectedvirtual

Reimplemented from inet::visualizer::VisualizerBase.

Reimplemented in inet::visualizer::SceneCanvasVisualizer.

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

30 {
32  if (!hasGUI()) return;
33  if (stage == INITSTAGE_LOCAL)
34  visualizerTargetModule->getCanvas()->setAnimationSpeed(par("animationSpeed"), this);
35 }
virtual void initialize(int stage) override
Definition: VisualizerBase.cc:29
Local initializations.
Definition: InitStages.h:35
cModule * visualizerTargetModule
Definition: VisualizerBase.h:31

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