INET Framework for OMNeT++/OMNEST
inet::osg::TopLevelScene Class Reference

This class is used for the topmost node in the OSG node hierarchy. More...

#include <OsgScene.h>

Inheritance diagram for inet::osg::TopLevelScene:

Public Member Functions

virtual SimulationScenegetSimulationScene ()
 

Static Public Member Functions

static SimulationScenegetSimulationScene (cModule *module)
 

Protected Attributes

SimulationScenesimulationScene = nullptr
 

Detailed Description

This class is used for the topmost node in the OSG node hierarchy.

The scene of the OSG canvas is a TopLevelScene instance.

Member Function Documentation

◆ getSimulationScene() [1/2]

SimulationScene * inet::osg::TopLevelScene::getSimulationScene ( )
virtual

◆ getSimulationScene() [2/2]

SimulationScene * inet::osg::TopLevelScene::getSimulationScene ( cModule *  module)
static
35 {
36  auto osgCanvas = module->getOsgCanvas();
37  auto topLevelScene = dynamic_cast<TopLevelScene *>(osgCanvas->getScene());
38  if (topLevelScene != nullptr)
39  return topLevelScene->getSimulationScene();
40  else {
41  auto simulationScene = new SimulationScene();
42  topLevelScene = new TopLevelScene();
43  topLevelScene->addChild(simulationScene);
44  // NOTE: these are the default values when there's no SceneOsgVisualizer
45  osgCanvas->setScene(topLevelScene);
46  osgCanvas->setClearColor(cFigure::Color("#FFFFFF"));
47  osgCanvas->setZNear(0.1);
48  osgCanvas->setZFar(100000);
49  osgCanvas->setCameraManipulatorType(cOsgCanvas::CAM_TERRAIN);
50  return simulationScene;
51  }
52 }

Member Data Documentation

◆ simulationScene

SimulationScene* inet::osg::TopLevelScene::simulationScene = nullptr
protected

Referenced by getSimulationScene().


The documentation for this class was generated from the following files:
inet::DiffservUtil::Color
Color
Definition: DiffservUtil.h:17
inet::osg::TopLevelScene::simulationScene
SimulationScene * simulationScene
Definition: OsgScene.h:52