VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
aisTrack.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2022 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
11 
12 #include "vrfutil/vrfutilDefines.h"
13 #include <vlutil/vlTime.h>
14 #include <vlpi/disEnums.h>
15 #include "list"
16 #include <map>
17 #include <string>
18 #include "vlpi/disEnums.h"
20 
21 
25 {
26 public:
27  DtPathPoint();
28  ~DtPathPoint();
29 
38  DtAisNavigationStatus myNavStatus;
39  bool myHasSOG;
42  bool myHasCOG;
45 };
46 
47 namespace DtBufferSerialize
48 {
49  DT_DLL_vrfutil const int getSize(const DtPathPoint& val);
50  DT_DLL_vrfutil char* encode(const DtPathPoint& val, char* buffer);
51  DT_DLL_vrfutil const char* decode(DtPathPoint& val, const char* buffer);
52 }
53 
54 typedef std::map<double, DtPathPoint> DtAisPathPointMap;
55 
61 {
62 public:
63  DtAisTrack();
64  ~DtAisTrack();
65 
73  virtual bool computePathBoundingBox(bool debug = false);
74 
77  virtual int netRepSize() const;
78 
81  virtual bool setFromNet(const char* contentBuffer,
82  unsigned contentSize = 0);
83 
87  virtual bool setToNet(char* contentBuffer);
88 
92  void setMmsi(const int mmsi);
93  int mmsi() const;
94 
97  void setShipType(const std::string);
98  std::string shipType() const;
99 
100  void setShipName(const std::string);
101  std::string shipName() const;
102 
103  void setCallSign(const std::string);
104  std::string callSign() const;
105 
107  void setCountryCode(const std::string);
108  std::string countryCode() const;
109 
111  void setImoNumber(const int);
112  int imoNumber() const;
113 
116  void setLength(const double);
117  double length() const;
118 
121  void setWidth(const double);
122  double width() const;
123 
127  void setDistanceToBow(const double);
128  double distanceToBow() const;
129 
133  void setDistanceToStarboard(const double);
134  double distanceToStarboard() const;
135 
138  void setDraft(const double);
139  double draft() const;
140 
141  void addClassCounter(int);
142  void computeShipClass();
143  DtAisShipClass shipClass() const;
144 
146  void setDestination(const std::string);
147  std::string destination() const;
148 
150  void setEta(const DtTime eta);
151  DtTime eta() const;
152 
155  void addPathPoint(const DtPathPoint& point);
156 
158  const DtAisPathPointMap& path() const;
159  DtAisPathPointMap& path();
160 
173  double maxNorth() const;
174  double maxSouth() const;
175  double maxEast()const;
176  double maxWest() const;
177  bool crosses180Line() const;
178  DtTime startTime() const;
179  DtTime endTime() const;
181 
182 protected:
185  int myMmsi;
187  std::string myShipType;
188  std::string myName;
189  std::string myCallSign;
190  std::string myCountryCode;
192 
197 
200  float myLength;
201  float myWidth;
204  float myDraft;
206  std::string myDestination;
210 
213  float myMaxNorth;
214  float myMaxSouth;
215  float myMaxEast;
216  float myMaxWest;
218  DtAisShipClass myShipClass;
222 };
223 
DtTime myEndTime
Derived values.
Definition: aisTrack.h:220
DT_DLL_readerWriter int getSize(const DtString &val)
The number of bytes required to encode the value.
float myDistanceToBow
In meters:
Definition: aisTrack.h:202
float myMaxEast
Derived values.
Definition: aisTrack.h:215
double length(const dvec3 &theVec)
Definition: DtVecUtils.h:20
std::string myDestination
Definition: aisTrack.h:206
DtFixedPointAngle32 myLatitude
The representation of lat-lon in the AIS data is 10e-4 minutes, or about 27-28 bits.
Definition: aisTrack.h:33
DtTime myTimeStamp
Definition: aisTrack.h:30
This class hold ship data that is obtained from AIS messages. It is generated initially by the proces...
Definition: aisTrack.h:24
bool myHasHeading
an enumeration. Indicator for whether the above data has been speci...
Definition: aisTrack.h:43
bool myCrosses180Line
Derived values.
Definition: aisTrack.h:217
std::string myShipType
2 characters, eg 52 = tug, 58 = med. transp.
Definition: aisTrack.h:187
DtFixedPointAngle16 myCourseOverGround
mps
Definition: aisTrack.h:36
float myDraft
In meters:
Definition: aisTrack.h:204
DtAisShipClass myShipClass
Derived values.
Definition: aisTrack.h:218
DtFixedPointAngle16 myHeading
radians (a heading)
Definition: aisTrack.h:37
bool myHasCOG
an enumeration. Indicator for whether the above data has been speci...
Definition: aisTrack.h:42
DtAisPathPointMap myPath
The key is the timestamp.
Definition: aisTrack.h:209
Class definition for one track created from AIS messages, i.e. the identifying information and time-s...
Definition: aisTrack.h:60
int myMmsi
Should be a 9-digit number. If shorter, the first 3 (most significant) digits still represent the Mar...
Definition: aisTrack.h:185
DtFixedPointAngle32 myLongitude
radians
Definition: aisTrack.h:34
float mySpeedOverGround
radians
Definition: aisTrack.h:35
float myLength
In meters:
Definition: aisTrack.h:200
float myMaxNorth
Derived values.
Definition: aisTrack.h:213
DT_DLL_readerWriter char * encode(const DtFilename &val, char *buffer)
Serializes the provided value val into buffer. buffer must have at least the number of bytes returned...
float myDistanceToStarboard
In meters:
Definition: aisTrack.h:203
float myMaxSouth
Derived values.
Definition: aisTrack.h:214
std::string myCallSign
Definition: aisTrack.h:189
DtAisNavigationStatus myNavStatus
radians, 0 - 2pi. Ignore if &lt; 0.
Definition: aisTrack.h:38
int myShipClassMappingCounter
Each message type maps to either ship class A or B. Class depends on boat capabilities like speed/loa...
Definition: aisTrack.h:196
int myImoNumber
Definition: aisTrack.h:191
std::string myName
Definition: aisTrack.h:188
#define DT_DLL_vrfutil
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfutilDefines.h:34
DtTime myStartTime
Derived values.
Definition: aisTrack.h:219
DT_DLL_readerWriter const char * decode(DtString &val, const char *buffer)
Decodes a value from buffer and places the result in val of the type specified by val...
std::string myCountryCode
Definition: aisTrack.h:190
std::map< double, DtPathPoint > DtAisPathPointMap
Definition: aisTrack.h:54
float myMaxWest
Derived values.
Definition: aisTrack.h:216
DtTime myEta
Definition: aisTrack.h:207
float myWidth
In meters:
Definition: aisTrack.h:201

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)