VR-Forces 4.10 Class Documentation
 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. More...

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

Classes

class  DynamicTerrainItem
 Local class used only by DtDynamicTerrainObject for representing geometry and data. More...
 
class  DynamicTerrainLineItem
 Specialized DynamicTerrainItem to represent items with linear geometry. More...
 
class  DynamicTerrainSphereItem
 Specialized DynamicTerrainItem to represent items with spherical geometry. More...
 

Public Member Functions

 DtDynamicTerrainObject (DtDe &de, DtUniqueID id)
 CTOR. More...
 
 DtDynamicTerrainObject (const DtDynamicTerrainObject &copy)
 
DtDynamicTerrainObjectoperator= (const DtDynamicTerrainObject &copy)
 
virtual ~DtDynamicTerrainObject ()
 Virtual DTOR. More...
 
virtual void update (DtTime tNow)
 The update function called by DtTickableManager during update-ticks. More...
 
virtual bool needsUpdate (DtTime tNow)
 The needsUpdate function called by DtTickableManager to verify if an update is required. More...
 
DtUniqueID uniqueId () const
 Returns the distributed object id of this dynamic terrain object. More...
 
virtual void addSphericalGeometry (int index, const DtVector &location, double radius, double priority)
 Distributed Interface. More...
 
virtual void addLinearGeometry (int index, int vtx, const DtVector &location, double priority, int vertexCount)
 The class maintains a vector of geometries and associated data. More...
 
virtual void changeSphericalGeometry (int index, const DtVector &location, double radius, double priority)
 Change the spherical geometry in the specified slot. More...
 
virtual void changeLinearGeometry (int index, int vtx, const DtVector &location, double priority, int vertexCount)
 Change the linear geometry in the specified slot. More...
 
virtual void clearData (int index)
 Clear the data associated with the geometry at the specified index. More...
 
virtual void removeItem (int index)
 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. More...
 
virtual void addData (int index, const std::string &key, const std::string &value, double priority)
 Add a data pair the the specified geometry. More...
 
- Public Member Functions inherited from makVrv::DtTickable
virtual bool updateIfNeeded (DtTime tNow)
 Calls needsUpdate(), and then calls update() if needsUpdate() is true. More...
 
virtual ~DtTickable ()
 Virtual DTOR. More...
 
virtual void setIsThreadSafe (bool safe)
 Get/set whether this tickable can be updated in parallel with other tickables. More...
 
virtual bool isThreadSafe () const
 
virtual void setTickableListState (TickableListState safeList)
 Track which tickable list (if any) this tickable is on Since the tickable constructor puts ALL tickables on the main (unThreadSafe) to start we need a way to check which list a tickable is on (and this way we can request removals from the correct list instead of having to call DtTickableManager::removeTickableObject(), which tries both lists). More...
 
virtual TickableListState tickableListState () const
 
virtual void setUpdatePeriod (unsigned int period)
 Specify how often (in # of frames) this tickable should call update. More...
 
virtual unsigned int updatePeriod () const
 
virtual bool lodSystemEnabled () const
 is the update LOD system enabled, overridden by subclasses More...
 

Protected Types

typedef std::vector
< DynamicTerrainItem * > 
DynamicTerrainVector
 Type definition for a vector of DynamicTerrainItems. More...
 
typedef std::list< intDirtyList
 

Protected Member Functions

virtual void makeDirty (DynamicTerrainItem *item, int index)
 Helper functions. More...
 
virtual DynamicTerrainItemgetDynamicTerrainItem (int index)
 Get the dynamic terrain item at ths specified index if it exists. More...
 
- Protected Member Functions inherited from makVrv::DtTickable
 DtTickable (DtTickableManagerInterface *manager)
 CTOR. More...
 
 DtTickable ()
 Unimplemented default CTOR. More...
 
virtual void slot_managerAboutToBeDeleted ()
 

Protected Attributes

DtDemyDe
 The display engine. More...
 
DtUniqueID myUniqueId
 This distributed object's unique identifier. More...
 
DynamicTerrainVector myDynamicTerrainVector
 
DirtyList myDirtyList
 
- Protected Attributes inherited from makVrv::DtTickable
DtTickableManagerInterfacemyManager
 Pointer to manager for removal during destruction. More...
 
DtSignalConnectionManager myConnections
 
unsigned int myFrameCounter
 
unsigned int myFrameToUpdate
 
unsigned int myUpdatePeriod
 
DtTime myLastUpdateTime
 
bool myIsThreadSafe
 
TickableListState myTickableListState
 

Private Member Functions

 DtDynamicTerrainObject ()
 No default CTOR. More...
 

Additional Inherited Members

- Public Types inherited from makVrv::DtTickable
enum  TickableListState { TickableNotOnList, TickableOnMainList, TickableOnThreadSafeList }
 Enumeration used to indicate which DtTickableManager's tickable list the tickable is on, if any. More...
 

Detailed Description

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.

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 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)