ADTF_DISPLAY_TOOLBOX
3.8.0 (ADTF 3.14.3)
|
Base class for managing a scene of objects. More...
Public Member Functions | |
cBaseObjectScene (const tChar *strName="") | |
Default constructor. More... | |
virtual | ~cBaseObjectScene () |
Destructor. | |
virtual const tChar * | GetName () |
Returns the name of the scene. More... | |
virtual tResult | AddObject (cBaseObject *pObj) |
Use this to add a new object to the scene. More... | |
virtual tResult | RemoveObject (tUInt32 nId) |
Removes an object from the scene. More... | |
virtual tResult | GetObject (tUInt32 nId, cBaseObject **ppObj) |
Retrieves an object. More... | |
virtual tResult | RemoveInvalid () |
Removes all objects that have not been updated since the last call. More... | |
virtual tResult | SetPosition (tFloat64 fPosX, tFloat64 fPosY, tFloat64 fPosZ) |
Sets the position of the scene. More... | |
virtual tResult | SetRotation (tFloat64 fRotX, tFloat64 fRotY, tFloat64 fRotZ) |
Sets the rotation (attitude) of the scene. More... | |
Protected Attributes | |
std::unique_ptr< cImplementation > | m_pImplementation |
D-Pointer implementation. | |
Base class for managing a scene of objects.
Use cBaseObjectScene::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 cBaseObject::IsUpdated method returns false and call the cBaseObject::Reset method of all others. The updated property will be set in the cBaseObject::Update method.
This class is best used in combination with cBaseObjectMixin.
You can find the implementation of this class in src/3dscenedisplay/mixinlib/baseobjectscene.cpp
Definition at line 42 of file baseobjectscene.h.
cBaseObjectScene | ( | const tChar * | strName = "" | ) |
Default constructor.
strName | [in] The name of the scene. |
|
virtual |
Use this to add a new object to the scene.
pObj | [in] A pointer to the new object. |
|
virtual |
Returns the name of the scene.
|
virtual |
Retrieves an object.
nId | [in] The id of the object to retreive. |
ppObj | [out] The pointer to the object. |
|
virtual |
Removes all objects that have not been updated since the last call.
|
virtual |
Removes an object from the scene.
nId | [in] The id of the object to remove. |
|
virtual |
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. |
|
virtual |
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). |