]> git.mxchange.org Git - flightgear.git/blobdiff - src/Airports/groundnetwork.hxx
Merge branch 'next' into durk-atc
[flightgear.git] / src / Airports / groundnetwork.hxx
index 10a78b275abc236cfd547bf229358a9333684243..87dafe0a01d44f65dc9517aa2bf754b1b529156c 100644 (file)
 #ifndef _GROUNDNETWORK_HXX_
 #define _GROUNDNETWORK_HXX_
 
+#include <osg/Geode>
+#include <osg/Geometry>
+#include <osg/MatrixTransform>
+#include <osg/Shape>
+
+
 #include <simgear/compiler.h>
 #include <simgear/route/waypoint.hxx>
 
@@ -37,6 +43,7 @@ using std::vector;
 #include "parking.hxx"
 #include <ATC/trafficcontrol.hxx>
 
+
 class FGTaxiSegment; // forward reference
 class FGAIFlightPlan; // forward reference
 class FGAirport;      // forward reference
@@ -56,8 +63,8 @@ private:
   int startNode;
   int endNode;
   double length;
-  double course;
-  double headingDiff;
+  double heading;
+  SGGeod center;
   bool isActive;
   bool isPushBackRoute;
   FGTaxiNode *start;
@@ -72,8 +79,7 @@ public:
       startNode(0),
       endNode(0),
       length(0),
-      course(0),
-      headingDiff(0),
+      heading(0),
       isActive(0),
       isPushBackRoute(0),
       start(0),
@@ -87,8 +93,8 @@ public:
       startNode         (other.startNode),
       endNode           (other.endNode),
       length            (other.length),
-      course            (other.course),
-      headingDiff       (other.headingDiff),
+      heading           (other.heading),
+      center            (other.center),
       isActive          (other.isActive),
       isPushBackRoute   (other.isPushBackRoute),
       start             (other.start),
@@ -103,8 +109,8 @@ public:
       startNode          = other.startNode;
       endNode            = other.endNode;
       length             = other.length;
-      course             = other.course;
-      headingDiff        = other.headingDiff;
+      heading            = other.heading;
+      center             = other.center;
       isActive           = other.isActive;
       isPushBackRoute    = other.isPushBackRoute;
       start              = other.start;
@@ -123,13 +129,15 @@ public:
   void setStart(FGTaxiNodeVector *nodes);
   void setEnd  (FGTaxiNodeVector *nodes);
   void setPushBackType(bool val) { isPushBackRoute = val; };
-  void setTrackDistance();
+  void setDimensions(double elevation);
 
   FGTaxiNode * getEnd() { return end;};
   FGTaxiNode * getStart() { return start; };
   double getLength() { return length; };
   int getIndex() { return index; };
-  
+  double getLatitude()  { return center.getLatitudeDeg();  };
+  double getLongitude() { return center.getLongitudeDeg(); };
+  double getHeading()   { return heading; }; 
   bool isPushBack() { return isPushBackRoute; };
 
   int getPenalty(int nGates);
@@ -137,7 +145,7 @@ public:
   FGTaxiSegment *getAddress() { return this;};
 
   bool operator<(const FGTaxiSegment &other) const { return index < other.index; };
-  bool hasSmallerHeadingDiff (const FGTaxiSegment &other) const { return headingDiff < other.headingDiff; };
+  //bool hasSmallerHeadingDiff (const FGTaxiSegment &other) const { return headingDiff < other.headingDiff; };
   FGTaxiSegment *opposite() { return oppositeDirection; };
   void setCourseDiff(double crse);
 
@@ -162,7 +170,7 @@ private:
   intVec nodes;
   intVec routes;
   double distance;
-  int depth;
+//  int depth;
   intVecIterator currNode;
   intVecIterator currRoute;
 
@@ -173,14 +181,15 @@ public:
     routes = rts;
     distance = dist; 
     currNode = nodes.begin();
-    depth = dpth;
+    currRoute = routes.begin();
+//    depth = dpth;
   };
 
   FGTaxiRoute& operator= (const FGTaxiRoute &other) {
     nodes = other.nodes;
     routes = other.routes;
     distance = other.distance;
-    depth = other.depth;
+//    depth = other.depth;
     currNode = nodes.begin();
     currRoute = routes.begin();
     return *this;
@@ -190,7 +199,7 @@ public:
     nodes(copy.nodes),
     routes(copy.routes),
     distance(copy.distance),
-    depth(copy.depth),
+//    depth(copy.depth),
     currNode(nodes.begin()),
     currRoute(routes.begin())
   {};
@@ -203,7 +212,7 @@ public:
   
   void first() { currNode = nodes.begin(); currRoute = routes.begin(); };
   int size() { return nodes.size(); };
-  int getDepth() { return depth; };
+//  int getDepth() { return depth; };
 };
 
 typedef vector<FGTaxiRoute> TaxiRouteVector;
@@ -241,6 +250,8 @@ private:
   void checkHoldPosition(int id, double lat, double lon, 
                         double heading, double speed, double alt);
 
+
+
 public:
   FGGroundNetwork();
   ~FGGroundNetwork();
@@ -252,10 +263,10 @@ public:
   void init();
   bool exists() { return hasNetwork; };
   void setTowerController(FGTowerController *twrCtrlr) { towerController = twrCtrlr; };
-  
+
   int findNearestNode(double lat, double lon);
   int findNearestNode(const SGGeod& aGeod);
-  
+
   FGTaxiNode *findNode(unsigned idx);
   FGTaxiSegment *findSegment(unsigned idx);
   FGTaxiRoute findShortestRoute(int start, int end, bool fullSearch=true);
@@ -269,11 +280,16 @@ public:
                                double lat, double lon, double hdg, double spd, double alt, 
                                double radius, int leg, FGAIAircraft *aircraft);
   virtual void signOff(int id);
-  virtual void update(int id, double lat, double lon, double heading, double speed, double alt, double dt);
+  virtual void updateAircraftInformation(int id, double lat, double lon, double heading, double speed, double alt, double dt);
   virtual bool hasInstruction(int id);
   virtual FGATCInstruction getInstruction(int id);
 
+  bool checkTransmissionState(int minState, int MaxState, TrafficVectorIterator i, time_t now, AtcMsgId msgId,
+                               AtcMsgDir msgDir);
   bool checkForCircularWaits(int id);
+  virtual void render(bool);
+  virtual string getName();
+
 };