9#include <osg/PositionAttitudeTransform>
65 return m_strName.c_str();
76 auto oObj = m_oObjects.find(pObj->
GetId());
77 if (oObj != m_oObjects.end())
79 RETURN_ERROR(ERR_DEVICE_IN_USE);
85 m_oObjects[pObj->
GetId()] = pObj;
98 auto oObj = m_oObjects.find(nId);
99 if (oObj != m_oObjects.end())
102 removeChild(oObj->second.get());
104 m_oObjects.erase(oObj);
108 RETURN_ERROR(ERR_NOT_FOUND);
123 auto oObj = m_oObjects.find(nId);
124 if (oObj != m_oObjects.end())
126 *ppObj = oObj->second.get();
130 RETURN_ERROR(ERR_NOT_FOUND);
142 tUInt nChildren = getNumChildren();
143 for (tUInt nChild = 0; nChild < nChildren; ++nChild)
155 m_oObjects.erase(m_oObjects.find(pObj->
GetId()));
174 virtual tResult
SetPosition(tFloat64 fPosX, tFloat64 fPosY, tFloat64 fPosZ)
176 setPosition(osg::Vec3(fPosX, fPosY, fPosZ));
188 virtual tResult
SetRotation(tFloat64 fRotX, tFloat64 fRotY, tFloat64 fRotZ)
190 setAttitude(osg::Quat(fRotX, osg::Vec3(1, 0, 0), fRotY, osg::Vec3(0, 1, 0), fRotZ, osg::Vec3(0, 0, 1)));
195 std::string m_strName;
196 std::map<tUInt32, osg::ref_ptr<cBaseObject>> m_oObjects;
202using endor::cBaseObjectScene;
Copyright © Audi Electronics Venture GmbH.
cBaseObjectScene(const tChar *strName="")
Default constructor.
Base class for objects that can be managed with cBaseObjectScene.
tBool IsUpdated()
Returns whether or not this object has been updated since the last Reset call.
tResult Reset()
Resets the updated property to false.
tUInt32 GetId()
Returns the id of the object.
virtual tResult SetRotation(tFloat64 fRotX, tFloat64 fRotY, tFloat64 fRotZ)
Sets the rotation (attitude) of the scene.
virtual tResult RemoveObject(tUInt32 nId)
Removes an object from the scene.
virtual tResult AddObject(cBaseObject *pObj)
Use this to add a new object to the scene.
virtual ~cBaseObjectScene()
Destructor.
virtual tResult RemoveInvalid()
Removes all objects that have not been updated since the last call.
virtual const tChar * GetName()
Returns the name of the scene.
virtual tResult SetPosition(tFloat64 fPosX, tFloat64 fPosY, tFloat64 fPosZ)
Sets the position of the scene.
cBaseObjectScene(const tChar *strName="")
Default constructor.
virtual tResult GetObject(tUInt32 nId, cBaseObject **ppObj)
Retrieves an object.
Namespace for functionality provided by the Mixin Library.
Namespace for functionality provided by the Display Toolbox.