ADTF_DISPLAY_TOOLBOX  3.8.0 (ADTF 3.14.3)
cBaseObjectScene

Base class for managing a scene of objects. More...

Inheritance diagram for cBaseObjectScene:
[legend]

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ cBaseObjectScene()

cBaseObjectScene ( const tChar *  strName = "")

Default constructor.

Parameters
strName[in] The name of the scene.

Member Function Documentation

◆ AddObject()

virtual tResult AddObject ( cBaseObject pObj)
virtual

Use this to add a new object to the scene.

Parameters
pObj[in] A pointer to the new object.
Returns
Standard result.

◆ GetName()

virtual const tChar* GetName ( )
virtual

Returns the name of the scene.

Returns
The name of the scene.

◆ GetObject()

virtual tResult GetObject ( tUInt32  nId,
cBaseObject **  ppObj 
)
virtual

Retrieves an object.

Parameters
nId[in] The id of the object to retreive.
ppObj[out] The pointer to the object.
Returns
Standard result.

◆ RemoveInvalid()

virtual tResult RemoveInvalid ( )
virtual

Removes all objects that have not been updated since the last call.

Returns
Standard result.

◆ RemoveObject()

virtual tResult RemoveObject ( tUInt32  nId)
virtual

Removes an object from the scene.

Parameters
nId[in] The id of the object to remove.
Returns
Standard result.

◆ SetPosition()

virtual tResult SetPosition ( tFloat64  fPosX,
tFloat64  fPosY,
tFloat64  fPosZ 
)
virtual

Sets the position of the scene.

This translation will be applied to all objects.

Parameters
fPosX[in] The x-coordinate.
fPosY[in] The y-coordinate.
fPosZ[in] The z-coordinate.
Returns
Standard result.

◆ SetRotation()

virtual tResult SetRotation ( tFloat64  fRotX,
tFloat64  fRotY,
tFloat64  fRotZ 
)
virtual

Sets the rotation (attitude) of the scene.

This rotation will be applied to all objects.

Parameters
fRotX[in] The x-rotation values (Rad).
fRotY[in] The y-rotation values (Rad).
fRotZ[in] The z-rotation values (Rad).
Returns
Standard result.