16#ifndef __OMNETPP_OSGUTIL_H
17#define __OMNETPP_OSGUTIL_H
56class cObjectOsgNode :
public osg::Group
63 virtual ~cObjectOsgNode() {}
66 cObjectOsgNode() : componentId(0), object(
nullptr) {}
67 cObjectOsgNode(
const cObject *
object) : componentId(0), object(
nullptr) { setObject(
object);}
68 cObjectOsgNode(
const cObjectOsgNode& node,
const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
69 META_Node(osg, cObjectOsgNode);
71 const cObject *getObject()
const;
72 void setObject(
const cObject *obj);
75inline cObjectOsgNode::cObjectOsgNode(
const cObjectOsgNode& node,
const osg::CopyOp& copyop) : Group(node, copyop)
77 componentId = node.componentId;
81inline const cObject *cObjectOsgNode::getObject()
const
86inline void cObjectOsgNode::setObject(
const cObject *obj)
90 if (
const cComponent *component =
dynamic_cast<const cComponent*
>(obj)) {
91 componentId = component->getId();
An osg::Group for defining correspondence of a 3D object to an OMNeT++ object.
Definition osgutil.h:57
cObject is a lightweight class which serves as the root of the OMNeT++ class hierarchy....
Definition cobject.h:93
cComponent * getComponent(int id) const
Definition csimulation.h:236
cSimulation * getSimulation()
Returns the currently active simulation, or nullptr if there is none.
Definition csimulation.h:623