]> git.mxchange.org Git - flightgear.git/blobdiff - src/Navaids/awynet.hxx
Merge branch 'next' of http://git.gitorious.org/fg/flightgear into next
[flightgear.git] / src / Navaids / awynet.hxx
index 92ca9c36812877bcab0c5fa5f463d196a993aebc..9ac508204928218661b83d49ebabef903731c45b 100755 (executable)
 #include <map>
 #include <vector>
 
-#include <simgear/misc/sg_path.hxx>
 #include <simgear/misc/sgstream.hxx>
 
 
 //#include "parking.hxx"
 
 class FGAirway; // forward reference
+class SGPath;
+class SGGeod;
 
 typedef std::vector<FGAirway>  FGAirwayVector;
 typedef std::vector<FGAirway *> 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<FGNode *> 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