2 #include "groundnetwork.hxx"
7 /*****************************************************************************
8 * Helper function for parsing position string
9 ****************************************************************************/
10 double processPosition(const string &pos)
19 prefix= subs.substr(0,1);
20 if (prefix == string("S") || (prefix == string("W")))
22 subs = subs.substr(1, subs.length());
23 degree = subs.substr(0, subs.find(" ",0));
24 decimal = subs.substr(subs.find(" ",0), subs.length());
27 //cerr << sign << " "<< degree << " " << decimal << endl;
28 value = sign * (atof(degree.c_str()) + atof(decimal.c_str())/60.0);
29 //cerr << value <<endl;
34 bool sortByHeadingDiff(FGTaxiSegment *a, FGTaxiSegment *b) {
35 return a->hasSmallerHeadingDiff(*b);
38 bool sortByLength(FGTaxiSegment *a, FGTaxiSegment *b) {
39 return a->getLength() > b->getLength();
42 /**************************************************************************
44 *************************************************************************/
47 void FGTaxiNode::sortEndSegments(bool byLength)
50 sort(next.begin(), next.end(), sortByLength);
52 sort(next.begin(), next.end(), sortByHeadingDiff);