X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FNavaids%2Fawynet.hxx;h=4aa424d999e33833cec102a9d890a5e58822085b;hb=3e46c7998ce2bf23ec322d1dfe65c8da35621d51;hp=92ca9c36812877bcab0c5fa5f463d196a993aebc;hpb=d9bfd5a425df1bad7e3c53a64adce871e299a6b9;p=flightgear.git diff --git a/src/Navaids/awynet.hxx b/src/Navaids/awynet.hxx old mode 100755 new mode 100644 index 92ca9c368..4aa424d99 --- a/src/Navaids/awynet.hxx +++ b/src/Navaids/awynet.hxx @@ -17,7 +17,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. // // $Id$ @@ -30,13 +30,14 @@ #include #include -#include #include //#include "parking.hxx" class FGAirway; // forward reference +class SGPath; +class SGGeod; typedef std::vector FGAirwayVector; typedef std::vector FGAirwayPointerVector; @@ -50,32 +51,27 @@ class FGNode { private: std::string ident; - double lat; - double lon; + SGGeod geod; + SGVec3d cart; // cached cartesian position int index; FGAirwayPointerVector next; // a vector to all the segments leaving from this node public: FGNode(); - FGNode(double lt, double ln, int idx, std::string id) { lat = lt; lon = ln; index = idx; ident = id;}; + FGNode(const SGGeod& aPos, int idx, std::string id); void setIndex(int idx) { index = idx;}; - void setLatitude (double val) { lat = val;}; - void setLongitude(double val) { lon = val;}; - //void setLatitude (const std::string& val) { lat = processPosition(val); }; - //void setLongitude(const std::string& val) { lon = processPosition(val); }; void addAirway(FGAirway *segment) { next.push_back(segment); }; - double getLatitude() { return lat;}; - double getLongitude(){ return lon;}; - + const SGGeod& getPosition() {return geod;} + const SGVec3d& getCart() { return cart; } int getIndex() { return index; }; std::string getIdent() { return ident; }; FGNode *getAddress() { return this;}; FGAirwayPointerVectorIterator getBeginRoute() { return next.begin(); }; FGAirwayPointerVectorIterator getEndRoute() { return next.end(); }; - bool matches(std::string ident, double lat, double lon); + bool matches(std::string ident, const SGGeod& aPos); }; typedef std::vector FGNodeVector; @@ -194,12 +190,12 @@ public: void init(); bool exists() { return hasNetwork; }; - int findNearestNode(double lat, double lon); + int findNearestNode(const SGGeod& aPos); FGNode *findNode(int idx); FGAirRoute findShortestRoute(int start, int end); void trace(FGNode *, int, int, double dist); - void load(SGPath path); + void load(const SGPath& path); }; #endif