27 #include "tbb/mutex.h"
28 #include "tbb/queuing_rw_mutex.h"
34 #include <vlpi/disEnums.h>
35 #include <vlpi/artPartSpec.h>
36 #include <vlutil/vlString.h>
37 #include <vlpi/thresholder.h>
40 #include <vlutil/vlConfig.h>
44 #include "boost/logic/tribool.hpp"
45 #include <boost/signals2.hpp>
69 class DtArticulatedPartStateRepository;
70 class DtArticulatedPartManager;
127 virtual const int vrfObjectStateRepositorySubType()
const;
129 virtual bool init()
override;
130 virtual void initializeFromParameters();
139 virtual void setJoystickMovementControlled(
bool);
140 virtual bool joystickMovementControlled()
const;
150 virtual void restoreEntity();
199 virtual void setNavigationEnabled(
bool);
200 virtual bool navigationEnabled()
const;
203 virtual void restoreResourcesFromParameters();
208 virtual void setSOR(DtReal center, DtReal
size);
210 virtual DtReal SORSize()
const;
211 virtual DtReal SORCenter()
const;
218 virtual void upgradeFromImport();
225 virtual bool isContactHostile(
const DtSimObject*)
const;
229 virtual bool isContactHostile(
const DtVector& location,
int perceivedForce)
const;
233 virtual bool inSOR(
const DtSimObject* entity)
const;
237 virtual bool canFireAt(
const DtVector& location)
const;
241 virtual void setRequestTaskNeeded(
bool value);
242 virtual bool requestTaskNeeded()
const;
247 virtual bool hasTasks()
const;
250 virtual void clearCurrentTaskMsg(
const DtSymbolString& componentName);
253 virtual void clearCurrentTaskMsg(
const DtSymbolString& componentName,
int taskId);
257 virtual void setCurrentTaskMsg(
const DtSymbolString& componentName,
260 virtual void setCurrentTaskMsg(
const DtSymbolString& componentName,
269 virtual std::string taskStatusListPrintString()
const;
274 virtual std::string suspendedTaskListPrintString()
const;
287 virtual std::list<DtTaskMessage*> allCurrentTaskMsg(
const DtSymbolString& componentName)
const;
289 virtual void putSelf(std::string& fp,
291 bool writeUnspecified =
false,
307 std::vector<DtGroundInteractionPt*> groundInteractionPts,
308 bool* terrainDataAvailable =
nullptr)
const;
313 virtual void updateSupportPoints(
const DtVector& newPosition,
314 const DtReal newHeading);
327 static void addSimObjectStateRepositoryCreatorFcn(
const DtString & type,
361 virtual void timedTick();
365 virtual void setMinTickPeriod(
double minTickPeriod);
368 virtual double minTickPeriod()
const;
371 virtual void setMinTickPeriodVariance(
double minTickPeriodVariance);
374 virtual double minTickPeriodVariance()
const;
379 virtual void setNextTickTime(
double nextTickTime);
382 virtual double nextTickTime()
const;
389 virtual double calculateNextTickTime()
const;
391 virtual bool createProcessStateRepositoryManager();
398 systemProcessStateRepositoryManager()
const;
412 virtual void processObjectGeometry(
const DtList& vertices);
421 virtual void processObjectGeometry();
440 virtual void place(
const DtVector& location,
bool* dataAvailable =
nullptr,
441 bool requireAllData =
false);
457 virtual void place(
const DtReal heading,
bool* dataAvailable =
nullptr,
458 bool requireAllData =
false);
472 virtual void place(
const DtVector& location,
const DtReal heading,
473 bool clampToGroundFlag =
true,
bool* dataAvailable =
nullptr,
474 bool requireAllData =
false);
478 virtual void reclampToGround();
480 virtual DtReal mass()
const;
481 virtual void setMass(
const DtReal mass);
483 virtual DtTime lastTimeFiredUpon()
const;
484 virtual void setLastTimeFiredUpon(
const DtTime time);
486 virtual bool systemEnabled(
const DtString& systemName)
const;
487 virtual void setSystemEnabled(
const DtString& systemName,
bool enabled);
497 virtual int targetPriorityLevel(
const DtUUID& obj)
const;
509 virtual suppressionLevels suppressionLevel()
const;
510 virtual void setSuppressionLevel(
const suppressionLevels l);
511 virtual bool isSuppressed()
const;
515 virtual const DtString& nonLethalDamageEffect()
const;
516 virtual void setNonLethalDamageEffect(
const DtString& nonLethalDamageEffect);
521 virtual const DtUUID & occupyingObjectId()
const;
522 virtual void setOccupyingObjectId(
const DtUUID & objId);
533 virtual int nextTaskId();
536 virtual int nextSuspendId();
547 virtual int spawningTaskId(
int subtaskId)
const;
549 virtual void addPendingSubtaskId(
const DtSymbolString& componentName,
int subtaskId);
550 virtual void addPendingSubtaskId(
const DtSymbolString& componentName,
int taskId,
int subtaskId);
551 virtual bool findPendingSubtaskId(
const DtSymbolString& componentName,
int subtaskId);
552 virtual bool isSubtasked(
const DtSymbolString& componentName)
const;
553 virtual bool findPendingSubtaskId(
const DtSymbolString& componentName,
int taskId,
int subtaskId);
554 virtual void removePendingSubtaskId(
const DtSymbolString& componentName,
int subtaskId);
555 virtual void removePendingSubtaskId(
const DtSymbolString& componentName,
int taskId,
int subtaskId);
556 virtual void removeAllPendingSubtaskIds(
const DtSymbolString& componentName);
557 virtual void removeAllPendingSubtaskIds(
const DtSymbolString& componentName,
int taskId);
558 virtual void removeInactiveSubtaskStatus(
const DtSymbolString& componentName);
559 virtual void removeInactiveSubtaskStatus(
const DtSymbolString& componentName,
int taskId);
560 virtual void printPendingSubtaskIds(
const DtSymbolString& componentName)
const;
561 virtual std::vector<int> currentPendingSubstaskIds(
const DtSymbolString& componentName)
const;
562 virtual std::vector<int> currentPendingSubstaskIds(
const DtSymbolString& componentName,
int taskId)
const;
574 virtual bool taskedBySuperiorUponTaskComplete()
const;
576 virtual void setParentWasDestroyedWhenEmbarked(
bool);
577 virtual bool parentWasDestroyedWhenEmbarked()
const;
586 DtVector localBoundingVolumeCenterPosition()
const;
590 void setCurrentHeading(
const DtReal heading);
600 virtual void restoreStateProperties();
603 virtual void initStatePropertiesNotToBeRestored();
607 virtual void updateCachedStateProperties();
611 virtual void setTasked(
const DtSymbolString& componentName,
bool tasked);
612 virtual void setTasked(
const DtSymbolString& componentName,
int taskID,
bool tasked);
620 virtual void initializeNextTaskId();
623 virtual void setOrientationRelativeToParent();
633 virtual double sensorSignature(
const DtSymbolString& sensorDomain)
const;
637 virtual std::list<DtSymbolString> sensorSignatureDomains()
const;
660 virtual void setUserTarget(
const DtUUID& target);
661 virtual DtUUID userTarget()
const;
674 virtual void setInternalUserData(
const DtString& s,
void*);
675 virtual void* getInternalUserData(
const DtString&)
const;
676 virtual void removeInternalUserData(
const DtString&);
677 virtual void clearInternalUserData();
680 return myInternalUserDataMap;
686 virtual bool createObjectResourceManager();
694 virtual void embarkedParentDeleted();
697 virtual bool createResourceDatabaseLogger();
847 VRF4API_METHOD virtual void setAppearance(
const DtAppearance& app);
916 VRF4API_METHOD void setFirePowerKilled(
const bool firePowerKilled);
980 VRF4API_METHOD virtual void setIsSubordinateOfForceLevel(
bool yesNo);
988 VRF4API_METHOD virtual void appendExtendedData(
const std::map<DtString, DtString>&);
1001 VRF4API_METHOD virtual void setExtendedDataMap(
const std::map<std::string, std::string>&);
1071 DtDeadReckonTypes deadReckoningAlgorithm);
1077 const DtThresholder& thresholder);
1081 #include "vrfobjcore/vrfObjectStateRepository.inl"
UUID is a unique ID wrapper class.
Definition: uuid.h:59
Instances of DtVrfObjectParameters are the readable/writeable objects that contain the information ne...
Definition: vrfObjectParameters.h:63
DtRwBoolean myParentWasDestroyedWhenEmbarked
Set to true when the entity is embarked on a destroyed parent so they do not become destroyed...
Definition: vrfObjectStateRepository.h:761
double myNextTickTime
Definition: vrfObjectStateRepository.h:794
DtTaskStatusList myTaskStatusList
Contains the myTasked and myCurrentTaskMsg members from the DtTaskControllerComponent class...
Definition: vrfObjectStateRepository.h:750
double myLastTickSimTime
Definition: vrfObjectStateRepository.h:795
const int DtPolygonVisibilityTest
Definition: vrfObjectStateRepository.h:74
The articulated part manager maintains a tree of articulated and attached parts for the state reposit...
Definition: articulatedPartManager.h:34
Definition: attachedTerrain.h:46
Objects may contain a collection of other objects, such as overlays or pseudo-aggregate entities...
Definition: subordinateManager.h:43
virtual const InternalUserDataMap & internalUserDataMap() const
Internal user data is data that is not saved to the scenario and will last only as long as this inter...
Definition: vrfObjectStateRepository.h:678
suppressionLevels
The current suppression level. An enumeration with 4 values. Determined from suppression value in the...
Definition: vrfObjectStateRepository.h:503
DtReal myMass
Definition: vrfObjectStateRepository.h:732
This is a DtReaderWriter subclass which holds the status of a subtask that was issues by another task...
Definition: taskStatusEntry.h:28
This class allows one to collect and compare strings using an index number instead of having to do st...
Definition: symbolString.h:27
virtual const int objectStateRepositorySubType() const
virtual void restoreFromLegacyRWData()
A readable, writable type that holds an articulated part type, attached-to part type, attachment point, and a list of art-part params (DtSimArtPartParamList). The read/write name is not used for anything in particular, and therefore may be used for file readability.
Definition: simArtPartDescriptor.h:28
virtual bool init()
Our 'virtual' constructor. Calls all the create<>() methods.
DtRwStringList mySystemsDisabledList
if this object is a subordinate, this is used to write out the name of the parent ...
Definition: vrfObjectStateRepository.h:771
DtRwInt myNextSuspendId
Definition: vrfObjectStateRepository.h:756
Description: DtSimSector is a readable/writable description of a sector of responsibility (center and...
Definition: simSector.h:20
virtual void detachFromParent()
boost::signals2::signal< void()> signal_statePropertiesRestored
Signal sent when state properties are restored.
Definition: vrfObjectStateRepository.h:136
voidpf void uLong size
Definition: ioapi.h:39
boost::signals2::signal< void(DtVrfObjectStateRepository *)> signal_postInitFromParams
Signal sent right after initializeFromParameters is called.
Definition: vrfObjectStateRepository.h:133
The DtSimObjectReference is a shared pointer that can be used amongst many object for access to the u...
Definition: simObjectReference.h:26
DtObjectResourceManager * myObjectResourceManager
Definition: vrfObjectStateRepository.h:779
bool myPaused
Definition: vrfObjectStateRepository.h:814
Description: Readable, Writable DtString Variable substitutions are done on this object when it is re...
Definition: rwString.h:20
class DtSimResourceManager:
Definition: simResourceManager.h:38
virtual void postGetSelf() override
Hook function called immediately following getSelf().
Definition: simObjectStateRepository.h:59
std::map< DtString, std::map< DtString, DtRwJoystickControl > > JoystickControls
Controls by function group.
Definition: vrfObjectStateRepository.h:103
Definition: readerWriterRegistry.h:39
DtSimResourceManager myResourceManager
This resource manager is used for all the top-level resource only. Component Systems now contain reso...
Definition: vrfObjectStateRepository.h:738
DtVrfProcessStateRepositoryManager * mySystemProcessSRManager
Definition: vrfObjectStateRepository.h:716
class DtVrfProcessStateRepositoryManager:
Definition: vrfProcessStateRepositoryManager.h:49
DtSimulationServices * mySimulationServices
Definition: vrfObjectStateRepository.h:717
File: weaponPSR.h.
Definition: vrfWeaponPSR.h:31
Responsible for monitoring resources for a particular entity and issuing database updates when the va...
Definition: resourceDatabaseLogger.h:16
Description: This repository is an internal repository accessible only by local objects. It holds all information that is common to all the forms of all entity/aggregate/control objects within VR-Forces.
Definition: vrfObjectStateRepository.h:92
const DtSimObjectStateRepository & operator=(const DtSimObjectStateRepository &orig)
double myMinTickPeriodVariance
Definition: vrfObjectStateRepository.h:793
DtSensorContactInfoList myObjectContactList
The situational awareness of this object. List of other objects that this object is currently aware o...
Definition: vrfObjectStateRepository.h:799
uuid class
Definition: rwUUID.h:26
DtRwInt mySuppressionLevel
The current enumerated level of suppression, derived from the value.
Definition: vrfObjectStateRepository.h:726
DtGroundInteractionPt myGroundCenter
Definition: vrfObjectStateRepository.h:719
DtSimSector mySectorOfResponsibility
These really apply to a single weapon, and should be part of a weapon controller/actuator suite of so...
Definition: vrfObjectStateRepository.h:742
static DtReaderWriterFactory * factory()
Definition: rangeItem.h:149
The DtPhysicalWorld is the primary interface to and manager of all of the "physical" aspects of the s...
Definition: physicalWorld.h:102
DtRwUUID myUserTarget
Definition: vrfObjectStateRepository.h:774
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
DtResourceDatabaseLogger * myResourceDbLogger
Resource logger for logging resource information to a database, if enabled.
Definition: vrfObjectStateRepository.h:819
DtSuspendedTaskStatusList mySuspendedTaskStatusList
Definition: vrfObjectStateRepository.h:752
Definition: taskStatusList.h:21
Version of the DtVrfProcessStateRepositoryManager that is used specifically to read in scenario files...
Definition: legacyProcessStateRepositoryManager.h:27
DtVrfObjectStateRepository *(* DtSimObjectStateRepositoryCreatorFcn)(const DtString &name, DtLocalObject *simObjects, DtReaderWriterRegistry *parentRegistry)
Definition: simObjectStateRepositoryFactory.h:20
std::list< const DtRwVariableBindings * > DtVariableBindingsList
Definition: readerWriterRegistry.h:29
const int DtEntityVisibilityTest
Definition: vrfObjectStateRepository.h:73
DtRwInt myNextTaskId
The next available ID that can be assigned to a task for this entity.
Definition: vrfObjectStateRepository.h:755
Class Description: Readable, writable form of DtAppearance.
Definition: rwAppearance.h:16
DtRwBoolean myRequestTaskNeeded
Moved here from the DtLocalTaskManager class.
Definition: vrfObjectStateRepository.h:745
A list of DtSuspendedTaskStatusEntry instances, each representing a different suspend ID...
Definition: suspendedTaskInfo.h:115
DtTime myLastTimeFiredUpon
Under fire parameters.
Definition: vrfObjectStateRepository.h:722
Description: Readable, Writable int.
Definition: rwInt.h:25
std::vector< DtFilename > SearchPaths
Definition: readerWriter.h:92
virtual void createLegacyRWData()
Creates the legacy data used for any pre/put operation. Override this to create your legacy data atta...
Instances of DtVrfStateRepositoryUserExtension can be used by customers to extend the base DtVrfObjec...
Definition: vrfStateRepositoryUserExtension.h:20
class DtSimObjectStateRepositoryFactory:
Definition: simObjectStateRepositoryFactory.h:29
Definition: rangeItem.h:206
The base class for all messages to/from a specific DtVrfObject. Various subclasses of this class will...
Definition: vrfObjectMessage.h:30
JoystickControls myJoystickControls
Map of available joystick controls for this particular entity.
Definition: vrfObjectStateRepository.h:809
This is the top-level resource manager for a DtLocalObject. The actual resources are stored in DtSimR...
Definition: objectResourceManager.h:21
DtRwString myNonLethalDamageEffect
The current non lethal damage type (sick, faint, etc.). Default value is empty string.
Definition: vrfObjectStateRepository.h:730
virtual void getSelf(DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &variableBindings=nullVariableReference())
Top level to read itself from an input stream. searchPath is passed down to all DtReaderWriter member...
bool myJoystickMovementControlled
If true movement is controlled by joystick so will not be able to be taskable as a subordinate...
Definition: vrfObjectStateRepository.h:812
virtual void putSelf(std::string &fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
Top level call to write itself to file. If write unspecified is true, will write entries that are uns...
Definition: echelonId.h:13
bool(* DtVisibilityTest)(double rangeSquared, const DtEntityIdentifier &eyeKey, const DtVector &localEyePoint, const DtVector &localEndPoint, const DtVrfObjectStateRepository *sr)
Definition: vrfObjectStateRepository.h:77
DtVrfStateRepositoryUserExtension * myStateRepositoryUserExtension
Data that is "private" to this object in that it should be the only one that is referencing this data...
Definition: vrfObjectStateRepository.h:713
virtual void setToLegacyRWData()
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:95
std::map< int, DtString > ExtendedLabels
Definition: vrfObjectStateRepository.h:99
std::map< DtString, DtString > ExtendedData
Definition: vrfObjectStateRepository.h:100
DtRwNLengthUUIDVector is a named, readable/writable vector of DtUUIDs. Can be used in place of a NLen...
Definition: rwNLengthUUIDVector.h:30
DtRwNLengthUUIDVector myEngagementZones
Definition: vrfObjectStateRepository.h:714
Represents a single simulation object in the exercise. Object may be VRF simulation, or non-VRF simulated, and may be simulated by the local sim engine, or by a remote sim engine. Only public (external) state of the object is available. All data is read-only. All access to data of the object is thread safe within the simulation frame.
Definition: simObject.h:88
double myMinTickPeriod
For performance and memory usage reasons, the copy of the parameter entry that used to be made when c...
Definition: vrfObjectStateRepository.h:792
DtUUID myOccupyingObjectId
Definition: vrfObjectStateRepository.h:733
Description: Readable, Writable bool.
Definition: rwBoolean.h:26
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
Definition: vrfObjectStateRepository.h:816
DtSimResource is an abstract base class that can be used to create a hierarchical resource list of a ...
Definition: simResource.h:42
virtual bool attachToParent(const DtUUID &parent)
Looks up the parent state repository using the given echelon ID and puts it in a call to attachToPare...
Class Invariant: The DtGroundInteractionPt class must always have a valid DtAttachedTerrain or DtSimM...
Definition: groundInteractionPt.h:28
static DtSimObjectStateRepositoryFactory * theFactory
Definition: vrfObjectStateRepository.h:777
std::map< DtString, void * > InternalUserDataMap
Internal user data is data that is not saved to the scenario and will last only as long as this inter...
Definition: vrfObjectStateRepository.h:673
DtRwBoolean myNavigationEnabled
Whether or not this object can navigate in navigation areas. Default is true.
Definition: vrfObjectStateRepository.h:764
Definition: rwStringList.h:20
A list of properties. A DtPropertyInterface object that is a specialized version of DtRwVariableBindi...
Definition: rwProperties.h:122
virtual void processSimObjectDeleted(const DtSimObject *)
These callbacks are used to set myAttachedToStateRepository when this ent gets attached/detached to/f...
std::vector< DtString > myStatePropertiesNotToBeRestored
The list of state properties that should not be updated by restoreStateProperties.
Definition: vrfObjectStateRepository.h:806
InternalUserDataMap myInternalUserDataMap
Definition: vrfObjectStateRepository.h:772
class DtLocalVertexList:
Definition: localVertexList.h:20
#define VRF4API_METHOD
Include this header file to allow for the definition/usage of the ability to mark something as deprec...
Definition: vrf4XAPI.h:22
A DtTaskMsg is a DtRadioMsg with a pointer to a task. The type of the taskMsg is just the type of the...
Definition: taskMessage.h:21
const int DtFeatureVisibilityTest
Definition: vrfObjectStateRepository.h:75
static const DtFilename & appPath()
Gets the current working directory. The first time this accessor is called, it determines the current...
DtWeaponInfoList * myWeaponInfoList
List of WeaponInfo classes that provide data on all weapons that have made their information availabl...
Definition: vrfObjectStateRepository.h:803
DtRwPriorityTargetListMap myTargetPriorityList
Target Priority List.
Definition: vrfObjectStateRepository.h:767
Definition: weaponInfoList.h:13
A locally simulated VRF object. Holds all internal and external data for the object, and provides access to both the current frame and next frame state data for the object. All current frame data is read-only, and next-frame data can be written to. No thread safety guarantees are made on this object during the simulation frame and it should only be accessed by the thread that is simulating the object.
Definition: localObject.h:86
virtual DtString type() const
returns DtSimObjectStateRepositoryType