From: ehofman Date: Sat, 16 Oct 2004 12:23:53 +0000 (+0000) Subject: Roy Vegard Ovesen: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ba1b96e518ee65d9c07b9e926c4bd8fe0713e12b;p=simgear.git Roy Vegard Ovesen: I'm working on a route manager in the GPS module. So I've added a name parameter to the waypoint class in Simgear. I use the existing ID parameter to store the ID, for example KLAX, and the name parameter to store the name, San Francisco Intl. --- diff --git a/simgear/route/waypoint.cxx b/simgear/route/waypoint.cxx index 9e6820b9..3de5941d 100644 --- a/simgear/route/waypoint.cxx +++ b/simgear/route/waypoint.cxx @@ -29,12 +29,13 @@ // Constructor SGWayPoint::SGWayPoint( const double lon, const double lat, const double alt, - const modetype m, const string s ) { + const modetype m, const string s, const string n ) { target_lon = lon; target_lat = lat; target_alt = alt; mode = m; id = s; + name = n; } diff --git a/simgear/route/waypoint.hxx b/simgear/route/waypoint.hxx index afa21598..a95b030f 100644 --- a/simgear/route/waypoint.hxx +++ b/simgear/route/waypoint.hxx @@ -76,6 +76,7 @@ private: double distance; string id; + string name; public: @@ -86,10 +87,11 @@ public: * @param alt target altitude * @param mode type of coordinates/math to use * @param s waypoint identifier + * @param n waypoint name */ SGWayPoint( const double lon = 0.0, const double lat = 0.0, const double alt = 0.0, const modetype m = WGS84, - const string s = "" ); + const string s = "", const string n = "" ); /** Destructor */ ~SGWayPoint(); @@ -153,6 +155,9 @@ public: /** @return waypoint id */ inline string get_id() const { return id; } + /** @return waypoint name */ + inline string get_name() const { return name; } + };