#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>
#include "parking.hxx"
#include <ATC/trafficcontrol.hxx>
+
class FGTaxiSegment; // forward reference
class FGAIFlightPlan; // forward reference
class FGAirport; // forward reference
int startNode;
int endNode;
double length;
- double course;
- double headingDiff;
+ double heading;
+ SGGeod center;
bool isActive;
bool isPushBackRoute;
FGTaxiNode *start;
startNode(0),
endNode(0),
length(0),
- course(0),
- headingDiff(0),
+ heading(0),
isActive(0),
isPushBackRoute(0),
start(0),
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),
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;
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);
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);
intVec nodes;
intVec routes;
double distance;
- int depth;
+// int depth;
intVecIterator currNode;
intVecIterator currRoute;
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;
nodes(copy.nodes),
routes(copy.routes),
distance(copy.distance),
- depth(copy.depth),
+// depth(copy.depth),
currNode(nodes.begin()),
currRoute(routes.begin())
{};
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;
TaxiRouteVector routes;
TrafficVector activeTraffic;
TrafficVectorIterator currTraffic;
- SGWayPoint destination;
bool foundRoute;
double totalDistance, maxDistance;
void checkHoldPosition(int id, double lat, double lon,
double heading, double speed, double alt);
+
+
public:
FGGroundNetwork();
~FGGroundNetwork();
void init();
bool exists() { return hasNetwork; };
void setTowerController(FGTowerController *twrCtrlr) { towerController = twrCtrlr; };
+
int findNearestNode(double lat, double lon);
- FGTaxiNode *findNode(int idx);
- FGTaxiSegment *findSegment(int idx);
+ int findNearestNode(const SGGeod& aGeod);
+
+ FGTaxiNode *findNode(unsigned idx);
+ FGTaxiSegment *findSegment(unsigned idx);
FGTaxiRoute findShortestRoute(int start, int end, bool fullSearch=true);
//void trace(FGTaxiNode *, int, int, double dist);
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();
+
};