VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
localObject.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2021 MAK Technologies, Inc.
3  * All rights reserved.
4  ****************************************************************************/
5 
6 #pragma once
7 
10 #include "vrfobjcore/simObject.h"
16 #include "vrfStateData/stateData.h"
19 #include <vrfutil/echelonId.h>
20 #include <vrfutil/vrf4XAPI.h>
21 
22 namespace makVrf
23 {
24  class DtExternalCurrentFrameState;
25  class DtExternalNextFrameState;
26  class DtLaserDesignatorStateComponent;
27  class DtIffStateComponent;
28  class DtActiveSonarStateComponent;
29  class DtTaskVisualizationStateComponent;
30  class DtNavAidRadioTransmitterStateComponent;
31  class DtUnderwaterAcousticsStateComponent;
32  class DtEmitterSystemStateComponent;
33  class DtRadioReceiverStateComponent;
34  class DtFrameStateInterface;
35  class DtStatePropertiesStateComponent;
36 }
37 
38 class DtPlan;
40 class DtSettingsObject;
47 class DtAttachedTerrain;
49 class DtSimTaskManager;
51 class DtSimRadio;
54 class DtSetDataManager;
56 class DtVrfObjectMessage;
59 
60 typedef DtLocalObject* (*DtLocalObjectCreatorFcn)(DtSimulationServices*, const DtVrfLocalObjectCreateInformation&);
61 
64 {
67  {
83  };
84 
87 };
88 
99 {
100 protected:
105  DtLocalObject(DtSimulationServices* simulationServices, const DtVrfLocalObjectCreateInformation& createInfo);
106 
109  DtLocalObject(DtSimulationServices* simulationServices);
110 
111 public:
113  {
114  ObjectName = 1,
119  SubordinateOfForceLevel
120  };
121 
123  virtual ~DtLocalObject() override;
124 
125  const makVrf::DtExternalNextFrameState* nextFrameState() const;
126  makVrf::DtExternalNextFrameState* nextFrameState();
127 
129  template <typename T_Component>
131  {
132  return nextFrameState()->getStateComponent<T_Component>();
133  }
134 
136  template <typename T_Component>
137  const T_Component* getNextFrameStateComponent() const
138  {
139  return nextFrameState()->getStateComponent<T_Component>();
140  }
141 
144 
146 
147  virtual void setNextFrameParameterProperties(const DtRwProperties&);
148  const DtRwProperties& nextFrameParameterProperties() const;
149 
152  virtual DtRwProperties& nextFrameStateProperties();
153  virtual const DtRwProperties& nextFrameStateProperties() const;
154 
157  virtual const DtRwProperties& stateProperties() const;
158 
163  virtual DtPropertyInterface* stateProperty(const DtString& propertyName);
164  virtual DtPropertyInterface* stateProperty(const DtString& context,
165  const DtString& propertyName);
166  virtual const DtPropertyInterface* stateProperty(const DtString& propertyName) const;
167  virtual const DtPropertyInterface* stateProperty(const DtString& context,
168  const DtString& propertyName) const;
170 
174  virtual DtPropertyInterface* addStateProperty(const DtString& context,
175  const DtString& propertyName, int initialValue);
176  virtual DtPropertyInterface* addStateProperty(const DtString& context,
177  const DtString& propertyName, double initialValue);
178  virtual DtPropertyInterface* addStateProperty(const DtString& context,
179  const DtString& propertyName, bool initialValue);
180  virtual DtPropertyInterface* addStateProperty(const DtString& context,
181  const DtString& propertyName, const DtString& initialValue);
182  virtual DtPropertyInterface* addStateProperty(const DtString& context,
183  const DtString& propertyName, const DtVector& initialValue);
185 
188  virtual bool addStateProperty(const DtString& context,
189  const DtString& propertyName, DtPropertyInterface* property);
190 
193  virtual void setNextFrameActivity(const DtString&);
194 
201  virtual void setGlobalIdentifierForPublication(const DtString&);
202 
203  virtual void setNextFrameExtendedData(const DtString& key, const DtString& value);
204  virtual void setNextFrameExtendedDataMap(const std::map<DtString, DtString>&);
205  virtual void setNextFrameExtendedDataMap(const std::map<std::string, std::string>&);
206  virtual void clearNextFrameExtendedData();
207  virtual void appendNextFrameExtendedData(const std::map<DtString, DtString>& s);
208  virtual void setNextFrameExtendedLabel(int, const DtString& value);
209  virtual void clearNextFrameExtendedLabels();
210  virtual void setNextFrameExtendedLabels(const std::map<int, DtString>&);
211  virtual DtAppearance nextFrameAppearance() const;
213 
222  virtual void setNextFrameLocalPosition(const DtVector& v);
228  virtual DtString nextFrameLabel() const;
229 
235  virtual const DtVector& nextFrameLocalPosition() const;
236 
242  virtual void setNextFrameWorldPosition(const DtVector& v);
246  virtual const DtVector& nextFrameWorldPosition() const;
247 
253  virtual void setNextFrameParentPosition(const DtVector& v);
259  virtual const DtVector& nextFrameParentPosition() const;
260 
266  virtual void setNextFrameLocalOrientationMatrix(const DtDcm& v);
272  virtual const DtDcm& nextFrameLocalOrientationMatrix() const;
273 
279  virtual void setNextFrameLocalOrientationWrtDatabase(const DtTaitBryan& v);
285  virtual const DtTaitBryan& nextFrameLocalOrientationWrtDatabase() const;
286 
292  virtual void setNextFrameLocalOrientation(const DtTaitBryan& v);
298  virtual const DtTaitBryan& nextFrameLocalOrientation() const;
299 
305  virtual const DtTaitBryan& nextFrameTopographicOrientation() const;
306 
312  virtual void setNextFrameParentOrientation(const DtTaitBryan& v);
318  virtual const DtTaitBryan& nextFrameParentOrientation() const;
319 
325  virtual void setNextFrameWorldOrientation(const DtTaitBryan& v);
331  virtual void setNextFrameWorldOrientationMatrix(const DtDcm& v);
337  virtual const DtTaitBryan& nextFrameWorldOrientation() const;
343  virtual const DtDcm& nextFrameWorldOrientationMatrix() const;
344 
351  virtual void setNextFrameLocalVertices(const DtList& vertices, DtVector& newGeometricCenter);
358  virtual void setNextFrameLocalVertices(const DtLocalVertexList& vertices, DtVector& newGeometricCenter);
364  virtual void removeNextFrameVertex(int iIndex);
370  virtual void addNextFrameLocalVertex(const DtVector& vertex);
377  virtual void addNextFrameLocalVertex(const DtVector& vertex, DtVector& newGeometricCenter);
378 
385  virtual void setNextFrameWorldVertices(const std::vector<DtVector>& vertices, DtVector& newGeometricCenter);
392  virtual void setNextFrameWorldVertices(const DtVertexList& vertices, DtVector& newGeometricCenter);
399  virtual void setNextFrameWorldVertices(const DtList& vertices, DtVector& newGeometricCenter);
406  virtual void addNextFrameWorldVertex(const DtVector& vertex, DtVector& newGeometricCenter);
407 
413  bool nextFrameIsDestroyed() const;
419  int nextFrameDamageState() const;
420 
426  virtual void setNextFrameRelativeVertices(const DtLocalVertexList& vertices);
427 
433  virtual const DtLocalVertexList& nextFrameLocalVertices() const;
439  virtual const DtVertexList& nextFrameWorldVertices() const;
445  virtual const DtLocalVertexList& nextFrameRelativeVertices() const;
446 
452  virtual double nextFrameHeading() const;
458  virtual double nextFramePitch() const;
464  virtual double nextFrameRoll() const;
465 
467 
471  virtual void setNextFrameLabel(const DtString&);
472 
479  virtual const DtString& nextFrameExtendedData(const DtString&) const;
480 
482 
483  virtual void setNextFrameIsSubordinateOfForceLevel(bool);
484  virtual bool nextFrameIsSubordinateOfForceLevel() const;
485 
489  virtual bool nextFrameIsLocal() const;
490  virtual bool isLocal() const override;
491 
497  virtual void removedFromSimulation();
498 
500 
501  virtual void setNextFrameInvisible(bool);
502  virtual bool nextFrameInvisible() const;
503 
504  virtual void setNextFrameOverlay(const DtString&);
505 
506  virtual bool nextFrameSensorsKilled() const;
507  virtual void setNextFrameSensorsKilled(bool sensorsKilled);
508 
509  virtual void setNextFrameInvisibleSetByUser(bool b);
510  virtual bool nextFrameInvisibleSetByUser() const;
511 
512  virtual DtString nextFrameOverlay() const;
513 
515 
547 
555  virtual DtOutputStream& objectConsoleDebug(const DtString& channel = "") const;
556 
564  virtual DtOutputStream& objectConsoleVerbose(const DtString& channel = "") const;
565 
572  virtual DtOutputStream& objectConsoleInfo(const DtString& channel = "") const;
573 
581  virtual DtOutputStream& objectConsoleWarn(const DtString& channel = "") const;
582 
590  virtual DtOutputStream& objectConsoleError(const DtString& channel = "") const;
591 
595  int notifyLevel() const;
596  const DtObjectConsole* objectConsole() const;
598 
599  virtual void makeInvalid() override;
600 
604  bool isValid() const;
605 
606  bool publishObject() const;
607  int publishFlag() const;
608  virtual void setNextFrameIsClutterEntity(bool b);
609  virtual bool nextFrameIsClutterEntity() const;
610  virtual void setNextFrameIsVrfSimulated(bool);
611  virtual bool nextFrameIsVrfSimulated() const;
612 
613  virtual void setNextFrameCallsign(const DtString& cs);
614  virtual const DtString& nextFrameCallsign() const;
615 
616  virtual bool isRemoteAttachedObject() const;
617 
618  virtual void setNextFrameEngagementRules(const DtString&);
619  virtual DtString nextFrameEngagementRules() const;
620 
621  virtual void setNextFrameIsTasked(bool);
622  virtual bool nextFrameIsTasked() const;
623 
624  virtual void setNextFrameIndependentlyTasked(bool);
625  virtual bool nextFrameIndependentlyTasked() const;
626 
627  virtual void setNextFrameGlobalId(const DtString&);
628 
629  virtual void setNextFrameEntityId(const DtEntityIdentifier& id);
630  virtual DtEntityIdentifier nextFrameEntityId() const;
631 
636  virtual bool setNextFrameObjectName(const DtString&);
637  virtual DtString nextFrameObjectName() const;
638 
639  virtual void setNextFrameObjectType(const DtEntityType&);
640  virtual DtEntityType nextFrameObjectType() const;
641 
642  void setNotifyLevel(int);
644 
645  bool convertingToLocal() const
646  {
647  return myConvertingToLocal;
648  }
649 
650  virtual void setConvertingToRemote(bool);
651  bool convertingToRemote() const
652  {
653  return myConvertingToRemote;
654  }
655 
663  template <typename T_Component>
664  T_Component* addStateComponent(bool checkWritable = false, bool isRemote = false)
665  {
666  if (isValid())
667  {
668  T_Component* comp = myExternalNextFrameState->addStateComponent<T_Component>(checkWritable, isRemote);
669 
670  if (comp)
671  {
672  makVrf::DtStateData* sd = const_cast<DtSimulationServices*>(mySimulationServices)->stateDataManager()->stateDataFor(myUUID);
673 
674  if (sd)
675  {
676  makVrf::DtStateComponent* stateComponent = sd->getStateComponent<T_Component>(comp->id());
677 
678  if (stateComponent)
679  {
680  stateComponent->setIsRemoteComponent(false);
681  }
682  }
683  }
684 
685  return comp;
686  }
687  else
688  {
689  throw makVrf::DtUnimplementedMethod("The addStateComponent is not implemented for this class.");
690  }
691  }
692 
694 
704  virtual bool nextFrameIsEmbarked() const;
708  virtual DtUUID nextFrameEmbarkedOn() const;
709  virtual void setNextFrameEmbarkedOn(const DtUUID& u);
710  virtual bool nextFrameIsEmbarkedOn(const DtUUID&) const;
711  virtual DtSimObjectReference nextFrameSimObjectEmbarkedOn() const;
712 
720  virtual void setNextFrameEchelonId(const DtEchelonId&);
721  virtual DtEchelonId nextFrameEchelonId() const;
722 
730  virtual void setNextFrameForceType(int);
731  virtual DtForceType nextFrameForceType() const;
732 
733  virtual void setNextFrameSessionId(int);
734  virtual int nextFrameSessionId() const;
735 
736  virtual void setNextFrameVrfMessageVersionSupported(int);
737  virtual int nextFrameVrfMessageVersionSupported() const;
738 
742  virtual void removeNextFrameExtendedData(const DtString&);
743 
747  void removeStateComponent(const makVrf::DtFrameStateInterface*);
748 
752  virtual void upgradeFromImport();
753 
757  makVrf::DtTaskVisualizationStateComponent* lineTaskVisualization(const DtString& visualName, const DtString& component);
758  makVrf::DtTaskVisualizationStateComponent* pointTaskVisualization(const DtString& visualName, const DtString& component);
759  makVrf::DtTaskVisualizationStateComponent* areaTaskVisualization(const DtString& visualName, const DtString& component);
760  makVrf::DtTaskVisualizationStateComponent* textTaskVisualization(const DtString& visualName, const DtString& component);
761  void removeTaskVisualization(makVrf::DtTaskVisualizationStateComponent*);
763 
764  makVrf::DtLaserDesignatorStateComponent* addLaserDesignator();
765  void removeLaserDesignator(makVrf::DtLaserDesignatorStateComponent*);
766 
767  makVrf::DtEmitterSystemStateComponent* addEmitterSystem();
768  void removeEmitterSystem(makVrf::DtEmitterSystemStateComponent*);
769 
770  makVrf::DtActiveSonarStateComponent* addActiveSonarSystem();
771  void removeActiveSonarSystem(makVrf::DtActiveSonarStateComponent*);
772 
773  makVrf::DtRadioTransmitterStateComponent* addRadioTransmitter();
774  void removeRadioTransmitter(makVrf::DtRadioTransmitterStateComponent*);
775 
776  makVrf::DtNavAidRadioTransmitterStateComponent* addNavAidRadioTransmitter();
777  void removeNavAidRadioTransmitter(makVrf::DtNavAidRadioTransmitterStateComponent*);
778 
779  makVrf::DtRadioReceiverStateComponent* addRadioReceiver();
780  void removeRadioReceiver(makVrf::DtRadioReceiverStateComponent*);
781 
788  makVrf::DtIffStateComponent* getOrCreateIffSystem();
789  void removeIffSystem();
790 
798  makVrf::DtUnderwaterAcousticsStateComponent* getOrCreateUnderwaterAcousticsSystem(bool isRemote = false);
799  void removeUnderwaterAcousticsSystem();
800 
801  virtual void setNextFrameUnderFire(bool b);
802  virtual bool nextFrameUnderFire() const;
803  virtual void setNextFrameInvulnerable(bool);
804  virtual bool nextFrameInvulnerable() const;
805 
806  virtual void setNextFrameUndetectable(bool);
807  virtual bool nextFrameUndetectable() const;
808 
812  virtual void setNextFrameHalfLengthWidthHeight(double length, double width, double height);
813  virtual void setNextFrameObjectGeometry(const makVrf::DtVrfObjectGeometry&);
814  virtual void setNextFrameBoundingGeometryType(DtSimBoundingGeometry::DtSimBoundingGeometryType type);
815  virtual void setNextFrameBoundingVolume(const Dt3dBoundingVolume& b);
816 
817  virtual void setNextFrameHasPlan(bool);
818  virtual bool nextFrameHasPlan() const;
819 
820  virtual void setNextFrameExecutingPlan(bool);
821  virtual bool nextFrameExecutingPlan() const;
822 
827  virtual void setNextFrameOccupantsHidden(int);
828  virtual bool nextFrameOccupantsHidden() const;
829 
835  virtual std::map<DtString, DtString> nextFrameExtendedDataMap() const;
836 
842  virtual std::map<int, DtString> nextFrameExtendedLabels() const;
843 
844  virtual bool nextFrameIsOnTopOf(const DtSimObject* o, bool checkSupportPoints = false) const;
845  virtual bool nextFrameIsOnTopOf(const DtSimObject* o, double d, bool checkSupportPoints = false) const;
846 
852  DtLocalObjectDecorator* getOrCreateDecorator(const std::string& Decorator);
853 
858  void setLocationComplete();
859 
861  boost::signals2::signal<void ()> signal_preObjectReinitialize;
862  boost::signals2::signal<void (bool success)> signal_postObjectReinitialize;
863 
869  boost::signals2::signal<void ()> signal_resourceChangedBySet;
870 
872  boost::signals2::signal<void ()> signal_preUpgradeFromImport;
873 
875  boost::signals2::signal<void ()> signal_postUpgradeFromImport;
876 
878  boost::signals2::signal<void ()> signal_objectInitialized;
879 
881  boost::signals2::signal<void ()> signal_objectRestored;
882 
884  boost::signals2::signal <void (DtLocalObject*)> signal_objectModifiedViaMessage;
885 
887  boost::signals2::signal <void (DtLocalObject*)> signal_newSensorContact;
888 
890  boost::signals2::signal <void (DtLocalObject*)> signal_navigationAreaChanged;
891 
893  boost::signals2::signal <void (DtLocalObject*)> signal_setLocationComplete;
894 
896  boost::signals2::signal<void ()> signal_restored;
897 
899  mutable boost::signals2::signal<void (const DtLocalObject*, ChangeFlag)> signal_objectDataChanged;
900 
902  boost::signals2::signal<void(const DtLocalObject*)> signal_localObjectAboutToBeDeleted;
903 
905  virtual void setNextFrameStateProperties(const DtRwProperties&);
906 
912  virtual bool nextFrameFuelLevelsFrozen() const;
913 
919  virtual bool nextFrameMunitionLevelsFrozen() const;
920 
926  virtual void setSimulationCapable(bool);
927  bool simulationCapable() const;
928 
934  virtual void setNextFrameBlockParachute(bool);
935  virtual bool nextFrameBlockParachute() const;
936 
945  virtual void setNextFrameOnTerrainSurface(bool b);
946  virtual bool nextFrameOnTerrainSurface() const;
947 
955  virtual void setOperationInProgress(int, bool);
956  virtual bool operationInProgress(int) const;
957  virtual void clearOperationsInProgress();
959 
960 public:
963 
971  virtual bool createInternalState(const DtVrfObjectParameters* parameterEntry);
972 
979  virtual bool setupSubComponentTypes();
981 
989  virtual bool init();
990 
999  virtual bool create();
1000 
1007  static DtLocalObjectCreatorFcn setLocalObjectCreatorFunction(DtLocalObjectCreatorFcn);
1008  static DtLocalObjectCreatorFcn localObjectCreatorFunction();
1010 
1019 
1021 
1026  static void readDRThresholdSettingsCallback(
1027  const DtSettingsObject* settings, void* usr);
1028  virtual void processReadDRThresholdSettings(const DtSettingsObject* settings);
1030 
1034  bool isGlobalPlan() const;
1035 
1039  bool isSyncMatrix() const;
1040 
1046  virtual int publicationFlag() const;
1047 
1052  virtual bool isCapableOfTask(std::string taskName);
1053 
1054 public:
1055 
1060  virtual bool convertToRemoteObject(DtString& error);
1066  virtual bool convertToLocalObject(DtString& error, const std::string& archiveState);
1068  boost::signals2::signal<void (DtLocalObject*, DtVrfObjectHandoffData::HandoffFlag)> signal_handoffStep;
1069 
1073  virtual bool prepareForHandoff();
1078  mutable boost::signals2::signal<void (DtLocalObject*, DtVrfObjectHandoffData&)> signal_prepareForHandoff;
1079 
1084  virtual std::string archiveState() const;
1085 
1086 public:
1087  typedef std::list<DtLuaScriptInterfaceExtension::CreatorUserPair> ScriptInterfaceExtensions;
1088 
1103  const DtSimResourceManager& resourceManager() const;
1104  DtSimResourceManager& resourceManager();
1106 
1107  virtual DtVrfObjectStateRepository* internalState();
1108  virtual const DtVrfObjectStateRepository* internalState() const;
1109 
1114  {
1115  ReinitializeDefault = 0x00000000,
1116  ReinitializeKeepPSR = 0x00000001,
1117  ReinitializeStateData = 0x00000002,
1118  };
1119 
1120  virtual void prepareForReinitialization(ReinitializeFlags flags = ReinitializeDefault);
1121 
1128  DtVrfObjectSubComponentTypes* vrfSubComponentTypes() const;
1129 
1136  virtual void tick();
1137 
1138 protected:
1139  virtual void startTick();
1140  virtual void tickComponents();
1141  virtual void endTick();
1142 
1143 public:
1144 
1150  virtual int scenarioRunId() const;
1151 
1161  virtual bool checkIfMoveOntoEmbarked(const DtVector& localPosition, const DtSimObject*& hit, const std::list<DtUUID>& additionalIgnore = std::list<DtUUID>());
1162 
1170  virtual bool checkAndDisembarkIfEmbarked(const DtVector& localPosition);
1175  virtual bool lowFidelityDisembarkHitCheck(const DtVector& localPosition) const;
1180  virtual bool highFidelityDisembarkHitCheck(const DtVector& localPosition) const;
1181 
1185  virtual int nextEmitterSystemId();
1186 
1187 public:
1191  virtual DtVrfObjectCommunicationInterface* communicationInterface();
1192  virtual const DtVrfObjectCommunicationInterface* communicationInterface() const;
1193  virtual DtVrfObjectTerrainPreloadManager* terrainPreloadManager();
1194  virtual DtSimRadio* radio() const;
1195  virtual DtSimTaskManager* taskManager() const;
1196  virtual DtScriptInterfaceHandler* scriptInterfaceHandler() const;
1197  virtual DtVrfObjectPlanManager* vrfObjectPlanManager() const;
1198  virtual DtSimComponentManager* componentManager();
1199  virtual const DtSimComponentManager* componentManager() const;
1200 
1208  virtual DtSetDataManager* setDataManager();
1209  virtual const DtSetDataManager* setDataManager() const;
1211 
1212  bool initialized() const
1213  {
1214  return myInitialized;
1215  }
1216 
1218  {
1219  if (!myParallelContainer)
1220  {
1221  myParallelContainer = DtVrfCallbackQueue::CallbackInterface::Ptr(new SimObjectCallback(this));
1222  }
1223 
1224  return myParallelContainer;
1225  }
1226 
1227 public:
1233  virtual void cleanupItemsNeededForHandoff();
1238  virtual bool recreateItemsNeededFromHandoff();
1240 
1244  virtual void cleanupItemsNeededForReinitialize();
1245 
1252  virtual bool reinitialize();
1253 
1254 protected:
1258  static void logToFileCallback(const DtVrfObjectMessage* msg, void* usr);
1259  virtual void processLogToFile(const DtVrfObjectMessage* msg);
1260 
1261  static void stopLoggingToFileCallback(const DtVrfObjectMessage* msg, void* usr);
1262  virtual void processStopLoggingToFile(const DtVrfObjectMessage* msg);
1264 
1265  virtual void createNavigationDecorator() override;
1266 
1268  {
1269  public:
1270  typedef std::vector<SimObjectCallback> Vector;
1271 
1273 
1275  : object(obj)
1276  {
1277  }
1278 
1279  virtual void run() override;
1280  };
1281 
1282 public:
1285 
1289  virtual void addScriptExtension(DtLuaScriptInterfaceExtension::CreatorFcn extension, void* usr);
1291  virtual void removeScriptExtension(DtLuaScriptInterfaceExtension::CreatorFcn extension, void* usr);
1295  virtual const ScriptInterfaceExtensions& scriptExtensions() const;
1297 
1301  virtual void setupFromMessageContent(const DtIfModifyVrfObject* ifModVrfObject);
1306  virtual bool validNameLength(const DtString& name) const;
1307 
1308  static bool shouldArchiveExtendedAttribute(const DtString& s);
1309  static void doNotArchiveAttribute(const DtString& s, bool b);
1310 
1314  virtual void sendVrfObjectCreated(unsigned long requestId = 0, bool requestCreated = true);
1315 
1317  virtual void setIsInMovementFlux(bool, const DtVector& proposedLocation = DtVector::zero());
1318 
1320  boost::signals2::signal<void (DtLocalObject*)> signal_postInitFromParams;
1321 
1322 protected:
1323  virtual void setupStateRepository();
1324  virtual void internalStateInitializedFromParameters();
1325 
1330  virtual bool createCommunicationsInterface();
1331  virtual void initializeCommunicationInterfaceCallbacks();
1332  static void setOverlayLayerTaskCallback(const DtVrfObjectMessage* msg, void* usr);
1333  virtual void processSetOverlayLayerTask(const DtVrfObjectMessage* msg);
1334 
1335  virtual bool createScriptInterfaceHandler();
1336 
1337  virtual bool createComponentManager();
1338 
1340  virtual bool initializeComponentManager();
1341 
1342  virtual bool createRadio();
1343  virtual bool createVrfObjectPlanManager();
1344  virtual bool createSetDataManager();
1345 
1346  virtual void tickDecorators();
1347 
1349  void createRemotelyControlledLocalObject();
1350  virtual void completeSetup() override;
1351 
1352 protected:
1353  virtual bool createTaskManager();
1354 
1357  virtual void createCommunicationsInterface(const DtRadioDescriptorList& descList);
1358 
1361  virtual void updateEntityHasTarget();
1362 
1363 protected:
1365  virtual void setUUID(const DtUUID&) override;
1366 
1367  virtual void convertedToRemote();
1368 
1370  virtual std::map<DtString, DtString> unarchivedData();
1371 
1372  virtual void clearDecorators() override;
1373 
1375  virtual void usingParameterSource(const DtString&) override;
1376 
1378  virtual void setupVrfObjectParameters() override;
1379 
1380  void cacheNextFrameComponents();
1381  void clearNextFrameCachedComponents();
1382 
1383  virtual void hostChanged(const DtUUID& oldHost, const DtUUID& newHost) override;
1384 
1385  virtual void isClutterChanged() override;
1386 
1388  virtual void setupExtendedDataFromParameterData();
1389 
1391  virtual bool canBePlaced() const;
1392 
1393 protected:
1395  DtLocalObject(const DtLocalObject& orig);
1396 
1398  DtLocalObject& operator=(const DtLocalObject& orig);
1399 
1400 protected:
1412 
1414 
1419  typedef std::map<std::string, DtLocalObjectDecorator*> LocalObjectDecorators;
1422 
1423  boost::signals2::scoped_connection myConvertedToRemoteConnection;
1425 
1428 
1432  static std::set<DtString> theDoNotArchiveAttributes;
1433 
1435 
1437 
1440 
1443 
1446 
1451  bool myIsEnvironmental = false;
1452 
1456 
1459 
1462 
1465 
1468 
1471 
1474 
1477 
1480 
1482  typedef std::map<int, int> OperationsInProgressCount;
1483 
1486 
1492  int myFluxIndex = -1;
1493 
1496 
1498  DtPlan* myReinitializePlan = nullptr;
1499 
1500 public:
1507  VRF4API_METHOD DtVrfObjectStateRepository* vrfState() { return internalState(); };
1512  VRF4API_METHOD const DtVrfObjectStateRepository* vrfState() const { return internalState(); };
1517  VRF4API_METHOD void setObjectIdentifier(const DtEntityIdentifier& id) { setNextFrameEntityId(id); };
1524  VRF4API_METHOD void place(const DtReal heading, bool* dataAvailable = 0,
1525  bool requireAllData = false);
1526 
1533  VRF4API_METHOD void place(const DtVector& heading, bool* dataAvailable = 0,
1534  bool requireAllData = false);
1539  VRF4API_METHOD bool isVrfSimulated() const { return nextFrameIsVrfSimulated(); };
1543  VRF4API_METHOD void invokeSetLocationCompleteCallbacks() { return setLocationComplete(); };
1545 };
1546 
unsigned int StateComponentType
Definition: stateComponent.h:56
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:64
boost::signals2::signal< void()> signal_objectInitialized
Signal sent at the very end of the init() method.
Definition: localObject.h:878
Definition: scriptInterfaceHandler.h:18
VRF4API_METHOD void invokeSetLocationCompleteCallbacks()
Invokes callbacks when location setting is complete.
Definition: localObject.h:1543
T_Component * getNextFrameStateComponent()
Template method to retrieve any state component that does not have a dedicated accessor method...
Definition: localObject.h:130
Indicates handoff process should be aborted.
Definition: localObject.h:80
1) Define the interface class that will be used to represent the next and curent frames. The UNDEFINED_ macros are convenience macros that will define methods that throw exceptions (until they are implemented)
Definition: statePropertiesStateComponent.h:93
virtual VRF4API_METHOD void setupExtendedDataFromParameterData()
If publishing parameter data also include that in the extended data map by name.
Definition: stateDataTypes.h:23
This class is used to interface with the terrain a particular entity is &quot;attached&quot; to...
Definition: attachedTerrain.h:57
DtSimObjectDecorator * getOrCreateDecorator(const std::string &Decorator) const
This will get or create a decorator based on the decorator name. This is not virtual such that the Dt...
OperationsInProgressCount myOperationsInProgressCount
Map tracking the count of various operations in progress.
Definition: localObject.h:1485
boost::signals2::signal< void(const DtLocalObject *, ChangeFlag)> signal_objectDataChanged
Signal sent when certain data has changed in this class from being set by the API, not from the network.
Definition: localObject.h:899
virtual void completeSetup() override
bool myCreatedStateData
Definition: localObject.h:1413
makVrf::DtVrfStateComponent * myNextFrameVrfStateComponent
Component that stores VRF-specific state for the next frame.
Definition: localObject.h:1467
bool myInitializing
Definition: localObject.h:1429
boost::signals2::signal< void()> signal_resourceChangedBySet
Notifies listeners that resources have changed.
Definition: localObject.h:869
const DtSimulationServices * mySimulationServices
Definition: simObject.h:238
1) Define the interface class that will be used to represent the next and curent frames. The UNDEFINED_ macros are convenience macros that will define methods that throw exceptions (until they are implemented)
Definition: radioTransmitterStateComponent.h:140
boost::signals2::signal< void()> signal_restored
Signal emitted when the object has been restored.
Definition: localObject.h:896
std::map< int, int > OperationsInProgressCount
Type definition for tracking operations in progress.
Definition: localObject.h:1482
VRF4API_METHOD const DtVrfObjectStateRepository * vrfState() const
Retrieves the internal state repository (const version)
Definition: localObject.h:1512
ChangeFlag
Definition: localObject.h:112
The DtLocationStateComponent interface contains the interface that all DtLocationStateComponents can ...
Definition: locationStateComponent.h:25
boost::signals2::signal< void()> signal_postUpgradeFromImport
Signal sent when upgrading from import. This will be called after any internal routines are called...
Definition: localObject.h:875
virtual void setIsRemoteComponent(bool b)
Definition: stateComponent.h:136
Definition: simRadio.h:30
bool mySimulationCapable
Whether or not this object is capable of simulating. Default is true.
Definition: localObject.h:1445
DtVrfObjectTerrainPreloadManager * myTerrainPreloadManager
Definition: localObject.h:1405
DtSimObjectReference myNextFrameSimObjectEmbarkedOn
Reference to the object this object will be embarked on in the next frame.
Definition: localObject.h:1476
Definition: localObject.h:115
void tickDecorators()
The DtSimulatedObjectStateComponent is an interface that all main components (those that are consider...
Definition: simulatedObjectStateComponent.h:21
DtSetDataManager * mySetDataManager
Definition: localObject.h:1411
VRF4API_METHOD DtReal heading() const
Heading in radians.
boost::signals2::signal< void(DtLocalObject *)> signal_objectModifiedViaMessage
Signal sent when this object is modified via a message.
Definition: localObject.h:884
DtSimComponentManager * myComponentManager
Definition: localObject.h:1409
virtual void makeInvalid() override
Make this invalid by clearing the myExternalCurrentFrameState. This will also set the myIsDeleted fla...
virtual void clearDecorators()
This code will keep track of DtSimObject decorator only. The DtLocalObject will be able to use this d...
Definition: localObject.h:116
T_Component * addStateComponent(bool checkWritable=false, bool isRemote=false)
Adds a state component of the specified template type.
Definition: localObject.h:664
bool myConvertingToRemote
Will be true if this object is in the process of converting from local to remote. ...
Definition: localObject.h:1442
LocalObjectDecorators myLocalObjectDecorators
Definition: localObject.h:1420
class DtSimResourceManager:
Definition: simResourceManager.h:19
virtual void createNavigationDecorator()
Failure to recreate object for local usage, requiring object deletion.
Definition: localObject.h:82
DtRwProperties * myDefaultStateProperties
Default state properties storage.
Definition: localObject.h:1455
boost::signals2::signal< void(DtLocalObject *)> signal_postInitFromParams
Signal sent right after the internal state is initialized from parameters.
Definition: localObject.h:1320
Definition: simObjectStateRepository.h:59
Stage after converting object to remote representation.
Definition: localObject.h:74
Definition: stateData.h:139
bool myHasTarget
Definition: localObject.h:1447
The DtLocalObjectCreateInformation class is a subset of the information used in the DtIfCreateVrfObje...
Definition: vrfLocalObjectCreateInformation.h:26
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:91
const T_Component * getNextFrameStateComponent() const
Template method to retrieve any state component that does not have a dedicated accessor method...
Definition: localObject.h:137
DtSimRadio * myRadio
Definition: localObject.h:1406
bool convertingToLocal() const
Definition: localObject.h:645
bool convertingToRemote() const
Definition: localObject.h:651
boost::signals2::signal< void()> signal_preObjectReinitialize
Called before/after object reinitialization.
Definition: localObject.h:861
Definition: settingsObject.h:27
1) Define the interface class that will be used to represent the next and curent frames. The UNDEFINED_ macros are convenience macros that will define methods that throw exceptions (until they are implemented)
Definition: vrfGeometryStateComponent.h:54
std::shared_ptr< CallbackInterface > Ptr
Definition: vrfCallbackQueue.h:61
boost::signals2::signal< void(DtLocalObject *)> signal_newSensorContact
Signal made available from this object to be used when a new sensor contact is made available for thi...
Definition: localObject.h:887
Interface class used to define minimal interface for a property. The DtPropertyInterface class provid...
Definition: propertyInterface.h:53
virtual void setUUID(const DtUUID &) override
class DtIfModifyVrfObject:
Definition: ifModifyVrfObject.h:50
boost::signals2::scoped_connection myConvertedToRemoteConnection
Definition: localObject.h:1423
DtLocalObject * object
Definition: localObject.h:1272
const DtSimulationServices * simulationServices() const
Definition: simObject.h:143
List of DtRadioDescriptor subclasses that can be read from a RW type file. This class owns all descri...
Definition: radioDescriptorList.h:27
const makVrf::DtStatePropertiesStateComponent * myCurrentFrameStatePropertiesStateComponent
Component that stores properties state for the current frame.
Definition: localObject.h:1473
int myNextEmitterSystemId
Definition: localObject.h:1431
VRF4API_METHOD void setObjectIdentifier(const DtEntityIdentifier &id)
Sets the entity identifier.
Definition: localObject.h:1517
boost::signals2::signal< void(bool success)> signal_postObjectReinitialize
Called before/after object reinitialization.
Definition: localObject.h:862
boost::signals2::signal< void(const DtLocalObject *)> signal_localObjectAboutToBeDeleted
Signal sent when a local object is about to be deleted.
Definition: localObject.h:902
const DtRwProperties & stateProperties() const
makVrf::DtExternalNextFrameState * myExternalNextFrameState
Definition: localObject.h:1403
DtVrfObjectSubComponentTypes.
Definition: vrfObjectSubComponentTypes.h:25
1) Define the interface class that will be used to represent the next and curent frames. The UNDEFINED_ macros are convenience macros that will define methods that throw exceptions (until they are implemented)
Definition: vrfStateComponent.h:62
DtStateComponent * getStateComponent(int index=0)
Definition: stateData.h:622
virtual void hostChanged(const DtUUID &oldHost, const DtUUID &newHost)
This class represents the console for an individual object. It owns a set of streams for various noti...
Definition: objectConsole.h:49
std::map< std::string, DtLocalObjectDecorator * > LocalObjectDecorators
Definition: localObject.h:1419
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:398
boost::signals2::signal< void(DtLocalObject *)> signal_setLocationComplete
Signal sent when the location has been changed by an interface content message.
Definition: localObject.h:893
API for writing callbacks.
Definition: vrfCallbackQueue.h:55
1) Define the interface class that will be used to represent the next and curent frames. The UNDEFINED_ macros are convenience macros that will define methods that throw exceptions (until they are implemented)
Definition: laserDesignatorStateComponent.h:61
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
boost::signals2::signal< void()> signal_objectRestored
Signal sent after the object has been restored from the stream.
Definition: localObject.h:881
virtual void usingParameterSource(const DtString &)
Called when the parameter is set up, this is the source it is using.
SimObjectCallback(DtLocalObject *obj)
Definition: localObject.h:1274
HandoffFlag
Enumeration defining the stages of an object handoff process.
Definition: localObject.h:66
1) Define the interface class that will be used to represent the next and curent frames. The UNDEFINED_ macros are convenience macros that will define methods that throw exceptions (until they are implemented)
Definition: activeSonarStateComponent.h:286
virtual void setupVrfObjectParameters()
std::list< DtLuaScriptInterfaceExtension::CreatorUserPair > ScriptInterfaceExtensions
Definition: localObject.h:1087
DtSimTaskManager * myTaskManager
Definition: localObject.h:1407
If inheriting from a base sim object proxy.
Definition: localObjectFacadeBase.h:32
class DtVertexList:
Definition: vertexList.h:22
DtVrfCallbackQueue::CallbackInterface::Ptr myParallelContainer
Container for managing parallel callbacks.
Definition: localObject.h:1495
std::vector< SimObjectCallback > Vector
Definition: localObject.h:1270
Stage before converting object to remote representation.
Definition: localObject.h:72
Definition: localObject.h:118
makVrf::DtSimulatedObjectStateComponent * myNextFrameSimulatedObjectStateComponent
Component that stores simulation state for the next frame.
Definition: localObject.h:1461
boost::signals2::signal< void(DtLocalObject *, DtVrfObjectHandoffData::HandoffFlag)> signal_handoffStep
Signal sent with object handoff flags for this object given the handoff state.
Definition: localObject.h:1068
makVrf::DtLocationStateComponent * myNextFrameLocationStateComponent
Component that stores location information for the next frame.
Definition: localObject.h:1458
DtMovementLocalObjectFacade * myMovementLocalObjectFacade
Facade for managing movement-related operations.
Definition: localObject.h:1479
DtSimBoundingGeometryType
Definition: simBoundingGeometry.h:61
static DtLocalObjectCreatorFcn theLocalObjectCreatorFunction
Definition: localObject.h:1424
The base class for all messages to/from a specific DtVrfObject. Various subclasses of this class will...
Definition: vrfObjectMessage.h:30
This class maintains a rectangular bounding volume and an ordered list of vertices describing the phy...
Definition: vrfObjectGeometry.h:39
bool myInitialized
Definition: localObject.h:1430
Definition: asyncJobServer.h:39
class DtVrfObjectPlanManager:
Definition: vrfObjectPlanManager.h:38
1) Define the interface class that will be used to represent the next and curent frames. The UNDEFINED_ macros are convenience macros that will define methods that throw exceptions (until they are implemented)
Definition: emitterSystemStateComponent.h:466
Definition: echelonId.h:13
class DtPlan:
Definition: plan.h:92
virtual void isClutterChanged()
Definition: localObject.h:1267
virtual void place(const DtVector &location, bool *dataAvailable=nullptr, bool requireAllData=false)
Place entity at &#39;location&#39;, on the ground, keeping its current heading. Since no terrain intersection...
Definition: stateComponent.h:52
This manager is on a per-DtLocalObject level, and is responsible for knowing what terrain areas an ob...
Definition: vrfObjectTerrainPreloadManager.h:36
Class Description: DtSimTaskManager manages the bookkeeping associated with starting, completing, clearing, and skipping tasks.
Definition: simTaskManager.h:55
makVrf::DtStatePropertiesStateComponent * myNextFrameStatePropertiesStateComponent
Component that stores properties state for the next frame.
Definition: localObject.h:1470
1) Define the interface class that will be used to represent the next and curent frames. The UNDEFINED_ macros are convenience macros that will define methods that throw exceptions (until they are implemented)
Definition: radioReceiverStateComponent.h:64
The DtSimComponentManager is the top level class within a DtSimObject which owns and manages all the ...
Definition: simComponentManager.h:31
DtLuaScriptInterfaceExtension *(* CreatorFcn)(void *usr)
Prototype for DtLuaScriptInterfaceExtension creator function.
Definition: luaScriptInterfaceExtension.h:37
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:96
Stage before converting object to local representation.
Definition: localObject.h:76
DtVrfObjectStateRepository * myInternalState
Definition: localObject.h:1401
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:80
The central class of a DtLocalObject for all communications to and from the object. This class manages all communications on a specific DtLocalObject, though both simulation internal communication, and communication though the simulated radios of the object. All communication is done though the use of the DtVrfObjectMessage class and its subclasses. Callbacks can be registered on this interface which will be called on receipt of a message by this entity. Messages can be sent from this entity by using the message sending functions. These messages may be sent though the SimInternal message mechanism, or the radio message system. Radios will not exist until createRadiosFromDescriptorList() or createRadiosFromDescriptorList(const DtRadioDescriptorList&amp; descList) is called.
Definition: vrfObjectCommunicationInterface.h:40
Stage after converting object to local representation.
Definition: localObject.h:78
This class manages the distribution of DtSetDataRequests within a single DtLocalObject. Components of the object, or other parts of the code, register interested in particular types of set data messages and when such a message is processed by the DtSetDataManager, each of the registered parties is notified.
Definition: setDataManager.h:48
bool initialized() const
Definition: localObject.h:1212
DtScriptInterfaceHandler * myScriptInterfaceHandler
Definition: localObject.h:1408
1) Define the interface class that will be used to represent the next and curent frames. The UNDEFINED_ macros are convenience macros that will define methods that throw exceptions (until they are implemented)
Definition: navAidRadioTransmitterStateComponent.h:20
DT_DLL_VRVCORE double length(const makVrv::DtCoordinateSystem &, const std::vector< DtVector > &vertices)
Returns the total distance of a segmented line defined by the provided vector of vertices. Coordinates are in local database coordinates. The coordinate system is used to convert between the local database coordinates and geocentric. All distance is in 2D – the Z value is ignored.
DtLuaScriptInterfaceExtension.
HandoffFlag handoffFlag
Current state of the handoff process.
Definition: localObject.h:86
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
boost::signals2::signal< void(DtLocalObject *)> signal_navigationAreaChanged
Signal made available from this object to be used when the navigation area this object is in has chan...
Definition: localObject.h:890
makVrf::DtVrfGeometryStateComponent * myNextFrameVrfGeometryStateComponent
Component that stores geometry information for the next frame.
Definition: localObject.h:1464
DtLocalObject *(* DtLocalObjectCreatorFcn)(DtSimulationServices *, const DtVrfLocalObjectCreateInformation &)
Definition: localObject.h:60
bool mySignalLocationComplete
Definition: localObject.h:1450
DtStateDataWrapper & operator=(const DtUUID &)
DtVrfCallbackQueue::CallbackInterface::Ptr parallelContainer()
Definition: localObject.h:1217
1) Define the interface class that will be used to represent the next and curent frames. The UNDEFINED_ macros are convenience macros that will define methods that throw exceptions (until they are implemented)
Definition: underwaterAcousticsStateComponent.h:106
bool myControllersTicked
Definition: localObject.h:1448
Definition: localObject.h:117
DtVrfObjectCommunicationInterface * myCommunicationInterface
Definition: localObject.h:1404
A list of properties. A DtPropertyInterface object that is a specialized version of DtRwVariableBindi...
Definition: rwProperties.h:122
DtVrfLocalObjectCreateInformation * myLocalObjectCreateInformation
Information used to originally create this object.
Definition: localObject.h:1427
Initial preparation stage. If handoff is not desired, set flag to Abort. Otherwise, this flag indicates the current handoff step.
Definition: localObject.h:70
boost::signals2::signal< void()> signal_preUpgradeFromImport
Signal sent when upgrading from import. This will be called before any internal routines are called...
Definition: localObject.h:872
ReinitializeFlags
Prepares this object for reinitialization. This means: 1) Making sure the systems are set to read onl...
Definition: localObject.h:1113
1) Define the interface class that will be used to represent the next and curent frames. The UNDEFINED_ macros are convenience macros that will define methods that throw exceptions (until they are implemented)
Definition: iffStateComponent.h:83
bool myConvertingToLocal
Will be true if this object is in the process of converting from remote to local. ...
Definition: localObject.h:1439
class DtLocalVertexList:
Definition: localVertexList.h:20
bool mySkipNextComponentTick
Definition: localObject.h:1449
1) Define the interface class that will be used to represent the next and current frames...
Definition: taskVisualizationStateComponent.h:260
Contains the DtStateComponent class declaration.
bool isValid() const
Returns true if myExternalCurrentFrameState is not nullptr. Not virtual on purpose as even though loc...
#define VRF4API_METHOD
Include this header file to allow for the definition/usage of the ability to mark something as deprec...
Definition: vrf4XAPI.h:23
VRF4API_METHOD DtVrfObjectStateRepository * vrfState()
These are backwards compatible methods that can be used if you define ALLOW_VRF4API in your header fi...
Definition: localObject.h:1507
DtAppearanceLocalObjectFacade * myAppearanceLocalObjectFacade
Definition: localObject.h:1434
ScriptInterfaceExtensions myScriptInterfaceExtensions
Definition: localObject.h:1436
DtVrfObjectSubComponentTypes * mySubComponentTypes
Definition: localObject.h:1402
This is a simple base class that will be used to return a pointer to current or next frame state...
Definition: stateComponent.h:294
Structure containing data for object handoff operations.
Definition: localObject.h:63
static std::set< DtString > theDoNotArchiveAttributes
Definition: localObject.h:1432
virtual bool isLocal() const
Returns true if this object is a locally simulated object.
VRF4API_METHOD bool isVrfSimulated() const
Determines if this object is being simulated by VRF.
Definition: localObject.h:1539
DtVrfObjectPlanManager * myVrfObjectPlanManager
Definition: localObject.h:1410
boost::signals2::signal< void(DtLocalObject *, DtVrfObjectHandoffData &)> signal_prepareForHandoff
Signal sent when preparing for object handoff.
Definition: localObject.h:1078
Definition: decoratorBase.h:44
A locally simulated VRF object.
Definition: localObject.h:98

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)