1 // FGAIFlightPlan - class for loading and storing AI flight plans
2 // Written by David Culp, started May 2004
3 // - davidculp2@comcast.net
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License as
7 // published by the Free Software Foundation; either version 2 of the
8 // License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful, but
11 // WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 #ifndef _FG_AIFLIGHTPLAN_HXX
20 #define _FG_AIFLIGHTPLAN_HXX
22 #include <simgear/compiler.h>
26 #include <Airports/simple.hxx>
27 #include <Airports/runways.hxx>
35 class FGAIFlightPlan {
52 FGAIFlightPlan(string filename);
53 FGAIFlightPlan(FGAIModelEntity *entity,
65 waypoint* getPreviousWaypoint( void );
66 waypoint* getCurrentWaypoint( void );
67 waypoint* getNextWaypoint( void );
68 void IncrementWaypoint( bool erase );
70 double getDistanceToGo(double lat, double lon, waypoint* wp);
71 int getLeg () { return leg;};
72 void setLeadDistance(double speed, double bearing, waypoint* current, waypoint* next);
73 void setLeadDistance(double distance_ft);
74 double getLeadDistance( void ) const {return lead_distance;}
75 double getBearing(waypoint* previous, waypoint* next);
76 double getBearing(double lat, double lon, waypoint* next);
77 time_t getStartTime() { return start_time; };
79 void create(FGAirport *dep, FGAirport *arr, int leg, double alt, double speed, double lat, double lon,
80 bool firstLeg, double radius, string fltType, string aircraftType, string airline);
82 void setLeg(int val) { leg = val;};
83 void setTime(time_t st) { start_time = st; };
84 int getGate() { return gateId; };
85 double getLeadInAngle() { return leadInAngle; };
86 string getRunway() { return rwy._rwy_no; };
87 string getRunwayId() { return rwy._id; };
90 typedef vector <waypoint*> wpt_vector_type;
91 typedef wpt_vector_type::iterator wpt_vector_iterator;
93 wpt_vector_type waypoints;
94 wpt_vector_iterator wpt_iterator;
96 double distance_to_go;
103 void createPushBack(bool, FGAirport*, double, double, double, string, string, string);
104 void createTaxi(bool, int, FGAirport *, double, string, string, string);
105 void createTakeOff(bool, FGAirport *, double);
106 void createClimb(bool, FGAirport *, double, double);
107 void createCruise(bool, FGAirport*, FGAirport*, double, double, double, double);
108 void createDecent(FGAirport *);
109 void createLanding(FGAirport *);
110 void createParking(FGAirport *);
111 void deleteWaypoints();
112 void resetWaypoints();
117 #endif // _FG_AIFLIGHTPLAN_HXX