]> git.mxchange.org Git - flightgear.git/blobdiff - src/Airports/gnnode.cxx
Some cleanup in the ATC/AI code before merging with the next branch:
[flightgear.git] / src / Airports / gnnode.cxx
index b3b34d96001444e52cc03616530c26f1b5aed7e5..ae37d59594a03b65fc86847563820028659507ba 100644 (file)
@@ -2,7 +2,7 @@
 #include "groundnetwork.hxx"
 
 #include <algorithm>
-SG_USING_STD(sort);
+using std::sort;
 
 /*****************************************************************************
  * Helper function for parsing position string
@@ -31,9 +31,9 @@ double processPosition(const string &pos)
   return value;
 }
 
-bool sortByHeadingDiff(FGTaxiSegment *a, FGTaxiSegment *b) {
-  return a->hasSmallerHeadingDiff(*b);
-}
+//bool sortByHeadingDiff(FGTaxiSegment *a, FGTaxiSegment *b) {
+//  return a->hasSmallerHeadingDiff(*b);
+//}
 
 bool sortByLength(FGTaxiSegment *a, FGTaxiSegment *b) {
   return a->getLength() > b->getLength();
@@ -42,14 +42,35 @@ bool sortByLength(FGTaxiSegment *a, FGTaxiSegment *b) {
 /**************************************************************************
  * FGTaxiNode
  *************************************************************************/
-FGTaxiNode::FGTaxiNode()
+void FGTaxiNode::setElevation(double val)
+{
+    geod.setElevationM(val);
+}
+
+void FGTaxiNode::setLatitude (double val)
 {
+  geod.setLatitudeDeg(val);
 }
 
-void FGTaxiNode::sortEndSegments(bool byLength)
+void FGTaxiNode::setLongitude(double val)
 {
-  if (byLength)
-    sort(next.begin(), next.end(), sortByLength);
-  else
-    sort(next.begin(), next.end(), sortByHeadingDiff);
+  geod.setLongitudeDeg(val);
 }
+
+void FGTaxiNode::setLatitude (const string& val)
+{
+  geod.setLatitudeDeg(processPosition(val));
+}
+
+void FGTaxiNode::setLongitude(const string& val)
+{
+  geod.setLongitudeDeg(processPosition(val));
+}
+  
+//void FGTaxiNode::sortEndSegments(bool byLength)
+//{
+//  if (byLength)
+//    sort(next.begin(), next.end(), sortByLength);
+//  else
+//    sort(next.begin(), next.end(), sortByHeadingDiff);
+//}