1 // route_mgr.hxx - manage a route (i.e. a collection of waypoints)
3 // Written by Curtis Olson, started January 2004.
5 // Copyright (C) 2004 Curtis L. Olson - http://www.flightgear.org/~curt
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #ifndef _ROUTE_MGR_HXX
25 #define _ROUTE_MGR_HXX 1
28 # error This library requires C++
35 #include <simgear/compiler.h>
43 #include <simgear/props/props.hxx>
44 #include <simgear/route/route.hxx>
45 #include <simgear/structure/subsystem_mgr.hxx>
49 * Top level route manager class
53 class FGRouteMgr : public SGSubsystem
66 SGPropertyNode *true_hdg_deg;
68 SGPropertyNode *wp0_id;
69 SGPropertyNode *wp0_dist;
70 SGPropertyNode *wp0_eta;
72 SGPropertyNode *wp1_id;
73 SGPropertyNode *wp1_dist;
74 SGPropertyNode *wp1_eta;
76 SGPropertyNode *wpn_id;
77 SGPropertyNode *wpn_dist;
78 SGPropertyNode *wpn_eta;
89 void update (double dt);
93 void add_waypoint( const SGWayPoint& wp ) {
94 route->add_waypoint( wp );
97 SGWayPoint get_waypoint( int i ) const {
98 return route->get_waypoint(i);
101 SGWayPoint pop_waypoint();
104 return route->size();
109 #endif // _ROUTE_MGR_HXX