#ifndef FG_ROUTE_PATH_HXX
#define FG_ROUTE_PATH_HXX
+#include <memory>
#include <Navaids/route.hxx>
namespace flightgear
class RoutePath
{
public:
- RoutePath(const flightgear::WayptVec& wpts);
RoutePath(const flightgear::FlightPlan* fp);
-
+ ~RoutePath();
+
SGGeodVec pathForIndex(int index) const;
SGGeod positionForIndex(int index) const;
+
+ SGGeod positionForDistanceFrom(int index, double distanceM) const;
+
+ double trackForIndex(int index) const;
- double computeDistanceForIndex(int index) const;
- double computeTrackForIndex(int index) const;
+ double distanceForIndex(int index) const;
+
+ double distanceBetweenIndices(int from, int to) const;
private:
- void commonInit();
+ class RoutePathPrivate;
- class PathCtx;
+ void commonInit();
+ double computeDistanceForIndex(int index) const;
+
SGGeodVec pathForHold(flightgear::Hold* hold) const;
- bool computedPositionForIndex(int index, SGGeod& pos) const;
- double computeAltitudeForIndex(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
- */
- double distanceForClimb(double climbFt) const;
- double magVarFor(const SGGeod& gd) const;
-
- flightgear::WayptVec _waypts;
-
- int _pathClimbFPM; ///< climb-rate to use for pathing
- int _pathDescentFPM; ///< descent rate to use (feet-per-minute)
- int _pathIAS; ///< IAS (knots) to use for pathing
- double _pathTurnRate; ///< degrees-per-second, defaults to 3, i.e 180 in a minute
+ std::auto_ptr<RoutePathPrivate> d;
};
#endif