X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FNavaids%2FroutePath.hxx;h=49b44de4a01d2b3db0285700b765980c6eac86b8;hb=56d7d049bc0b7361d1799298c38e61084f5d5e3f;hp=d04c03d08198996db56199bf7e54bdbec44c72fb;hpb=622f71c01c70a81db94a7e670953645d0c9129e5;p=flightgear.git diff --git a/src/Navaids/routePath.hxx b/src/Navaids/routePath.hxx index d04c03d08..49b44de4a 100644 --- a/src/Navaids/routePath.hxx +++ b/src/Navaids/routePath.hxx @@ -24,11 +24,13 @@ #ifndef FG_ROUTE_PATH_HXX #define FG_ROUTE_PATH_HXX +#include #include namespace flightgear { class Hold; + class FlightPlan; } typedef std::vector SGGeodVec; @@ -36,34 +38,35 @@ typedef std::vector SGGeodVec; 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 distanceForIndex(int index) const; + double distanceBetweenIndices(int from, int to) const; + private: - class PathCtx; + class RoutePathPrivate; + + 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; - double computeTrackForIndex(int index) const; - /** - * Find the distance (in Nm) to climb/descend a height in feet - */ - double distanceForClimb(double climbFt) const; + void interpolateGreatCircle(const SGGeod& aFrom, const SGGeod& aTo, SGGeodVec& r) 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 d; }; #endif