2 #include "groundnetwork.hxx"
8 /*****************************************************************************
9 * Helper function for parsing position string
10 ****************************************************************************/
11 double processPosition(const string &pos)
20 prefix= subs.substr(0,1);
21 if (prefix == string("S") || (prefix == string("W")))
23 subs = subs.substr(1, subs.length());
24 degree = subs.substr(0, subs.find(" ",0));
25 decimal = subs.substr(subs.find(" ",0), subs.length());
28 //cerr << sign << " "<< degree << " " << decimal << endl;
29 value = sign * (atof(degree.c_str()) + atof(decimal.c_str())/60.0);
30 //cerr << value <<endl;
35 //bool sortByHeadingDiff(FGTaxiSegment *a, FGTaxiSegment *b) {
36 // return a->hasSmallerHeadingDiff(*b);
39 bool sortByLength(FGTaxiSegment *a, FGTaxiSegment *b) {
40 return a->getLength() > b->getLength();
43 /**************************************************************************
45 *************************************************************************/
46 void FGTaxiNode::setElevation(double val)
48 geod.setElevationM(val);
51 void FGTaxiNode::setLatitude (double val)
53 geod.setLatitudeDeg(val);
56 void FGTaxiNode::setLongitude(double val)
58 geod.setLongitudeDeg(val);
61 void FGTaxiNode::setLatitude (const string& val)
63 geod.setLatitudeDeg(processPosition(val));
66 void FGTaxiNode::setLongitude(const string& val)
68 geod.setLongitudeDeg(processPosition(val));
71 //void FGTaxiNode::sortEndSegments(bool byLength)
74 // sort(next.begin(), next.end(), sortByLength);
76 // sort(next.begin(), next.end(), sortByHeadingDiff);