15 #include <boost/signals2.hpp>
16 #include <matrix/vlVector.h>
19 #include <vlpi/appearance.h>
20 #include <vlpi/disEnums.h>
21 #include <matrix/vlDcm.h>
22 #include <matrix/vlTaitBryan.h>
25 #include <tbb/spin_rw_mutex.h>
31 class DtIffStateComponent;
32 class DtLaserDesignatorStateComponent;
33 class DtExternalCurrentFrameState;
34 class DtStatePropertiesStateComponent;
36 class DtStateDataManager;
37 class DtVrfObjectGeometry;
38 class DtRwVrfKinematicState;
97 const DtUUID& uuid()
const;
103 DtEntityType entityType()
const;
107 unsigned long long userData()
const;
113 std::map<DtString, DtString> extendedDataMap()
const;
115 std::map<std::string, std::string> extendedDataStdStringMap()
const;
118 bool hasExtendedData(
const DtString& key)
const;
122 DtAppearance appearance()
const;
124 int capabilities()
const;
126 DtEntityType guise()
const;
136 bool isClutterEntity()
const;
140 virtual Dt3dBoundingVolume boundingVolume()
const;
144 std::vector<const DtLaserDesignatorStateComponent*> laserDesignatorStateComponents()
const;
153 bool isSpotReport()
const;
156 bool awaitingTransfer()
const;
161 if (myExternalCurrentFrameState)
172 template <
typename T_Component>
175 if (myExternalCurrentFrameState)
177 return myExternalCurrentFrameState->getStateComponent<T_Component>();
185 template <
typename T_Component>
188 if (myExternalCurrentFrameState)
190 return myExternalCurrentFrameState->getStateComponentList<T_Component>();
193 return std::vector<const T_Component*>();
197 template <
typename T_Component>
200 if (myExternalCurrentFrameState)
202 return myExternalCurrentFrameState->hasStateComponent<T_Component>();
216 const DtVector& worldPosition()
const;
218 const DtVector& localPosition()
const;
220 const DtVector& parentPosition()
const;
224 double distSquaredTo(
const DtVector&)
const;
227 bool hasLocationChanged()
const;
231 bool objectVerticesChanged()
const;
235 bool worldVerticesChanged()
const;
238 bool haveVerticesChanged()
const;
241 virtual void frameAdvanced();
243 virtual void firstFrameAdvance();
252 DtUUID hostGlobalId()
const;
258 const DtTaitBryan& topographicOrientation()
const;
260 const DtTaitBryan& worldOrientation()
const;
262 const DtTaitBryan& localOrientation()
const;
264 const DtTaitBryan& parentOrientation()
const;
266 const DtTaitBryan& localOrientationWrtDatabase()
const;
268 const DtDcm& localOrientationMatrix()
const;
270 const DtDcm& parentOrientationMatrix()
const;
272 const DtDcm& worldOrientationMatrix()
const;
274 double heading()
const;
276 double pitch()
const;
282 DtForceType forceType()
const;
285 const DtEntityIdentifier& entityId()
const;
293 DtSimulationAddress simEngineAddress()
const;
296 bool isDestroyed()
const;
298 int damageState()
const;
310 bool isEntityOrUnit()
const;
315 bool isEntity()
const;
319 bool isEmbarked()
const;
322 DtUUID embarkedOn()
const;
325 bool isEmbarkedOn(
const DtUUID&)
const;
330 virtual bool checkValidity()
const;
332 #if defined(WIN32) || defined(_WIN32)
333 __declspec(deprecated(
"Method is deprecated. If this is a DtSimObjectReference use the ref.isValid() check instead."))
bool isValid()
const {
return checkValidity(); };
337 int sessionId()
const;
339 bool isVrfSimulatedObject()
const;
341 bool isCurrentlyTasked()
const;
343 bool isExecutingPlan()
const;
345 bool hasPlan()
const;
347 bool independentlyTasked()
const;
349 bool underFire()
const;
357 bool isDeleted()
const;
360 virtual void makeInvalid();
365 std::vector<DtVector> localVertexList()
const;
370 std::vector<DtVector> worldVertexList()
const;
375 std::vector<DtVector> relativeVertexList()
const;
378 unsigned long long legionGlobalId()
const;
383 return myAdvancedFrame;
387 DtUUID superiorUUID()
const;
390 bool isTopLevel()
const;
395 return myExternalCurrentFrameState;
413 mutable boost::signals2::signal<void (const DtUUID& oldUUID, const DtUUID& newUUID)>
signal_uuidChanged;
445 if (myCurrentFrameSimulatedObjectStateComponent)
447 return myCurrentFrameSimulatedObjectStateComponent;
449 else if (!myCachedComponents && hasStateComponent<DtSimulatedObjectStateComponent>())
451 return getStateComponent<DtSimulatedObjectStateComponent>();
462 if (myCurrentFrameLocationStateComponent)
464 return myCurrentFrameLocationStateComponent;
466 else if (!myCachedComponents && hasStateComponent<DtLocationStateComponent>())
468 return getStateComponent<DtLocationStateComponent>();
479 if (myCurrentFrameStatePropertiesStateComponent)
481 return myCurrentFrameStatePropertiesStateComponent;
483 else if (!myCachedComponents && hasStateComponent<DtStatePropertiesStateComponent>())
485 return getStateComponent<DtStatePropertiesStateComponent>();
496 if (myCurrentFrameVrfGeometryStateComponent)
498 return myCurrentFrameVrfGeometryStateComponent;
500 else if (!myCachedComponents && hasStateComponent<DtVrfGeometryStateComponent>())
502 return getStateComponent<DtVrfGeometryStateComponent>();
513 return myCurrentFrameEntityStateComponent;
519 if (myCurrentFrameVrfStateComponent)
521 return myCurrentFrameVrfStateComponent;
523 else if (!myCachedComponents && hasStateComponent<DtVrfStateComponent>())
525 return getStateComponent<DtVrfStateComponent>();
534 std::set<int> currentFrameModifiedStateComponentTypes()
const;
536 std::set<int> nextFrameModifiedStateComponentTypes()
const;
544 virtual void cacheComponents();
546 virtual void clearCachedComponents();
553 virtual void setUUID(
const DtUUID&);
556 bool checkAndConnectForVrfStateComponent();
565 virtual void objectNameChanged(
const DtString& oldText,
const DtString& newText);
568 virtual void completeSetup();
570 virtual void extendedDataUpdated();
572 virtual void superiorChanged();
574 virtual void isClutterChanged();
577 virtual void externalFrameStateToBeDestroyed();
587 virtual void simEngineAddressChanged(
const DtSimulationAddress& oldAddress,
const DtSimulationAddress& newAddress);
const DtSimulatedObjectStateComponent * currentFrameSimulatedObjectStateComponent() const
Definition: stateDataWrapper.h:443
UUID is a unique ID wrapper class.
Definition: uuid.h:59
boost::signals2::scoped_connection mySuperiorChangedConnection
Connection to signal_superiorChanged on the tracked state data.
Definition: stateDataWrapper.h:610
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:106
DtUUID myEmbarkedOn
UUID of the host object this object is embarked on, or null UUID if not embarked. ...
Definition: stateDataWrapper.h:644
boost::signals2::scoped_connection myExtendedDataUpdatedConnection
Connection to signal_extendedDataUpdated on the tracked state data.
Definition: stateDataWrapper.h:606
DtUUID mySuperiorUUID
UUID of this object's superior unit, or null UUID if it has no superior.
Definition: stateDataWrapper.h:636
const DtUUID & uuid() const
Convenience accessors for various pieces of state data.
DtStateDataWrapper & operator=(const DtStateDataWrapper &rhs)
Reassigns this wrapper to refer to the same simulation object as rhs.
Definition: stateDataWrapper.h:82
The DtLocationStateComponent interface contains the interface that all DtLocationStateComponents can ...
Definition: locationStateComponent.h:25
bool operator!=(const DtUUID &rhs) const
Returns true if this wrapper does not refer to the simulation object with the given UUID...
Definition: stateDataWrapper.h:90
Abstract base interface for the entity state component.
Definition: entityStateComponent.h:141
const DtStatePropertiesStateComponent * myCurrentFrameStatePropertiesStateComponent
Cached state properties component pointer for the current frame; nullptr if absent.
Definition: stateDataWrapper.h:657
DtUUID myUUID
Once assigned, the UUID of this object. This will be valid even after the object is deleted...
Definition: stateDataWrapper.h:623
The DtSimulatedObjectStateComponent is an interface that all main components (those that are consider...
Definition: simulatedObjectStateComponent.h:21
DT_DLL_VRFGUICORE bool operator==(const std::vector< makArchives::DtEnvironmentRecord::DtElevationalConfigurationRecord > &lhs, const std::vector< makArchives::DtEnvironmentRecord::DtElevationalConfigurationRecord > &rhs)
boost::signals2::scoped_connection myAddedConnection
Connection to signal_stateDataAdded on the state data manager (used while awaiting).
Definition: stateDataWrapper.h:600
bool isSimulatedObject() const
Returns true if this object is an entity or aggregate unit (not environmental); synonym for isEntityO...
Definition: stateDataWrapper.h:312
const DtLocationStateComponent * myCurrentFrameLocationStateComponent
Cached location state component pointer for the current frame; nullptr if absent. ...
Definition: stateDataWrapper.h:653
const DtLocationStateComponent * currentFrameLocationStateComponent() const
Definition: stateDataWrapper.h:460
boost::signals2::signal< void()> signal_extendedDataUpdated
Signal sent out (during advance frame) when the extended data has been updated.
Definition: stateDataWrapper.h:404
Contains the DtUUID class declaration.
boost::signals2::scoped_connection myObjectNameChangedConnection
Connection to signal_objectNameChanged on the tracked state data.
Definition: stateDataWrapper.h:604
const T_Component * getStateComponent() const
Returns the single state component of the given type, if present. Use this for components that do not...
Definition: stateDataWrapper.h:173
const DtExternalFrameStateInterface * externalCurrentFrameState() const
Definition: stateDataWrapper.h:393
const DtVrfStateComponent * currentFrameVrfStateComponent() const
Definition: stateDataWrapper.h:517
boost::signals2::signal< void()> signal_firstFrameAdvance
Signal when the frame is advanced for the first time.
Definition: stateDataWrapper.h:439
boost::signals2::signal< void(DtStateComponent *)> signal_stateComponentRemoved
Signal sent when a state component is removed from this object.
Definition: stateDataWrapper.h:430
const DtSimulatedObjectStateComponent * myCurrentFrameSimulatedObjectStateComponent
Cached simulated object state component pointer for the current frame; nullptr if absent...
Definition: stateDataWrapper.h:647
bool operator!=(const DtStateDataWrapper &rhs) const
Returns true if this wrapper does not refer to the same simulation object as rhs. ...
Definition: stateDataWrapper.h:92
boost::signals2::signal< void()> signal_isClutterChanged
Signal sent out (during advance frame) when the is-clutter flag has been updated. ...
Definition: stateDataWrapper.h:425
boost::signals2::scoped_connection myStateComponentRemovedConnection
Connection to signal_stateComponentRemoved on the tracked state data.
Definition: stateDataWrapper.h:596
1) Define the interface class that will be used to represent the next and current frames...
Definition: vrfGeometryStateComponent.h:65
const DtEntityIdentifier & objectIdentifier() const
Definition: stateDataWrapper.h:287
bool advancedFrame() const
Will be true if this object has advanced at least one frame.
Definition: stateDataWrapper.h:381
boost::signals2::signal< void(DtStateComponent *)> signal_stateComponentAdded
Signal sent when a state component is added to this object.
Definition: stateDataWrapper.h:428
boost::signals2::signal< void()> signal_objectVerticesChanged
Signal sent when the user changes the vertices via a set command. If this is a remote object...
Definition: stateDataWrapper.h:401
boost::signals2::signal< void(const DtString &)> signal_discoveredReference
Signal sent if this was awaiting for the base data to show up, and, it has.
Definition: stateDataWrapper.h:410
boost::signals2::scoped_connection myIsClutterChangedConnection
Connection to signal_isClutterChanged on the tracked state data.
Definition: stateDataWrapper.h:614
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:72
const DtStateDataManager * myStateDataManager
The state data manager used to resolve UUID and entity identifier lookups.
Definition: stateDataWrapper.h:667
boost::signals2::scoped_connection myAdvancedFrameConnection
Connection to signal_frameAdvanced on the tracked state data.
Definition: stateDataWrapper.h:612
boost::signals2::signal< void(const DtSimulationAddress &oldAddr, const DtSimulationAddress &newAddr)> signal_simEngineAddressChanged
Signal sent when the backend hosting this object has changed. Sent during a frame advance...
Definition: stateDataWrapper.h:416
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:513
boost::signals2::scoped_connection myDeletedConnection
Connection to signal_externalFrameStateToBeDestroyed on the current frame state.
Definition: stateDataWrapper.h:598
DtString awaiting() const
If awaiting, who awaiting for.
Definition: stateDataWrapper.h:147
bool hasStateComponent() const
Returns true if this object currently has a state component of the given type.
Definition: stateDataWrapper.h:198
const DtStateData * stateData() const
Definition: stateDataWrapper.h:246
class DtVertexList:
Definition: vertexList.h:22
DtEntityType myEntityType
Cached entity type used for debug and logging; updated when the object is resolved.
Definition: stateDataWrapper.h:633
boost::signals2::signal< void()> signal_simObjectDeleted
Signal sent when this simulation object has been deleted from the exercise.
Definition: stateDataWrapper.h:407
bool isModified() const
Returns true if the underlying state data was modified during the current simulation frame...
Definition: stateDataWrapper.h:159
const DtEntityStateComponent * myCurrentFrameEntityStateComponent
Cached entity state component pointer for the current frame; nullptr if absent.
Definition: stateDataWrapper.h:651
Read-only view of the current (committed) frame state components within a DtStateData. Safe to access from any thread once the frame has been advanced.
Definition: stateData.h:391
This class maintains a rectangular bounding volume and an ordered list of vertices describing the phy...
Definition: vrfObjectGeometry.h:39
boost::signals2::scoped_connection myUUIDChangedConnection
Connection to signal_uuidChanged on the tracked state data.
Definition: stateDataWrapper.h:602
Definition: echelonId.h:13
bool operator==(const DtStateDataWrapper &rhs) const
Returns true if this wrapper refers to the same simulation object as rhs.
Definition: stateDataWrapper.h:87
const DtVrfGeometryStateComponent * currentFrameVrfGeometryStateComponent() const
Definition: stateDataWrapper.h:494
Definition: stateComponent.h:52
boost::signals2::signal< void(const DtString &oldName, const DtString &newName)> signal_objectRenamed
Signal sent when the uuid of this object has changed. Sent during a frame advance.
Definition: stateDataWrapper.h:419
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: stateDataWrapper.h:49
const DtEntityStateComponent * currentFrameEntityStateComponent() const
Definition: stateDataWrapper.h:511
DtEntityType objectType() const
Definition: stateDataWrapper.h:105
DtString myObjectName
This is for debug purposes only. It will get set when the bounding volume is checked (and locked) and...
Definition: stateDataWrapper.h:631
unsigned long long myLegionGlobalId
Internal 64-bit legion global handle; initialized to 0xFFFFFFFFFFFFFFFF until resolved.
Definition: stateDataWrapper.h:625
boost::signals2::scoped_connection myFirstFrameAdvancedConnection
Connection to signal_firstFrameAdvance on the tracked state data.
Definition: stateDataWrapper.h:608
boost::signals2::scoped_connection mySimEngineAddressChangedConnection
Connection to signal_simEngineAddressChanged on the tracked state data.
Definition: stateDataWrapper.h:616
bool myAdvancedFrame
True once this object has advanced at least one simulation frame.
Definition: stateDataWrapper.h:638
Contains the declaration of the DtExtent class.
boost::signals2::signal< void(const DtUUID &oldSuperior, const DtUUID &newSuperior)> signal_superiorChanged
Signal sent when superior has changed.
Definition: stateDataWrapper.h:422
const DtVrfStateComponent * myCurrentFrameVrfStateComponent
Cached VRF state component pointer for the current frame; nullptr if absent.
Definition: stateDataWrapper.h:649
boost::signals2::scoped_connection myStateComponentAddedConnection
Connection to signal_stateComponentAdded on the tracked state data.
Definition: stateDataWrapper.h:594
const DtExternalFrameStateInterface * myExternalCurrentFrameState
Pointer to the current-frame read-only state interface; null if this object is invalid.
Definition: stateDataWrapper.h:591
Abstract base class that provides access to a set of state components within a DtStateData, representing either the next frame (read/write) or the current frame (read-only) view. Both DtExternalNextFrameState and DtExternalCurrentFrameState derive from this class.
Definition: stateData.h:76
A subclass extension of DtRwSimKinematicState for VRF-specific movable objects. This class is a DtRwS...
Definition: rwVrfKinematicState.h:28
#define DT_DLL_vrfStateData
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfStateDataDefines.h:29
A list of properties. A DtPropertyInterface object that is a specialized version of DtRwVariableBindi...
Definition: rwProperties.h:122
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:102
bool myCachedComponents
True once component pointers have been populated by cacheComponents().
Definition: stateDataWrapper.h:660
bool myIsDeleted
True if this object has been removed from the exercise.
Definition: stateDataWrapper.h:628
const DtVrfGeometryStateComponent * myCurrentFrameVrfGeometryStateComponent
Cached VRF geometry state component pointer for the current frame; nullptr if absent.
Definition: stateDataWrapper.h:655
class DtLocalVertexList:
Definition: localVertexList.h:20
boost::signals2::signal< void()> signal_advancedFrame
Signal sent when the state data signals that the frame has been advanced WARNING: This signal will be...
Definition: stateDataWrapper.h:436
tbb::spin_rw_mutex myExternalCurrentFrameStateMutex
Reader-writer spin mutex protecting myExternalCurrentFrameState for thread-safe access.
Definition: stateDataWrapper.h:641
std::vector< const T_Component * > getStateComponentList() const
Returns all state components of the given type attached to this object.
Definition: stateDataWrapper.h:186
DtString myAwaiting
If this object is awaiting for its reference to show up, this will be either a UUID or an entity id s...
Definition: stateDataWrapper.h:620
boost::signals2::signal< void(const DtUUID &oldUUID, const DtUUID &newUUID)> signal_uuidChanged
Signal sent when the uuid of this object has changed. Sent during a frame advance.
Definition: stateDataWrapper.h:413
const DtStatePropertiesStateComponent * currentFrameStatePropertiesStateComponent() const
Definition: stateDataWrapper.h:477
This class holds the state data that represents each simulation object in the system.
Definition: stateDataManager.h:76