![]() |
VR-Forces Developer's Guide
|
The DtAisDataManager loads and manages Automatic Identification System (AIS) data, which is used to track and monitor real world ships. This data can be used to create and simulate clutter entities in a simulation.

Public Types | |
| typedef std::vector< DtAisTrack > | DtAisTrackBuffer |
| typedef std::list< DtAisTrack * > | DtAisTrackList |
| typedef std::unordered_map < DtMmsi, DtAisTrack * > | DtAisTrackMap |
Public Types inherited from DtAisDataServiceInterface | |
| using | DtMmsi = int |
| using | DtMmsiSet = std::set< DtMmsi > |
| using | DtPathPoints = std::map< double, DtPathPoint > |
| using | DtPathPointIter = std::map< double, DtPathPoint >::const_iterator |
Public Member Functions | |
| DtAisDataManager (DtSimulationServices *simServices) | |
| virtual | ~DtAisDataManager () override |
| virtual bool | init () |
| virtual void | tick () |
| virtual bool | isDataLoaded () const override |
| virtual DtAisDataJob::Ptr | findTracksInArea (const DtVertexList &areaVertices, bool unownedOnly=true) override |
| virtual DtAisDataJob::Ptr | findTracksInAreaDuringTime (const DtVertexList &areaVertices, double startSimTime, double endSimTime, bool unownedOnly) override |
| virtual const DtAisTrack * | trackInfo (DtMmsi trackId) const override |
| virtual DtAisDataJob::Ptr | requestOwnershipOfTracks (const DtMmsiSet &trackIds) override |
| virtual DtAisDataJob::Ptr | releaseOwnershipOfTracks (const DtMmsiSet &trackIds) override |
| virtual double | aisTimeFromSimTime (double simTime) const override |
| virtual double | simTimeFromAisTime (double aisTime) const override |
| virtual double | finalDataSimTime () const override |
| virtual bool | getFirstPointAfterTime (const DtAisTrack &track, double simTime, DtPathPointIter &pathPointIter) const override |
| virtual bool | getLastPointBeforeTime (const DtAisTrack &track, double simTime, DtPathPointIter &pathPointIter) const override |
| virtual DtPathPointIter | getEndOfpath (const DtAisTrack &track) const override |
| virtual void | resetData () override |
| virtual void | clearData () override |
| virtual void | loadAisData () |
| virtual bool | isDataLoading () const |
| virtual bool | timeToStop () const |
| virtual void | stop () |
Public Member Functions inherited from DtAisDataServiceInterface | |
| DtAisDataServiceInterface () | |
| virtual | ~DtAisDataServiceInterface () |
Static Public Member Functions | |
| static void | tickCallback (void *usr) |
Protected Types | |
| typedef tbb::spin_mutex | QueryQueueMutex |
| typedef std::list < DtAisDataJob::Ptr > | JobQueue |
Protected Member Functions | |
| virtual void | performDataClear () |
| virtual void | performDataReset () |
| virtual void | startAisDataLoad () |
| virtual void | calculateTrackTimeOffset () |
Protected Attributes | |
| DtAisTrackBuffer | myTracks |
| DtAisTrackMap | myTracksByMmsi |
| DtMmsiSet | myUnusedTracks |
| DtMmsiSet | myTracksInUse |
| QueryQueueMutex | myQueryQueueMutex |
| JobQueue | myJobQueue |
| DtSimulationServices * | mySimulationServices |
| DtTime | myTrackTimeAtSimTime0 |
| DtTime | myFirstDataAisTime |
| DtTime | myFirstDataSimTime |
| DtTime | myFinalDataAisTime |
| DtTime | myFinalDataSimTime |
| std::atomic< bool > | myClearData |
| std::atomic< bool > | myResetData |
| std::atomic< bool > | myResetTimeOffset |
| std::atomic< bool > | myDataIsLoaded |
| std::atomic< bool > | myLoadInProgress |
| std::atomic< bool > | myWarnedOnce |
| std::atomic< bool > | myTimeToStop |
| tbb::task_arena | myArena |
Private Member Functions | |
| DtAisDataManager (const DtAisDataManager &orig) | |
| DtAisDataManager & | operator= (const DtAisDataManager &other) |
Friends | |
| class | DtAisDataManagerJob |
| typedef std::vector<DtAisTrack> DtAisDataManager::DtAisTrackBuffer |
| typedef std::list<DtAisTrack*> DtAisDataManager::DtAisTrackList |
| typedef std::unordered_map<DtMmsi, DtAisTrack*> DtAisDataManager::DtAisTrackMap |
|
protected |
|
protected |
| DtAisDataManager::DtAisDataManager | ( | DtSimulationServices * | simServices | ) |
Constructs the AIS data manager.
|
overridevirtual |
The destructor.
|
private |
copy constructor not defined
|
virtual |
Initializes the AIS data manager.
|
static |
Static tick method that is registered with DtSimulationServices callbacks. Calls tick().
|
virtual |
Tick the AIS data manager. Determines whether tracks have entered or exited areas of interest and calls registered functions to notify them of the change.
|
overridevirtual |
Returns true if AIS data has been loaded.
Implements DtAisDataServiceInterface.
|
overridevirtual |
Starts a query for all tracks in the specified area. If unownedOnly is true (the default) then only unowned tracks are returned.
Implements DtAisDataServiceInterface.
|
overridevirtual |
Starts a query for all tracks in the specified area. If unownedOnly is true (the default) then only unowned tracks are returned.
Implements DtAisDataServiceInterface.
|
overridevirtual |
Returns information for the track with the specified MMSI, or nullptr if it could not be found. Will always return nullptr if isDataLoaded() returns false;.
Implements DtAisDataServiceInterface.
|
overridevirtual |
Request ownership of the specified given tracks.
Implements DtAisDataServiceInterface.
|
overridevirtual |
Release ownership of the specified tracks.
Implements DtAisDataServiceInterface.
Converts a sim time to AIS data time. Needed to understand how sim time relates to the timestamps in the AIS track data.
Implements DtAisDataServiceInterface.
Converts the AIS data time to sim time. Needed to understand how sim time relates to the timestamps in the AIS track data.
Implements DtAisDataServiceInterface.
|
overridevirtual |
Returns the sim time for the last point of AIS data available.
Implements DtAisDataServiceInterface.
|
overridevirtual |
Find the first point in the track's path that occurs after (or at) the specified sim time. If no points meet this criteria, returns false and sets pathPointIter to the end of the path. (i.e. path.end()) Otherwise, returns true and pathPointIter parameter is set to the iterator to this point.
Implements DtAisDataServiceInterface.
|
overridevirtual |
Find the last point in the track's path that occurs before (or at) the specified sim time. If no points meet this criteria, returns false and sets pathPointIter to the end of the path. (i.e. path.end()) Otherwise, returns true and pathPointIter parameter is set to the iterator to this point.
Implements DtAisDataServiceInterface.
|
overridevirtual |
Returns an iterator to the end of the path (i.e. path.end()).
Implements DtAisDataServiceInterface.
|
overridevirtual |
Marks AIS data to be reset. Data will not be unloaded, but ownership of all tracks will be reset to unowned.
Implements DtAisDataServiceInterface.
|
overridevirtual |
Marks AIS data to be cleared. Data will be completely unloaded.
Implements DtAisDataServiceInterface.
|
virtual |
Loads the AIS data.
|
virtual |
|
virtual |
|
virtual |
|
protectedvirtual |
Clears out all loaded AIS data.
|
protectedvirtual |
Resets all AIS data to be unowned.
|
protectedvirtual |
Spawns a thread to begin loading AIS data.
|
protectedvirtual |
Calculates and sets myTrackTimeAtSimTime0, which is used to translate between sim time and AIS track data time.
|
private |
assignment operator not defined
|
friend |
|
protected |
Buffer containing information on all loaded AIS tracks.
|
protected |
Index into the track data by MMSI.
|
protected |
List of the subset of tracks that are not in use.
|
protected |
List of the subset of tracks that are in use.
|
mutableprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |