|
LRAUV
revA
|
Wraps a pair of double precision (8-byte) floating point numbers and units for storage in a DataElement. More...
#include <Location.h>


Public Member Functions | |
| Location (const Unit &unit) | |
| Default constructor. More... | |
| Location (const Unit &unit, const double &lat, const double &lon, bool scaleValues=true) | |
| Multi value constructior. More... | |
| Location (const Location &value) | |
| Copy Constructor. More... | |
| virtual | ~Location () |
| Destructor. More... | |
| const double | getLat (const Unit &unit) const |
| Override new. More... | |
| const double | getLon (const Unit &unit) const |
| void | setLat (const Unit &unit, const double &lat) |
| void | setLon (const Unit &unit, const double &lat) |
| Location * | copy () const |
| Return a pointer to a new copy. More... | |
| virtual bool | copyTo (const Unit &unit, unsigned char &assignTo) const |
| Copy value to unsigned char. More... | |
| virtual bool | copyTo (const Unit &unit, float &assignTo) const |
| Copy value to float. More... | |
| virtual bool | copyTo (const Unit &unit, double &assignTo) const |
| Copy value to double. More... | |
| virtual bool | copyTo (const Unit &unit, double &assignTo, unsigned int dim) const |
| Copy n-dimensional value to double. More... | |
| virtual bool | copyTo (const Unit &unit, int &assignTo) const |
| Copy value to unsigned int. More... | |
| bool | setFrom (const Unit &unit, unsigned char value) |
| set from unsigned char value More... | |
| bool | setFrom (const Unit &unit, double value) |
| set from double value More... | |
| bool | setFrom (const Unit &unit, float value) |
| set from float value More... | |
| bool | setFrom (const Unit &unit, int value) |
| set int value More... | |
| bool | setFrom (const DataValue &value) |
| set DataValue value More... | |
| Str | toString (const Unit &unit) const |
| Location & | operator= (const Location &rhs) |
| Location & | operator+= (const Location &rhs) |
| Location & | operator-= (const Location &rhs) |
| const Location | operator+ (const Location &rhs) const |
| const Location | operator- (const Location &rhs) const |
| bool | isNan () const |
| double | getBearing (const double &latitude, const double &longitude) const |
| double | getBearing (const Location &location1) const |
| void | calcVector (const Location &location1, double &toEast, double &toNorth) const |
| double | getDistance (const double &latitude, const double &longitude) const |
| double | getDistance (const Location &location1) const |
| double | getDistanceFast (const Location &location1) const |
| void | atBearing (const double bearing, const double distance) |
| virtual double * | getPtr1d () |
| Implement abstract I1D method Note that Location, when accessed via I1D methods, returns RADIANS. More... | |
| virtual int | getM () const |
| Implement abstract I2D method. More... | |
Public Member Functions inherited from I1D< double > | |
| virtual | ~I1D () |
Static Public Member Functions | |
| static double | GetBearing (const double &latitude0, const double &longitude0, const double &latitude1, const double &longitude1) |
| static void | CalcVector (const double &lat0, const double &lon0, const double &lat1, const double &lon1, double &toEast, double &toNorth) |
| static double | GetDistance (const double &latitude0, const double &longitude0, const double &latitude1, const double &longitude1) |
| static double | GetDistanceFast (const double &latitude0, const double &longitude0, const double &latitude1, const double &longitude1) |
| static void | AtBearing (const float bearing, const float distance, double &lat, double &lon) |
| static void | AtBearingEllipsoid (const float bearing, const float distance, double &lat, double &lon) |
| Calculates destination point given start point lat/long, bearing & distance, using Vincenty inverse formula for ellipsoids. More... | |
| static double | NorthingsDelta (const double startLat, const float northingsDelta) |
| static double | EastingsDelta (const double startLat, const double startLon, const float eastingsDelta) |
| static void | Delta (double &lat, double &lon, double northings, double eastings) |
| static double | HavSin (double angle) |
Static Public Member Functions inherited from I1D< double > | |
| static double * | New1D (int m, bool extra=false) |
| static void | Delete1D (double *array) |
Static Public Attributes | |
| static const double | EARTH_RADIUS = 6371000.0 |
| static const double | EARTH_RADIUS_INVERTED = 1.0 / 6371000.0 |
Protected Member Functions | |
| Location () | |
| Protected Empty constructor for use by DataEntry class. More... | |
Protected Member Functions inherited from I1D< double > | |
| I1D () | |
| I1D (const I1D &) | |
Protected Attributes | |
| double | value_ [2] |
| double & | lat_ |
| Latitude, in radians north. More... | |
| double & | lon_ |
| Longitude, in radians east. More... | |
Wraps a pair of double precision (8-byte) floating point numbers and units for storage in a DataElement.
(Storage is in the most canonical form of the specified unit). Provides methods for reading and writing the value to and from other DataValues, performing unit conversions as needed.
Location objects are serialized as a pair of 4-byte single precision floating point numbers by casting both numbers to single-precision floating point before storage.
Note: since these DataValues are created and destructed frequently, the new and delete operators have been overridden, so that objects can be re-used as needed.
Location::MallocRing_ stores deleted objects.
| Location::Location | ( | const Unit & | unit | ) |
| Location::Location | ( | const Unit & | unit, |
| const double & | lat, | ||
| const double & | lon, | ||
| bool | scaleValues = true |
||
| ) |
|
inlinevirtual |
Destructor.
|
protected |
Protected Empty constructor for use by DataEntry class.
Protected Empty constructor for use bya DataEntry class.
References value_.
Referenced by copy(), operator+(), and operator-().
|
static |
References EARTH_RADIUS_INVERTED.
Referenced by HFRCMVirtualSurfaceDrifter::advect(), PeakDetectHorizontal::PointValue::advect(), atBearing(), DeadReckonUsingCompactModelForecast::deadReckon(), DeadReckoner::deadReckon(), Delta(), Waypoint::initialize(), HFRadarModelPoint::initialize(), Lane::initialize(), Simulator::publishState(), Circle::run(), KeepStation::run(), OffshoreEnvelope::runIfUnsatisfied(), WaterDepthEnvelope::runIfUnsatisfied(), Location_Test::testAtBearing(), and OffshoreEnvelope_Test::testRun().
| void Location::atBearing | ( | const double | bearing, |
| const double | distance | ||
| ) |
References AtBearing(), lat_, and lon_.
|
static |
Calculates destination point given start point lat/long, bearing & distance, using Vincenty inverse formula for ellipsoids.
Adapted from: http://www.movable-type.co.uk/scripts/latlong-vincenty-direct.html
References AuvMath::ModPi().
|
static |
References EARTH_RADIUS.
Referenced by calcVector().
| void Location::calcVector | ( | const Location & | location1, |
| double & | toEast, | ||
| double & | toNorth | ||
| ) | const |
References CalcVector(), lat_, and lon_.
Referenced by HFRadarModelPoint::travelTime().
| Location * Location::copy | ( | ) | const |
Return a pointer to a new copy.
References Location().
|
inlinevirtual |
Copy value to unsigned char.
|
inlinevirtual |
Copy value to float.
|
inlinevirtual |
Copy value to double.
|
virtual |
|
inlinevirtual |
Copy value to unsigned int.
|
static |
References AtBearing().
|
static |
|
static |
Referenced by Navigator::evaluateAndRecordFixResidual(), getBearing(), Circle::initialize(), Waypoint::initialize(), HFRadarModelPoint::initialize(), Circle::isSatisfied(), ExternalSim::publishState(), HFRadarModelPoint::run(), Circle::run(), KeepStation::run(), Point::runIfUnsatisfied(), OffshoreEnvelope::runIfUnsatisfied(), WaterDepthEnvelope::runIfUnsatisfied(), and Location_Test::testGetBearing().
| double Location::getBearing | ( | const double & | latitude, |
| const double & | longitude | ||
| ) | const |
References GetBearing(), lat_, and lon_.
| double Location::getBearing | ( | const Location & | location1 | ) | const |
References GetBearing(), lat_, and lon_.
|
static |
| double Location::getDistance | ( | const double & | latitude, |
| const double & | longitude | ||
| ) | const |
References GetDistance(), lat_, and lon_.
Referenced by HFRadarModelPoint::heuristic(), and KmlLogWriter::write().
| double Location::getDistance | ( | const Location & | location1 | ) | const |
References GetDistance(), lat_, and lon_.
|
static |
References EARTH_RADIUS, and AuvMath::Square().
Referenced by Navigator::evaluateAndRecordFixResidual(), getDistanceFast(), HFRadarModelCalc::lookup(), and Location_Test::testGetDistanceFast().
| double Location::getDistanceFast | ( | const Location & | location1 | ) | const |
References GetDistanceFast(), lat_, and lon_.
Referenced by HFRadarModelPoint::getAdjoining().
| const double Location::getLat | ( | const Unit & | unit | ) | const |
Override new.
Override delete
References Unit::getScaled(), and lat_.
Referenced by copyTo(), HFRadarModelPoint::run(), KmlLogWriter::write(), and KmlLogWriter::writeFooter().
| const double Location::getLon | ( | const Unit & | unit | ) | const |
References Unit::getScaled(), and lon_.
Referenced by copyTo(), HFRadarModelPoint::run(), KmlLogWriter::write(), and KmlLogWriter::writeFooter().
|
inlinevirtual |
Implement abstract I2D method.
Implements I1D< double >.
|
inlinevirtual |
Implement abstract I1D method Note that Location, when accessed via I1D methods, returns RADIANS.
Implements I1D< double >.
References value_.
|
static |
Referenced by GetDistance().
|
static |
References Location().
References Location().
|
inline |
set from unsigned char value
|
inline |
set from double value
|
inline |
set from float value
|
inline |
set int value
| void Location::setLat | ( | const Unit & | unit, |
| const double & | lat | ||
| ) |
References Unit::getSI(), and lat_.
Referenced by KmlLogWriter::write().
| void Location::setLon | ( | const Unit & | unit, |
| const double & | lat | ||
| ) |
References Unit::getSI(), and lon_.
Referenced by KmlLogWriter::write().
References Unit::getScaled(), and value_.
|
static |
|
static |
|
protected |
Latitude, in radians north.
Referenced by atBearing(), calcVector(), getBearing(), getDistance(), getDistanceFast(), getLat(), LocationNode::getLat(), isNan(), Location(), operator+=(), operator-=(), operator=(), and setLat().
|
protected |
Longitude, in radians east.
Referenced by atBearing(), calcVector(), getBearing(), getDistance(), getDistanceFast(), getLon(), LocationNode::getLon(), isNan(), Location(), operator+=(), operator-=(), operator=(), and setLon().
|
protected |
Referenced by getPtr1d(), Location(), and toString().