]> git.mxchange.org Git - flightgear.git/blobdiff - src/Navaids/routePath.hxx
Fix flight-plan course and distance computations.
[flightgear.git] / src / Navaids / routePath.hxx
index d04c03d08198996db56199bf7e54bdbec44c72fb..ddc15693ed588df8e91779ddb2a1d56f9d384352 100644 (file)
@@ -29,6 +29,7 @@
 namespace flightgear
 {
   class Hold;
+  class FlightPlan;
 }
 
 typedef std::vector<SGGeod> SGGeodVec;
@@ -37,19 +38,26 @@ class RoutePath
 {
 public:
   RoutePath(const flightgear::WayptVec& wpts);
-
+  RoutePath(const flightgear::FlightPlan* fp);
+  
   SGGeodVec pathForIndex(int index) const;
   
   SGGeod positionForIndex(int index) const;
   
+  double computeDistanceForIndex(int index) const;
+  double computeTrackForIndex(int index) const;
+
 private:
+  void commonInit();
+  
   class PathCtx;
   
   SGGeodVec pathForHold(flightgear::Hold* hold) const;
   
   bool computedPositionForIndex(int index, SGGeod& pos) const;
   double computeAltitudeForIndex(int index) const;
-  double computeTrackForIndex(int index) const;
+  
+  void interpolateGreatCircle(const SGGeod& aFrom, const SGGeod& aTo, SGGeodVec& r) const;
   
   /**
    * Find the distance (in Nm) to climb/descend a height in feet