|
ADTF Display Toolbox
|
Base class for managing a scene of objects. More...
#include <baseobjectscene.h>
Public Member Functions | |
| cBaseObjectScene (const tChar *strName="") | |
| Default constructor. | |
| virtual | ~cBaseObjectScene () |
| Destructor. | |
| virtual const tChar * | GetName () |
| Returns the name of the scene. | |
| virtual tResult | AddObject (cBaseObject *pObj) |
| Use this to add a new object to the scene. | |
| virtual tResult | RemoveObject (tUInt32 nId) |
| Removes an object from the scene. | |
| virtual tResult | GetObject (tUInt32 nId, cBaseObject **ppObj) |
| Retrieves an object. | |
| virtual tResult | RemoveInvalid () |
| Removes all objects that have not been updated since the last call. | |
| virtual tResult | SetPosition (tFloat64 fPosX, tFloat64 fPosY, tFloat64 fPosZ) |
| Sets the position of the scene. | |
| virtual tResult | SetRotation (tFloat64 fRotX, tFloat64 fRotY, tFloat64 fRotZ) |
| Sets the rotation (attitude) of the scene. | |
Protected Attributes | |
| std::string | m_strName |
| std::map< tUInt32, osg::ref_ptr< cBaseObject > > | m_oObjects |
Base class for managing a scene of objects.
Bring newest version of base class into scope.
Use AddObject to add an object to the scene. Existing objects can be retrieved using the GetObject method. The baasic idea is that you first check if an object already exists using the GetObject method and in this case manipulate the existing object. If it does not exist create a new one using new and add it.
The cBaseObject class has a property that tells if the object has been updated. RemoveInvalid will remove all objects whos IsUpdated method returns false and call the Reset method of all others. The updated property will be set in the Update method.
This class is best used in combination with cBaseObjectMixin.
Definition at line 40 of file baseobjectscene.h.
|
inline |
Default constructor.
| strName | [in] The name of the scene. |
Definition at line 48 of file baseobjectscene.h.
|
inlinevirtual |
Destructor.
Definition at line 55 of file baseobjectscene.h.
|
inlinevirtual |
Use this to add a new object to the scene.
| pObj | [in] A pointer to the new object. |
Definition at line 73 of file baseobjectscene.h.
|
inlinevirtual |
Returns the name of the scene.
Definition at line 63 of file baseobjectscene.h.
|
inlinevirtual |
Retrieves an object.
| nId | [in] The id of the object to retreive. |
| ppObj | [out] The pointer to the object. |
Definition at line 120 of file baseobjectscene.h.
|
inlinevirtual |
Removes all objects that have not been updated since the last call.
Definition at line 140 of file baseobjectscene.h.
|
inlinevirtual |
Removes an object from the scene.
| nId | [in] The id of the object to remove. |
Definition at line 95 of file baseobjectscene.h.
|
inlinevirtual |
Sets the position of the scene.
This translation will be applied to all objects.
| fPosX | [in] The x-coordinate. |
| fPosY | [in] The y-coordinate. |
| fPosZ | [in] The z-coordinate. |
Definition at line 174 of file baseobjectscene.h.
|
inlinevirtual |
Sets the rotation (attitude) of the scene.
This rotation will be applied to all objects.
| fRotX | [in] The x-rotation values (Rad). |
| fRotY | [in] The y-rotation values (Rad). |
| fRotZ | [in] The z-rotation values (Rad). |
Definition at line 188 of file baseobjectscene.h.
|
protected |
Definition at line 196 of file baseobjectscene.h.
|
protected |
Definition at line 195 of file baseobjectscene.h.