| 1 | #ifndef FG_NAV_LEVELDXML_HXX |
| 2 | #define FG_NAV_LEVELDXML_HXX |
| 3 | |
| 4 | class FGAirport; |
| 5 | class SGPath; |
| 6 | |
| 7 | #include <simgear/xml/easyxml.hxx> |
| 8 | #include <simgear/misc/sg_path.hxx> |
| 9 | #include <Navaids/procedure.hxx> |
| 10 | |
| 11 | namespace flightgear |
| 12 | { |
| 13 | |
| 14 | class NavdataVisitor : public XMLVisitor { |
| 15 | public: |
| 16 | NavdataVisitor(FGAirport* aApt, const SGPath& aPath); |
| 17 | |
| 18 | protected: |
| 19 | virtual void startXML (); |
| 20 | virtual void endXML (); |
| 21 | virtual void startElement (const char * name, const XMLAttributes &atts); |
| 22 | virtual void endElement (const char * name); |
| 23 | virtual void data (const char * s, int len); |
| 24 | virtual void pi (const char * target, const char * data); |
| 25 | virtual void warning (const char * message, int line, int column); |
| 26 | virtual void error (const char * message, int line, int column); |
| 27 | |
| 28 | private: |
| 29 | Waypt* buildWaypoint(RouteBase* owner); |
| 30 | void processRunways(ArrivalDeparture* aProc, const XMLAttributes &atts); |
| 31 | |
| 32 | void finishApproach(); |
| 33 | void finishSid(); |
| 34 | void finishStar(); |
| 35 | |
| 36 | FGAirport* _airport; |
| 37 | SGPath _path; |
| 38 | std::string _text; ///< last element text value |
| 39 | |
| 40 | SID* _sid; |
| 41 | STAR* _star; |
| 42 | Approach* _approach; |
| 43 | Transition* _transition; |
| 44 | Procedure* _procedure; |
| 45 | |
| 46 | WayptVec _waypoints; ///< waypoint list for current approach/sid/star |
| 47 | WayptVec _transWaypts; ///< waypoint list for current transition |
| 48 | |
| 49 | std::string _wayptName; |
| 50 | std::string _wayptType; |
| 51 | std::string _ident; // id of segment under construction |
| 52 | std::string _transIdent; |
| 53 | double _longitude, _latitude, _altitude, _speed; |
| 54 | RouteRestriction _altRestrict; |
| 55 | bool _overflightWaypt; |
| 56 | |
| 57 | double _holdRadial; // inbound hold radial, or -1 if radial is 'inbound' |
| 58 | double _holdTD; ///< hold time (seconds) or distance (nm), based on flag below |
| 59 | bool _holdRighthanded; |
| 60 | bool _holdDistance; // true, TD is distance in nm; false, TD is time in seconds |
| 61 | |
| 62 | double _courseOrHeading, _radial, _dmeDistance; |
| 63 | bool _courseFlag; |
| 64 | }; |
| 65 | |
| 66 | } |
| 67 | |
| 68 | #endif |