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 *************************************************************************/
45 void FGTaxiNode::setElevation(double val)
47 geod.setElevationM(val);
50 void FGTaxiNode::setLatitude (double val)
52 geod.setLatitudeDeg(val);
55 void FGTaxiNode::setLongitude(double val)
57 geod.setLongitudeDeg(val);
60 void FGTaxiNode::setLatitude (const string& val)
62 geod.setLatitudeDeg(processPosition(val));
65 void FGTaxiNode::setLongitude(const string& val)
67 geod.setLongitudeDeg(processPosition(val));
70 //void FGTaxiNode::sortEndSegments(bool byLength)
73 // sort(next.begin(), next.end(), sortByLength);
75 // sort(next.begin(), next.end(), sortByHeadingDiff);