]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATCDCL/tower.hxx
Fix bug 191, uninitialised HUD color.
[flightgear.git] / src / ATCDCL / tower.hxx
index ad1c2ba17d4d4893602f17e88795024e4f64d9a2..fa7115c0ddaefafae25dcdc05a83d0406956bd1a 100644 (file)
 #define _FG_TOWER_HXX
 
 #include <simgear/compiler.h>
-#include <simgear/math/point3d.hxx>
+#include <simgear/math/SGMath.hxx>
 #include <simgear/misc/sgstream.hxx>
-#include <plib/sg.h>
 
 #include <iosfwd>
-#include STL_STRING
+#include <string>
+#include <list>
 
 #include "ATC.hxx"
 #include "ATCProjection.hxx"
-#include "AIPlane.hxx"
 
 class FGATCMgr;
 class FGGround;
@@ -49,6 +48,32 @@ enum tower_traffic_type {
 
 ostream& operator << (ostream& os, tower_traffic_type ttt);
 
+enum PatternLeg {
+       TAKEOFF_ROLL,
+       CLIMBOUT,
+       TURN1,
+       CROSSWIND,
+       TURN2,
+       DOWNWIND,
+       TURN3,
+       BASE,
+       TURN4,
+       FINAL,
+       LANDING_ROLL,
+       LEG_UNKNOWN
+};
+
+ostream& operator << (ostream& os, PatternLeg pl);
+
+enum LandingType {
+       FULL_STOP,
+       STOP_AND_GO,
+       TOUCH_AND_GO,
+       AIP_LT_UNKNOWN
+};
+
+ostream& operator << (ostream& os, LandingType lt);
+
 enum tower_callback_type {
        USER_REQUEST_VFR_DEPARTURE = 1,
        USER_REQUEST_VFR_ARRIVAL = 2,
@@ -71,13 +96,12 @@ public:
        
        TowerPlaneRec();
        TowerPlaneRec(const PlaneRec& p);
-       TowerPlaneRec(const Point3D& pt);
-       TowerPlaneRec(const PlaneRec& p, const Point3D& pt);
+       TowerPlaneRec(const SGGeod& pt);
+       TowerPlaneRec(const PlaneRec& p, const SGGeod& pt);
        
-       FGAIPlane* planePtr;    // This might move to the planeRec eventually
        PlaneRec plane;
        
-       Point3D pos;
+       SGGeod pos;
        double eta;             // seconds
        double dist_out;        // meters from theshold
        bool clearedToLand;
@@ -136,8 +160,6 @@ public:
        // eg "Cessna Charlie Foxtrot Golf Foxtrot Sierra eight miles South of the airport for full stop with Bravo"
        // This function probably only called via user interaction - AI planes will have an overloaded function taking a planerec.
        void VFRArrivalContact(const std::string& ID, const LandingType& opt = AIP_LT_UNKNOWN);
-       // For the AI planes...
-       void VFRArrivalContact(const PlaneRec& plane, FGAIPlane* requestee, const LandingType& lt = AIP_LT_UNKNOWN);
        
        void RequestDepartureClearance(const std::string& ID);
        void RequestTakeOffClearance(const std::string& ID);
@@ -151,16 +173,6 @@ public:
        void ReportDownwind(const std::string& ID);
        void ReportGoingAround(const std::string& ID);
        
-       // Contact tower when at a hold short for departure - for now we'll assume plane - maybe vehicles might want to cross runway eventually?
-       void ContactAtHoldShort(const PlaneRec& plane, FGAIPlane* requestee, tower_traffic_type operation);
-       
-       // Register the presence of an AI plane at a point where contact would already have been made in real life
-       // CAUTION - currently it is assumed that this plane's callsign is unique - it is up to AIMgr to generate unique callsigns.
-       void RegisterAIPlane(const PlaneRec& plane, FGAIPlane* ai, const tower_traffic_type& op, const PatternLeg& lg = LEG_UNKNOWN);
-       
-       // Deregister and remove an AI plane.
-       void DeregisterAIPlane(const std::string& id);
-       
        // Public interface to the active runway - this will get more complex 
        // in the future and consider multi-runway use, airplane weight etc.
        inline const std::string& GetActiveRunway() const { return activeRwy; }
@@ -214,10 +226,10 @@ private:
        
        // Figure out if a given position lies on the active runway
        // Might have to change when we consider more than one active rwy.
-       bool OnActiveRunway(const Point3D& pt);
+       bool OnActiveRunway(const SGGeod& pt);
        
        // Figure out if a given position lies on a runway or not
-       bool OnAnyRunway(const Point3D& pt, bool onGround);
+       bool OnAnyRunway(const SGGeod& pt, bool onGround);
        
        // Calculate the eta of a plane to the threshold.
        // For ground traffic this is the fastest they can get there.