VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes
DtFireManager Class Reference

The DtFireManager class exists to centralize the processing of fire interactions. More...

Public Types

typedef bool(* DtFireProcessingFunction )(const DtFireContext &fireContext, void *usr)
typedef std::map< DtVrfObject
*, DtGlobalObjectDesignator > 
DtRegisteredVrfObjects
typedef std::map< DtVrfObject
*, DtFireProcessingFunction
DtFireCallbackFuncs
typedef std::map< DtVrfObject
*, void * > 
DtFireCallbackObjects

Public Member Functions

 DtFireManager (DtSimManager &simManager)
 Constructs the fire manager.
virtual ~DtFireManager ()
 The destructor.
virtual bool init ()
 Initializes the fire manager.
virtual bool reinitialize ()
 Same as init, but intended to be called after the object has already been created.
virtual bool registerFireTarget (DtVrfObject &entity, DtGlobalObjectDesignator entityId, void *callbackObject, DtFireProcessingFunction func)
 Entities that wish to receive fire notifications (technically, it is usually the under-fire sensors which register for the entity) call this function.
virtual bool registerFireTargetForRemoval (DtVrfObject &entity)
 Registers the entity pointer for later removal from the fire targets containers.
virtual bool unRegisterFireTarget (DtVrfObject &entity)
 Removes the entity from the fire manager's container of fire targets.
virtual void sendFireInteraction (DtFireInteraction &fire)
 Send the fully initialized fire interaction.

Protected Member Functions

bool testInvariant () const
 The Fire Manager's invariant:
virtual void processDetonation (const DtDetonationInteraction &fire)
 Process the detonation interaction by properly creating a detonation context for the interaction, and then notifying all the appropriate entities.
virtual void processFire (const DtFireInteraction &fire)
 Process the fire interaction by properly creating a fire context for the interaction, and then notifying all the appropriate entities.
virtual void determineUnderFire (const DtDetonationInteraction &detonation)
 This is used for determining if the entity is under fire.
virtual void determineUnderFire (const DtFireInteraction &fireInter)
 This is used for determining if the entity is under fire.
virtual void removeQueuedFireTargets ()
 Unregisters all fire targets that have been registered to be removed.
 DtFireManager (const DtFireManager &orig)
 Not defined! copy constructor.
DtFireManageroperator= (const DtFireManager &other)
 assignment operator

Static Protected Member Functions

static void detonationCallback (DtDetonationInteraction *fireInter, void *usr)
 The callback that processes detonation interactions for the purpose of determining under fire status.
static void fireCallback (DtFireInteraction *fireInter, void *usr)
 Same as detonationCallback, but for DtFireInteractions.

Protected Attributes

DtRegisteredVrfObjects myFireTargets
 A container of vrfObjects that have registered for fire interaction processing.
DtFireCallbackFuncs myFireCallbacks
 The callback functions registered by the vrfObjects.
DtFireCallbackObjects myFireCallbackObjects
 To ensure that the callback has all the data necessary, this callback object is registered by the vrfObject and is supplied along with the detonation context to the registered detonation callback.
std::vector< DtVrfObject * > myFireTargetsToBeRemoved
 This container contains all the fire targets to be removed.
DtSimManagermySimManager

Detailed Description

The DtFireManager class exists to centralize the processing of fire interactions.

Components register with the manager, providing a pointer to a DtVrfObject as well as the object's global designator, and a under-fire determination function to call when the fire affects the registered vrfobject. The detonation manager determines the entity or entities the detonation affects, and notifies them and only them through the supplied callback functions.

Member Typedef Documentation

typedef bool(* DtFireManager::DtFireProcessingFunction)(const DtFireContext &fireContext, void *usr)
typedef std::map<DtVrfObject*, DtGlobalObjectDesignator> DtFireManager::DtRegisteredVrfObjects

Constructor & Destructor Documentation

DtFireManager::DtFireManager ( DtSimManager simManager)

Constructs the fire manager.

Parameters
simManagerA pointer to the simulation manager for the simulation.
virtual DtFireManager::~DtFireManager ( )
virtual

The destructor.

Removes the DtFireInteraction callback from the exercise connection.

DtFireManager::DtFireManager ( const DtFireManager orig)
protected

Not defined! copy constructor.

Member Function Documentation

virtual bool DtFireManager::init ( )
virtual

Initializes the fire manager.

  • removes any registered callbacks from the exercise connection
  • clears all managed lists
  • registers for fire interactions callbacks with the exercise connection
Returns
a boolean signifying success or failure.
virtual bool DtFireManager::reinitialize ( )
virtual

Same as init, but intended to be called after the object has already been created.

Removes the registered callbacks from the connection manager, and then calls init() to finish initialization.

Returns
a boolean representing success or failure in reseting the object to initial state.
See Also
init
virtual bool DtFireManager::registerFireTarget ( DtVrfObject entity,
DtGlobalObjectDesignator  entityId,
void *  callbackObject,
DtFireProcessingFunction  func 
)
virtual

Entities that wish to receive fire notifications (technically, it is usually the under-fire sensors which register for the entity) call this function.

By supplying the entity, the entity ID, a callback function and a pointer to the expected callback object (usually the sensor component itself, as a void*, this manager can then notify the appropriate sensor when fire interactions occur so that they can determine under-fire status.

virtual bool DtFireManager::registerFireTargetForRemoval ( DtVrfObject entity)
virtual

Registers the entity pointer for later removal from the fire targets containers.

All elements registered to be removed will be removed the next time it determines under fire status.

Detailed description: Because sensors are not ticked when the entity is destroyed, they will only discover they should be unregistered when callbacks are called. But removing the registered entity then is problematic, so they register to be removed later.

virtual bool DtFireManager::unRegisterFireTarget ( DtVrfObject entity)
virtual

Removes the entity from the fire manager's container of fire targets.

Parameters
entitythe address of the entity to be unregistered.
Note
If the entity pointer is NULL, then nothing is unregistered.
Returns
a boolean indicating the success or failure of the unregistration.
virtual void DtFireManager::sendFireInteraction ( DtFireInteraction &  fire)
virtual

Send the fully initialized fire interaction.

bool DtFireManager::testInvariant ( ) const
protected

The Fire Manager's invariant:

  • The simulation manager must have a valid terrain database.
  • The terrain database must have a valid coordinate system.
Returns
A boolean signifying whether or not the variant is still valid.
static void DtFireManager::detonationCallback ( DtDetonationInteraction fireInter,
void *  usr 
)
staticprotected

The callback that processes detonation interactions for the purpose of determining under fire status.

Calls processDetonation to actually process the detonation interaction.

Parameters
detInterthe detonation interaction to process
usra void pointer to a DtFireManager. As this is a static function, this is provided when this function is registered in order to be able to properly handle the callback.
See Also
init
processDetonation
virtual void DtFireManager::processDetonation ( const DtDetonationInteraction fire)
protectedvirtual

Process the detonation interaction by properly creating a detonation context for the interaction, and then notifying all the appropriate entities.

For entity impact and proximate fire interactions, only the specified entity is notified. For fire and ground proximate interactions, all entities within range are notified. For ground impacts, entities in range are only notified if the munition was a missile.

See Also
getDirectFireSurfaceAndAngleOfIncidence
processIndirectFire
static void DtFireManager::fireCallback ( DtFireInteraction *  fireInter,
void *  usr 
)
staticprotected

Same as detonationCallback, but for DtFireInteractions.

See Also
init
processFire
virtual void DtFireManager::processFire ( const DtFireInteraction &  fire)
protectedvirtual

Process the fire interaction by properly creating a fire context for the interaction, and then notifying all the appropriate entities.

For entity impact and proximate fire interactions, only the specified entity is notified. For fire and ground proximate interactions, all entities within range are notified. For ground impacts, entities in range are only notified if the munition was a missile.

See Also
getDirectFireSurfaceAndAngleOfIncidence
processIndirectFire
virtual void DtFireManager::determineUnderFire ( const DtDetonationInteraction detonation)
protectedvirtual

This is used for determining if the entity is under fire.

virtual void DtFireManager::determineUnderFire ( const DtFireInteraction &  fireInter)
protectedvirtual

This is used for determining if the entity is under fire.

virtual void DtFireManager::removeQueuedFireTargets ( )
protectedvirtual

Unregisters all fire targets that have been registered to be removed.

DtFireManager& DtFireManager::operator= ( const DtFireManager other)
protected

assignment operator

Member Data Documentation

DtRegisteredVrfObjects DtFireManager::myFireTargets
protected

A container of vrfObjects that have registered for fire interaction processing.

DtFireCallbackFuncs DtFireManager::myFireCallbacks
protected

The callback functions registered by the vrfObjects.

When a fire interaction occurs, the callback associated with the appropriate entity is used.

DtFireCallbackObjects DtFireManager::myFireCallbackObjects
protected

To ensure that the callback has all the data necessary, this callback object is registered by the vrfObject and is supplied along with the detonation context to the registered detonation callback.

std::vector<DtVrfObject*> DtFireManager::myFireTargetsToBeRemoved
protected

This container contains all the fire targets to be removed.

DtSimManager& DtFireManager::mySimManager
protected

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

Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)