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

The "this" version is the own-ship object. More...

Inheritance diagram for DtScriptOwnshipObject:
Inheritance graph
[legend]

Public Member Functions

 DtScriptOwnshipObject (const DtUUID &name, DtVrfObject *const vrfObject)
 DtScriptOwnshipObject (const DtUUID &name, DtSimManager *simManager, DtVrfObject *const vrfobject)
 DtScriptOwnshipObject (const DtScriptOwnshipObject &orig)
 ~DtScriptOwnshipObject ()
void setLocation3D (const DtLocation3D &newloc)
 Script API functions.
void setHeading (const double heading)
 Script API functions.
virtual std::list< std::string > getResourceNames (void) const
 Script API functions.
virtual double getResourceAmounts (const std::string &resourceName, double *fullAmount) const
 Returns the current amount as the return value for the supplied resource name.
virtual void depleteResource (const std::string &resourceName, double amount)
 Deplete the resource by the current amount, not going below zero.
virtual void replenishResource (const std::string &resourceName, double amount)
 Replenishes the resource amount, not going above full.
virtual std::string getMunitionType (const std::string &resourceName)
 Returns the entity type of the munition resource.
virtual bool addResource (const std::string &resourceType, const std::string &resourceName, double currentAmount, double fullAmount)
 Adds a new resource given the type, name (including any systems it should be in) current amount and full amount.
virtual void updateStateAndParameterProperties ()
 If this is a psuedo aggregate will update state and parameter properties in the state repository given the composition of the leaf nodes and their current values.
virtual void removeResource (const std::string &resourceName)
 Removes the resource from the supplied system.
virtual boost::shared_ptr
< DtScriptComponentSystem
lookupSystem (const std::string &systemName)
 Gets a script component system from the system name.
virtual std::list< std::string > getSystemNames ()
 Gets a list of all system names for this entity.
virtual bool isUnderFire () const
 True if under fire, as defined in the object state repository.
virtual int suppressionLevel () const
 Returns the suppression level: an integer from 0 to 3.
virtual std::list
< DtScriptVrfObject
getObservedHostileContacts (void)
 It gets the list of contacts for the entity and filters out all but known hostile objects that were detected by sensors (vs.
virtual std::list
< DtScriptVrfObject
getAllHostileContacts (void)
 It gets the list of contacts for the entity and filters out all but known hostile objects.
virtual std::list
< DtScriptVrfObject
getAllContacts (void)
 It gets the list of contacts and returns it.
virtual bool registerDetonationInterest (double range, const std::string &munitionType)
 It registers interest in any detonation that occurs within the specified range of the object with the specified munition type.
virtual bool getLastDetonation (std::string &munitionType, DtLocation3D &location)
 If interest in detonations has previously been registered, this function will return the munition type and location of the detonation.
virtual void setDestroyed (bool destroyed)
 Sets the damage state of this entity to be destroyed if true, or not damaged if false.
virtual std::string getRulesOfEngagement ()
 Returns the current rules of engagement of this entity.
virtual void setRulesOfEngagement (const std::string &rule)
 Sets the rules of engagement of this entity.
virtual std::list< std::string > embeddedEntityNames ()
 Returns the complete list of Embedded Entity names available to this object.
virtual std::list< std::string > embeddedEntitiesOfType (std::string typeString)
 Returns a list of Embedded Entity names available to this object matching the given typeString, where typeString is a string representation of the seven digit DIS enumeration.
virtual std::list< std::string > embeddedEntitiesCapableOf (std::string taskSetName)
 Returns a list of Embedded Entity names available to this object that are capable of the given task/set, where taskSetName is the string identifier of any task or set.
virtual DtScriptVrfObject simObjectByEmbeddedEntityName (std::string eeName)
 Returns the DtScriptVrfObject corresponding to the given Embedded Entity name.
virtual std::string embeddedEntityStatus (std::string eeName)
 Returns the deployment status of the Embedded Entity with the given name.
virtual double normalizedSensorSignature (const DtScriptVrfObject &targetEntity, std::string domain)
 This function determines if the given target entity is detectable by the ownship entity in the given domain.
- Public Member Functions inherited from DtScriptVrfObject
 DtScriptVrfObject (const DtUUID &name, DtVrfObject *const vrfObject)
 DtScriptVrfObject (const DtUUID &name, DtSimManager *simManager, DtVrfObject *const vrfObject)
 DtScriptVrfObject (const DtScriptVrfObject &orig)
DtScriptVrfObjectoperator= (const DtScriptVrfObject &orig)
 ~DtScriptVrfObject ()
bool operator== (const DtScriptVrfObject &orig)
virtual double getHeightAboveTerrain () const
 Gets the height above terrain, which is just ownship altitude - terrain altitude.
virtual bool hasLosToObject (const DtScriptVrfObject &target, bool &dataAvailable) const
 Check LOS to a target entity through terrain and objects, except for ownship object and target object.
virtual bool isPointInside (const DtLocation3D &point) const
 Determine if the given point is inside the polygon described by the vertices (footprint) of this object.
virtual bool hasLosToLocation (DtLocation3D &targetLoc, bool &dataAvailable) const
 Check LOS to a location through terrain and objects, except for ownship object.
virtual std::string getEntityType () const
 Return the entity type.
virtual bool isAggregate () const
 Returns whether the object is an aggregate, using the object state repository definition of isAggregate().
virtual bool isPseudoAggregate () const
 Returns whether the object is an aggregate, using the object state repository definition of isAggregate() and the object is in a DtDisaggregated state.
virtual std::string getEchelonLevel () const
 Returns the echelon level as a string.
virtual std::string getForceType () const
 Returns entity force.
virtual int getForceEnumeration () const
 Returns entity force enumeration (integer)
virtual std::string getDamageState () const
 Returns the current damage state as: none slight moderate destroyed.
virtual unsigned getLifeformPosture () const
 Returns the DIS enumerated value for the current lifeform posture.
virtual unsigned getAppearance () const
 Returns the current appearance bits of the entity.
virtual bool isDestroyed () const
 Returns whether or not this entity is destroyed.
virtual bool isEmbarked () const
 Returns whether or not this item is embarked on any other item.
virtual void attachToParent (DtScriptVrfObject &) const
 Given an object which is a parent, attach to it (immedate embark)
virtual bool isOnTopOf (DtScriptVrfObject &) const
 Will return true if this entity is near the top of the specified entity given the specified distance (in meters).
virtual bool isOnTopOfWithDistance (DtScriptVrfObject &, double) const
virtual DtScriptVrfObject getEmbarkedOn () const
 Parent this object is embarked on.
virtual std::list
< DtScriptVrfObject
getEmbarkedObjects (void) const
virtual std::list
< DtScriptVrfObject
getSubordinates (void) const
 Returns a list of the immediate subordinates of this aggregate.
virtual std::list
< DtScriptVrfObject
getAllSubordinates (void) const
 Returns a list of all leaf (lowest level) nodes (subordinates) of this aggregate.
virtual std::list
< DtScriptVrfObject
getCapableSubordinates (void) const
virtual std::list< DtLocation3DgetLocations3D (void) const
virtual std::string getName () const
virtual std::string getLabel () const
virtual void setLabel (const std::string &)
virtual std::string getExtendedLabel (int) const
virtual void setExtendedLabel (int, const std::string &)
virtual std::string getGlobalId () const
virtual std::string getObjectId () const
virtual double getHeading () const
virtual double getDraft () const
void terrainSurfaceDebug ()
 For debugging the terrain surface(s) at the entity's location.
void deleteObject ()
 Deletes object from simulation.
bool isDeleted () const
 Returns true if the object has been deleted from the simulation.
virtual bool isValid () const
virtual bool isLocal () const
 Returns true if the object is local to the back-end the script is running on.
virtual DtVectorOffset3D getBoundingVolume (DtVectorOffset3D &offset) const
 Returns the bounding volume and the bounding volume offset.
virtual std::string getNbcDamage (int &dmgPerSec, int &moppLvl) const
 Returns the damage type, damage per second, and the MOPP level required to protect against the NBC contaminated area.
virtual std::string getNbcAgent () const
 Returns the agent type of the NBC area.
virtual bool isBreached () const
 Returns true if this is an engineering object which has been breached.
virtual DtLocation3D getClosestPointToLocation2D (const DtLocation3D &location, double &distance) const
 Finds the closest point on the object's geometry to the given location.
virtual DtLocation3D getIntersectionPointWithLine2D (const DtLocation3D &point1, const DtLocation3D &point2, bool &hasIntersection) const
 Calculates the point where the line defined by the two points intersects with the object.
virtual bool isActive () const
 Returns true if this is an environmental and it is active. All others will be considered active.
virtual void setSimManager (DtSimManager *simManager)
 Script API functions above. ////////////////////////////////////!
virtual DtString objectType () const
 Should return the string name of this object.
DtString serialize ()
 Inherited from DtAsciiSerializable. Returns a string serialized version of this class.
bool deserialize (const DtString &data)
 Inherited from DtAsciiSerializable.
DtVrfObjectvrfObject () const
 For use by C++ side methods.
void testValid () const
 Makes sure the object is valid. If not, throws exception.
virtual DtLocation3D getLocation3D () const
 Script API functions.
virtual double getSpeed () const
 Returns the objects current speed in meters/second.
virtual std::string getUUID () const
 Returns the UUID of this object.
virtual DtVector3D getDirection3D () const
 Vector info about entity.
virtual DtVector3D getVelocity3D () const
 Velocity of entity, meters/sec.
bool hasStateProperty (const std::string &propertyName)
 Checks to see if the property exists.
bool hasParameterProperty (const std::string &propertyName)
 Checks to see if the property exists.
- Public Member Functions inherited from DtAsciiSerializable
 DtAsciiSerializable ()
 The implementer of this interface should be sure to create a creator function to create an empty object that returns a pointer to this interface.
 DtAsciiSerializable (const DtAsciiSerializable &orig)
virtual ~DtAsciiSerializable ()
virtual std::string objectTypeC () const
 Returns a std::string version of the objectType.
virtual void init (void *userData)
 This function is called right after the object is constructed during the deserialization process, but before deserialize() is called.

Protected Attributes

std::string myLastDetonationMunition
 The munition type of the last detonation.
DtLocation3D myLastDetonationLocation
 The location of the last detonation.
std::map< std::string,
DtScriptComponentSystem * > 
myScriptComponentSystems
 List of systems which we have previously looked up, by name.
- Protected Attributes inherited from DtScriptVrfObject
DtRwUUID myUUID
DtSimManagermySimManager
DtVrfObjectDeletionHandle myObjectDeletionHandle
static bool processDetonation (const DtDetonationContext &detonationContext, void *usr)
 Script API functions above.
bool processDetonation (const DtDetonationContext &detonationContext)
 Script API functions above.

Additional Inherited Members

- Static Public Member Functions inherited from DtScriptVrfObject
static DtAsciiSerializablecreator ()
 Inherited from DtAsciiSerializable. Returns a new object of this type with default values.
- Static Public Member Functions inherited from DtObjectDebugger< DtScriptOwnshipObject >
static DtObjectCounter::CounterType ObjectCount ()
static const DtObjectContainer * ObjectContainer ()
- Protected Member Functions inherited from DtObjectDebugger< DtAsciiSerializable >
 DtObjectDebugger ()
 DtObjectDebugger (const DtObjectDebugger &)
 ~DtObjectDebugger ()
- Protected Member Functions inherited from DtObjectDebugger< DtScriptVrfObject >
 DtObjectDebugger ()
 DtObjectDebugger (const DtObjectDebugger &)
 ~DtObjectDebugger ()
- Protected Member Functions inherited from DtObjectDebugger< DtScriptOwnshipObject >
 DtObjectDebugger ()
 DtObjectDebugger (const DtObjectDebugger &)
 ~DtObjectDebugger ()

Detailed Description

The "this" version is the own-ship object.

It is separated to allow special functions for the ownship that are not available for other objects.

Constructor & Destructor Documentation

DtScriptOwnshipObject::DtScriptOwnshipObject ( const DtUUID name,
DtVrfObject *const  vrfObject 
)
DtScriptOwnshipObject::DtScriptOwnshipObject ( const DtUUID name,
DtSimManager simManager,
DtVrfObject *const  vrfobject 
)
DtScriptOwnshipObject::DtScriptOwnshipObject ( const DtScriptOwnshipObject orig)
DtScriptOwnshipObject::~DtScriptOwnshipObject ( )

Member Function Documentation

void DtScriptOwnshipObject::setLocation3D ( const DtLocation3D newloc)

Script API functions.

////////////////////////////////////!

void DtScriptOwnshipObject::setHeading ( const double  heading)

Script API functions.

////////////////////////////////////!

virtual std::list<std::string> DtScriptOwnshipObject::getResourceNames ( void  ) const
virtual

Script API functions.

////////////////////////////////////!

virtual double DtScriptOwnshipObject::getResourceAmounts ( const std::string &  resourceName,
double *  fullAmount 
) const
virtual

Returns the current amount as the return value for the supplied resource name.

Note that in the Lua interface, fullAmount is a pure_out_value, meaning that the parameter is not included as a function argument, but is provided as a second return value of the function. E.g. use: curAmount, fullAmount = getResourceAmounts(resourceName)

virtual void DtScriptOwnshipObject::depleteResource ( const std::string &  resourceName,
double  amount 
)
virtual

Deplete the resource by the current amount, not going below zero.

virtual void DtScriptOwnshipObject::replenishResource ( const std::string &  resourceName,
double  amount 
)
virtual

Replenishes the resource amount, not going above full.

virtual std::string DtScriptOwnshipObject::getMunitionType ( const std::string &  resourceName)
virtual

Returns the entity type of the munition resource.

If it is not a munition type the empty string is returned

virtual bool DtScriptOwnshipObject::addResource ( const std::string &  resourceType,
const std::string &  resourceName,
double  currentAmount,
double  fullAmount 
)
virtual

Adds a new resource given the type, name (including any systems it should be in) current amount and full amount.

If the resource type (see rsrcTypes.h) is not valid will not create resource. Return true if resource is created

virtual void DtScriptOwnshipObject::updateStateAndParameterProperties ( )
virtual

If this is a psuedo aggregate will update state and parameter properties in the state repository given the composition of the leaf nodes and their current values.

virtual void DtScriptOwnshipObject::removeResource ( const std::string &  resourceName)
virtual

Removes the resource from the supplied system.

virtual boost::shared_ptr<DtScriptComponentSystem> DtScriptOwnshipObject::lookupSystem ( const std::string &  systemName)
virtual

Gets a script component system from the system name.

virtual std::list<std::string> DtScriptOwnshipObject::getSystemNames ( )
virtual

Gets a list of all system names for this entity.

virtual bool DtScriptOwnshipObject::isUnderFire ( ) const
virtual

True if under fire, as defined in the object state repository.

virtual int DtScriptOwnshipObject::suppressionLevel ( ) const
virtual

Returns the suppression level: an integer from 0 to 3.

0 indicates not suppressed, and the entity is considered suppressed for levels 1-3.

virtual std::list<DtScriptVrfObject> DtScriptOwnshipObject::getObservedHostileContacts ( void  )
virtual

It gets the list of contacts for the entity and filters out all but known hostile objects that were detected by sensors (vs.

just spot reports).

virtual std::list<DtScriptVrfObject> DtScriptOwnshipObject::getAllHostileContacts ( void  )
virtual

It gets the list of contacts for the entity and filters out all but known hostile objects.

The Lua API function requires this list be returned in a table, so there is a wrapper function for it in the vrfLua module.

virtual std::list<DtScriptVrfObject> DtScriptOwnshipObject::getAllContacts ( void  )
virtual

It gets the list of contacts and returns it.

The Lua API function requires this list be returned in a table, so there is a wrapper function for it in the vrfLua module.

virtual bool DtScriptOwnshipObject::registerDetonationInterest ( double  range,
const std::string &  munitionType 
)
virtual

It registers interest in any detonation that occurs within the specified range of the object with the specified munition type.

virtual bool DtScriptOwnshipObject::getLastDetonation ( std::string &  munitionType,
DtLocation3D location 
)
virtual

If interest in detonations has previously been registered, this function will return the munition type and location of the detonation.

If no detonations have been received since the last call to this function, it returns false.

virtual void DtScriptOwnshipObject::setDestroyed ( bool  destroyed)
virtual

Sets the damage state of this entity to be destroyed if true, or not damaged if false.

virtual std::string DtScriptOwnshipObject::getRulesOfEngagement ( )
virtual

Returns the current rules of engagement of this entity.

virtual void DtScriptOwnshipObject::setRulesOfEngagement ( const std::string &  rule)
virtual

Sets the rules of engagement of this entity.

virtual std::list<std::string> DtScriptOwnshipObject::embeddedEntityNames ( )
virtual

Returns the complete list of Embedded Entity names available to this object.

virtual std::list<std::string> DtScriptOwnshipObject::embeddedEntitiesOfType ( std::string  typeString)
virtual

Returns a list of Embedded Entity names available to this object matching the given typeString, where typeString is a string representation of the seven digit DIS enumeration.

(e.g. "1:2:-1:-1:-1:-1:-1")

virtual std::list<std::string> DtScriptOwnshipObject::embeddedEntitiesCapableOf ( std::string  taskSetName)
virtual

Returns a list of Embedded Entity names available to this object that are capable of the given task/set, where taskSetName is the string identifier of any task or set.

(e.g. "turn-to-heading" or "set-destroy")

virtual DtScriptVrfObject DtScriptOwnshipObject::simObjectByEmbeddedEntityName ( std::string  eeName)
virtual

Returns the DtScriptVrfObject corresponding to the given Embedded Entity name.

isValid will return false if there is no corresponding DtScriptVrfObject, either because it is recovered, or the Embedded Entity is not available(configured) on this object.

virtual std::string DtScriptOwnshipObject::embeddedEntityStatus ( std::string  eeName)
virtual

Returns the deployment status of the Embedded Entity with the given name.

Return values are one of "recovered", "deleted", "destroyed", "deployed", and "unknown". "unknown" is only applicable if the given Embedded Entity is not available(configured) on this object.

virtual double DtScriptOwnshipObject::normalizedSensorSignature ( const DtScriptVrfObject targetEntity,
std::string  domain 
)
virtual

This function determines if the given target entity is detectable by the ownship entity in the given domain.

The function is intended for use when the ownship entity does not have a given sensor, or it is not sensing the target entity type, and a script wants to know if a target entity is detectable. The function assumes that a normalized signature of 1.0 is required for detection. That is, a generic detection table has entries for normalized signatures only as low as 1.0. A normalized signature is computed by dividing signature by range in km, so this condition means that the entity is within a range that is equal to its raw signature in km.
The domain is

static bool DtScriptOwnshipObject::processDetonation ( const DtDetonationContext detonationContext,
void *  usr 
)
staticprotected

Script API functions above.

////////////////////////////////////! Callback to process new detonations.

bool DtScriptOwnshipObject::processDetonation ( const DtDetonationContext detonationContext)
protected

Script API functions above.

////////////////////////////////////! Callback to process new detonations.

Member Data Documentation

std::string DtScriptOwnshipObject::myLastDetonationMunition
protected

The munition type of the last detonation.

DtLocation3D DtScriptOwnshipObject::myLastDetonationLocation
protected

The location of the last detonation.

std::map<std::string, DtScriptComponentSystem*> DtScriptOwnshipObject::myScriptComponentSystems
protected

List of systems which we have previously looked up, by name.


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

Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)