VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Protected Types | Protected Attributes | Private Member Functions
makVrv::DtDynamicTerrainObject Class Reference

Abstract rotorWash object updater interface.

DtDynamicTerrainObjects are distributed objects, managed by DtTickableManager. They generate Dynamic Terrain World change requests (and removals) based on events. The network dynamic terrain object maintains a list of such events. There may be multiple dynamic terrain objects (so a single one doesn't get too large). This class is the local representation of one of those network objects.

Inheritance diagram for makVrv::DtDynamicTerrainObject:
Inheritance graph
[legend]

Classes

class  DynamicTerrainItem
 
class  DynamicTerrainLineItem
 
class  DynamicTerrainSphereItem
 

Public Member Functions

 DtDynamicTerrainObject (DtDe &de, DtUniqueID id)
 
 DtDynamicTerrainObject (const DtDynamicTerrainObject &copy)
 
DtDynamicTerrainObjectoperator= (const DtDynamicTerrainObject &copy)
 
virtual ~DtDynamicTerrainObject ()
 
virtual void update (DtTime tNow)
 
virtual bool needsUpdate (DtTime tNow)
 
DtUniqueID uniqueId () const
 
virtual void addSphericalGeometry (int index, const DtVector &location, double radius, double priority)
 
virtual void addLinearGeometry (int index, int vtx, const DtVector &location, double priority, int vertexCount)
 
virtual void changeSphericalGeometry (int index, const DtVector &location, double radius, double priority)
 
virtual void changeLinearGeometry (int index, int vtx, const DtVector &location, double priority, int vertexCount)
 
virtual void clearData (int index)
 
virtual void removeItem (int index)
 
virtual void addData (int index, const std::string &key, const std::string &value, double priority)
 
- Public Member Functions inherited from makVrv::DtTickable
virtual bool updateIfNeeded (DtTime tNow)
 
virtual ~DtTickable ()
 
virtual void setTickableEnabled (bool enabled)
 
virtual void setIsThreadSafe (bool safe)
 
virtual bool isThreadSafe () const
 
virtual void setTickableListState (TickableListState safeList)
 
virtual TickableListState tickableListState () const
 
virtual void setUpdatePeriod (unsigned int period)
 
virtual unsigned int updatePeriod () const
 
virtual bool adaptiveTickLodEnabled () const
 

Protected Types

typedef std::vector
< DynamicTerrainItem * > 
DynamicTerrainVector
 
typedef std::list< intDirtyList
 

Protected Member Functions

virtual void makeDirty (DynamicTerrainItem *item, int index)
 
virtual DynamicTerrainItemgetDynamicTerrainItem (int index)
 
- Protected Member Functions inherited from makVrv::DtTickable
 DtTickable (DtTickableManagerInterface *manager)
 
 DtTickable ()=delete
 
virtual void slot_managerAboutToBeDeleted ()
 

Protected Attributes

DtDemyDe
 
DtUniqueID myUniqueId
 
DynamicTerrainVector myDynamicTerrainVector
 
DirtyList myDirtyList
 
- Protected Attributes inherited from makVrv::DtTickable
DtTickableManagerInterfacemyManager
 
DtSignalConnectionManager myConnections
 
unsigned int myFrameCounter
 
unsigned int myFrameToUpdate
 
unsigned int myUpdatePeriod
 
unsigned int myTickableIndex
 
DtTime myLastUpdateTime
 
bool myIsThreadSafe
 
TickableListState myTickableListState
 

Private Member Functions

 DtDynamicTerrainObject ()
 

Additional Inherited Members

- Public Types inherited from makVrv::DtTickable
enum  TickableListState { TickableNotOnList, TickableOnMainList, TickableOnThreadSafeList }
 

Member Typedef Documentation

Type definition for a vector of DynamicTerrainItems.

typedef std::list<int> makVrv::DtDynamicTerrainObject::DirtyList
protected

Constructor & Destructor Documentation

makVrv::DtDynamicTerrainObject::DtDynamicTerrainObject ( DtDe de,
DtUniqueID  id 
)

CTOR.

Parameters
[in]deis the display engine.
[in]idis a unique identifier for this distributed object.
makVrv::DtDynamicTerrainObject::DtDynamicTerrainObject ( const DtDynamicTerrainObject copy)
makVrv::DtDynamicTerrainObject::DtDynamicTerrainObject ( )
private

No default CTOR.

virtual makVrv::DtDynamicTerrainObject::~DtDynamicTerrainObject ( )
virtual

Virtual DTOR.

Member Function Documentation

DtDynamicTerrainObject& makVrv::DtDynamicTerrainObject::operator= ( const DtDynamicTerrainObject copy)
virtual void makVrv::DtDynamicTerrainObject::update ( DtTime  tNow)
virtual

The update function called by DtTickableManager during update-ticks.

Parameters
[in]tNowis the current time-stamp.

Implements makVrv::DtTickable.

virtual bool makVrv::DtDynamicTerrainObject::needsUpdate ( DtTime  tNow)
virtual

The needsUpdate function called by DtTickableManager to verify if an update is required. If this function returns true, the DtTickableManager will then call update().

Parameters
[in]tNowis the current time-stamp.
Return values
trueif this object needs to be ticked.
falseotherwise. The base class checks handles period checks (for tickables that don't tick every frame. This derived version calls down to the base class and if true, checks the size of the DirtyList; returns true if their are items on the DirtyList

Reimplemented from makVrv::DtTickable.

DtUniqueID makVrv::DtDynamicTerrainObject::uniqueId ( ) const
inline

Returns the distributed object id of this dynamic terrain object.

virtual void makVrv::DtDynamicTerrainObject::addSphericalGeometry ( int  index,
const DtVector location,
double  radius,
double  priority 
)
virtual

Distributed Interface.

The class maintains a vector of geometries and associated data. By definition, once added, a geometry never goes away. This results in a DynamicTerrainSphereItem being created and added to our DynamicTerrainVector. A DtUniqueID is also generated for this item. If the spherical geometry already exists this just calls changeSphericalGeometry. If there is any other kind of geometry in the slot this call generates a warning and returns without making changes

virtual void makVrv::DtDynamicTerrainObject::addLinearGeometry ( int  index,
int  vtx,
const DtVector location,
double  priority,
int  vertexCount 
)
virtual

The class maintains a vector of geometries and associated data. By definition, once added, a geometry never goes away. This results in a DynamicTerrainLineItem being created and added to our DynamicTerrainVector. If the linear geometry already exists this just calls changeLinearGeometry. If there is any other kind of geometry in the slot this call generates a warning and returns without making changes vertexCount is the number of verticies in the full linear geometry.

virtual void makVrv::DtDynamicTerrainObject::changeSphericalGeometry ( int  index,
const DtVector location,
double  radius,
double  priority 
)
virtual

Change the spherical geometry in the specified slot. If the slot contains non-spherical geometry, this call is ignored.

virtual void makVrv::DtDynamicTerrainObject::changeLinearGeometry ( int  index,
int  vtx,
const DtVector location,
double  priority,
int  vertexCount 
)
virtual

Change the linear geometry in the specified slot. If the slot contains non-linear geometry, this call is ignored vertexCount is the number of verticies in the full linear geometry.

virtual void makVrv::DtDynamicTerrainObject::clearData ( int  index)
virtual

Clear the data associated with the geometry at the specified index. This does NOT put the item on the dirty list. If the intent is to remove the item at index, call removeItem(). This is used to make it easier to make data changes by clearing and then resetting the list (using addData(), which will add it to the dirty list)

virtual void makVrv::DtDynamicTerrainObject::removeItem ( int  index)
virtual

Remove a dynamic terrain item (such as a crater or persistent track) Note that we don't want to change the item/index relationship for the other items; so myDynamicTerrainVector[index]; amd its possible this same item might be recreated if this was deleted and then a scenario rewind / replay happens. So we create a remove request to the dynamic terrain system, 0 the data vector, but otherwise keep the item around. Items with 0 length data will be ignored.

virtual void makVrv::DtDynamicTerrainObject::addData ( int  index,
const std::string &  key,
const std::string &  value,
double  priority 
)
virtual

Add a data pair the the specified geometry.

virtual void makVrv::DtDynamicTerrainObject::makeDirty ( DynamicTerrainItem item,
int  index 
)
protectedvirtual

Helper functions.

Check to see if the item is already on the DirtyList; if not, put it there, otherwise do nothing

virtual DynamicTerrainItem* makVrv::DtDynamicTerrainObject::getDynamicTerrainItem ( int  index)
protectedvirtual

Get the dynamic terrain item at ths specified index if it exists. Generates a warning and returns 0 if it does not.

Member Data Documentation

DtDe& makVrv::DtDynamicTerrainObject::myDe
protected

The display engine.

DtUniqueID makVrv::DtDynamicTerrainObject::myUniqueId
protected

This distributed object's unique identifier.

DynamicTerrainVector makVrv::DtDynamicTerrainObject::myDynamicTerrainVector
protected
DirtyList makVrv::DtDynamicTerrainObject::myDirtyList
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)