2 * routePath.hxx - convert a route to straight line segments, for graphical
6 // Written by James Turner, started 2010.
8 // Copyright (C) 2010 Curtis L. Olson
10 // This program is free software; you can redistribute it and/or
11 // modify it under the terms of the GNU General Public License as
12 // published by the Free Software Foundation; either version 2 of the
13 // License, or (at your option) any later version.
15 // This program is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // General Public License for more details.
20 // You should have received a copy of the GNU General Public License
21 // along with this program; if not, write to the Free Software
22 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 #ifndef FG_ROUTE_PATH_HXX
25 #define FG_ROUTE_PATH_HXX
27 #include <Navaids/route.hxx>
35 typedef std::vector<SGGeod> SGGeodVec;
40 RoutePath(const flightgear::WayptVec& wpts);
41 RoutePath(const flightgear::FlightPlan* fp);
43 SGGeodVec pathForIndex(int index) const;
45 SGGeod positionForIndex(int index) const;
47 SGGeod positionForDistanceFrom(int index, double distanceM) const;
49 double trackForIndex(int index) const;
51 double distanceForIndex(int index) const;
53 double distanceBetweenIndices(int from, int to) const;
56 class RoutePathPrivate;
60 double computeDistanceForIndex(int index) const;
62 SGGeodVec pathForHold(flightgear::Hold* hold) const;
65 void interpolateGreatCircle(const SGGeod& aFrom, const SGGeod& aTo, SGGeodVec& r) const;
71 double _pathTurnRate; ///< degrees-per-second, defaults to 3, i.e 180 in a minute