From: <sv...@ww...> - 2005-04-02 16:38:21
|
Author: mkrose Date: 2005-04-02 08:38:12 -0800 (Sat, 02 Apr 2005) New Revision: 1498 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Include/SimData/GeoPos.h Log: Add a few convenience methods to SimData::LLA. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1498 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2005-03-12 23:12:46 UTC (rev 1497) +++ trunk/CSP/SimData/CHANGES.current 2005-04-02 16:38:12 UTC (rev 1498) @@ -1,6 +1,9 @@ Version 0.4.0 (in progress) =========================== +2005-04-02: onsight + * Add a few convenience methods to LLA. + 2005-03-11: onsight * Add a method to DateZulu to get the time offset relative to another DateZulu instance in seconds. Modified: trunk/CSP/SimData/Include/SimData/GeoPos.h =================================================================== --- trunk/CSP/SimData/Include/SimData/GeoPos.h 2005-03-12 23:12:46 UTC (rev 1497) +++ trunk/CSP/SimData/Include/SimData/GeoPos.h 2005-04-02 16:38:12 UTC (rev 1498) @@ -572,6 +572,34 @@ */ inline double altitude() const { return _alt; } + /** Get the latitude in degrees. + */ + inline double latitudeInDegrees() const { return toDegrees(_lat); } + + /** Get the longitude in degrees. + */ + inline double longitudeInDegrees() const { return toDegrees(_lon); } + + /** Set the latitude in degrees. + */ + inline void setLatitudeInDegrees(double latitude) { _lat = toRadians(latitude); } + + /** Set the longitude in degrees. + */ + inline void setLongitudeInDegrees(double longitude) { _lon = toDegrees(longitude); } + + /** Set the latitude in radians. + */ + inline void setLatitude(double latitude) { _lat = latitude; } + + /** Set the longitude in radians. + */ + inline void setLongitude(double longitude) { _lon = longitude; } + + /** Set the altitude in meters. + */ + inline void setAltitude(double altitude) { _alt = altitude; } + /** String representation. */ virtual std::string asString() const; @@ -583,10 +611,10 @@ /** Set the current position from XML character data. * * LLA coordinate format (lat, lon, alt): @n - * <tt> x.x x.x x.x </tt> + * <tt> x.x x.x x.x </tt> * * LLA coordinate format 2 (lat, lon, alt): @n - * <tt> x'x"x.x x'x"x.x x.x </tt> + * <tt> x'x"x.x x'x"x.x x.x </tt> */ void parseXML(const char *); @@ -701,7 +729,7 @@ /** Set the current position from XML character data. * * UTM coordinate format (easting, northing, zone, alt): @n - * <tt>x.x x.x zone x.x</tt> @n + * <tt>x.x x.x zone x.x</tt> @n * where @c zone is an integer followed by a UTM latitude designator, * such as @c 10T */ |