VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Attributes
DtAisTrack Class Reference

Class definition for one track created from AIS messages, i.e. the identifying information and time-stamped position data for one vessel (i.e. unique MMSI identifier).

Public Member Functions

 DtAisTrack ()
 
 ~DtAisTrack ()
 
virtual bool computePathBoundingBox (bool debug=false)
 
virtual int netRepSize () const
 
virtual bool setFromNet (const char *contentBuffer, unsigned contentSize=0)
 
virtual bool setToNet (char *contentBuffer)
 
void setMmsi (const int mmsi)
 
int mmsi () const
 
void setShipType (const std::string)
 
std::string shipType () const
 
void setShipName (const std::string)
 
std::string shipName () const
 
void setCallSign (const std::string)
 
std::string callSign () const
 
void setCountryCode (const std::string)
 
std::string countryCode () const
 
void setImoNumber (const int)
 
int imoNumber () const
 
void setLength (const double)
 
double length () const
 
void setWidth (const double)
 
double width () const
 
void setDistanceToBow (const double)
 
double distanceToBow () const
 
void setDistanceToStarboard (const double)
 
double distanceToStarboard () const
 
void setDraft (const double)
 
double draft () const
 
void setDestination (const std::string)
 
std::string destination () const
 
void setEta (const DtTime eta)
 
DtTime eta () const
 
void addPathPoint (const DtPathPoint &point)
 
const DtAisPathPointMappath () const
 
DtAisPathPointMappath ()
 

This data is derived from the path data. The values is set in computePathBoundingBox. It is not valid if the path changes until computePathBoundingBox is called again.
MaxNorth and South are the maximum and minimum latitude values (radians) over all of the path points.
MaxEast and West are the longitude values (radians) of the east-most and west-most points of the path. Note that if the path crosses the 180 degree meridian at least once, the eastern most point will have a longitude that is less than the western most point, and crosses180Line will be true.
The start and endTimes are just the times of the first and last points.

double maxNorth () const
 
double maxSouth () const
 
double maxEast () const
 
double maxWest () const
 
bool crosses180Line () const
 
DtTime startTime () const
 
DtTime endTime () const
 

Protected Attributes

int myMmsi
 
std::string myShipType
 
std::string myName
 
std::string myCallSign
 
std::string myCountryCode
 
int myImoNumber
 
std::string myDestination
 
DtTime myEta
 
DtAisPathPointMap myPath
 
float myLength
 
float myWidth
 
float myDistanceToBow
 
float myDistanceToStarboard
 
float myDraft
 
float myMaxNorth
 
float myMaxSouth
 
float myMaxEast
 
float myMaxWest
 
bool myCrosses180Line
 
DtTime myStartTime
 
DtTime myEndTime
 

Constructor & Destructor Documentation

DtAisTrack::DtAisTrack ( )
DtAisTrack::~DtAisTrack ( )

Member Function Documentation

virtual bool DtAisTrack::computePathBoundingBox ( bool  debug = false)
virtual

Find the bounding box of the ship path. Fills in myMaxN-S-E-W in the class and the flag myCrosses180Line. Note that if the path goes across the +-180 longitude line, the west coordinate will be > the east coordinate value. Also records the start and end times of the path.

Returns
True unless there is no path or the path data is bad, in which case returns false.
virtual int DtAisTrack::netRepSize ( ) const
virtual

Returns the size of the full network representation padded to an 8-byte boundary.

virtual bool DtAisTrack::setFromNet ( const char contentBuffer,
unsigned  contentSize = 0 
)
virtual

Fills in the task from the network buffer. Content size is not used.

virtual bool DtAisTrack::setToNet ( char contentBuffer)
virtual

Fills in the network buffer with the task contents. Buffer must be allocated by the caller, with size netRepSize.

void DtAisTrack::setMmsi ( const int  mmsi)

9 digit (normally) ID number for AIS transmitter. Numbers with fewer than 9 digits are still assumed to have the Maritime ID (MID) in the most significant 3 digits.

int DtAisTrack::mmsi ( ) const
void DtAisTrack::setShipType ( const std::string  )

2 characters (normally) that are digits representing the type. Some types are 3 digits– not defined in AIS spec.

std::string DtAisTrack::shipType ( ) const
void DtAisTrack::setShipName ( const std::string  )
std::string DtAisTrack::shipName ( ) const
void DtAisTrack::setCallSign ( const std::string  )
std::string DtAisTrack::callSign ( ) const
void DtAisTrack::setCountryCode ( const std::string  )

2 character country code.

std::string DtAisTrack::countryCode ( ) const
void DtAisTrack::setImoNumber ( const int  )

Ship ID number.

int DtAisTrack::imoNumber ( ) const
void DtAisTrack::setLength ( const double  )

Represented internally as a float, since AID data is not more precise than that.

double DtAisTrack::length ( ) const
void DtAisTrack::setWidth ( const double  )

Represented internally as a float, since AID data is not more precise than that.

double DtAisTrack::width ( ) const
void DtAisTrack::setDistanceToBow ( const double  )

Location of the ship position sensor fore-aft. Represented internally as a float, since AID data is not more precise than that.

double DtAisTrack::distanceToBow ( ) const
void DtAisTrack::setDistanceToStarboard ( const double  )

Location of the ship position sensor port-starboard. Represented internally as a float, since AID data is not more precise than that.

double DtAisTrack::distanceToStarboard ( ) const
void DtAisTrack::setDraft ( const double  )

Represented internally as a float, since AID data is not more precise than that.

double DtAisTrack::draft ( ) const
void DtAisTrack::setDestination ( const std::string  )

Free text.

std::string DtAisTrack::destination ( ) const
void DtAisTrack::setEta ( const DtTime  eta)

Estimated time of arrival.

DtTime DtAisTrack::eta ( ) const
void DtAisTrack::addPathPoint ( const DtPathPoint point)

Add the given point to the path for this track. Note that this invalidates the derived data (maxNSEW and start/endTime).

const DtAisPathPointMap& DtAisTrack::path ( ) const

Get the points in the track path.

DtAisPathPointMap& DtAisTrack::path ( )
double DtAisTrack::maxNorth ( ) const
double DtAisTrack::maxSouth ( ) const
double DtAisTrack::maxEast ( ) const
double DtAisTrack::maxWest ( ) const
bool DtAisTrack::crosses180Line ( ) const
DtTime DtAisTrack::startTime ( ) const
DtTime DtAisTrack::endTime ( ) const

Member Data Documentation

int DtAisTrack::myMmsi
protected

Should be a 9-digit number. If shorter, the first 3 (most significant) digits still represent the Maritime ID Digits (MID).

std::string DtAisTrack::myShipType
protected

2 characters

std::string DtAisTrack::myName
protected
std::string DtAisTrack::myCallSign
protected
std::string DtAisTrack::myCountryCode
protected
int DtAisTrack::myImoNumber
protected
float DtAisTrack::myLength
protected

In meters:

float DtAisTrack::myWidth
protected

In meters:

float DtAisTrack::myDistanceToBow
protected

In meters:

float DtAisTrack::myDistanceToStarboard
protected

In meters:

float DtAisTrack::myDraft
protected

In meters:

std::string DtAisTrack::myDestination
protected
DtTime DtAisTrack::myEta
protected
DtAisPathPointMap DtAisTrack::myPath
protected

The key is the timestamp.

float DtAisTrack::myMaxNorth
protected

Derived values.

float DtAisTrack::myMaxSouth
protected

Derived values.

float DtAisTrack::myMaxEast
protected

Derived values.

float DtAisTrack::myMaxWest
protected

Derived values.

bool DtAisTrack::myCrosses180Line
protected

Derived values.

DtTime DtAisTrack::myStartTime
protected

Derived values.

DtTime DtAisTrack::myEndTime
protected

Derived values.


The documentation for this class was generated from the following file:

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)