1 // This program is free software; you can redistribute it and/or
2 // modify it under the terms of the GNU General Public License as
3 // published by the Free Software Foundation; either version 2 of the
4 // License, or (at your option) any later version.
6 // This program is distributed in the hope that it will be useful, but
7 // WITHOUT ANY WARRANTY; without even the implied warranty of
8 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9 // General Public License for more details.
11 // You should have received a copy of the GNU General Public License
12 // along with this program; if not, write to the Free Software
13 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #include <simgear/compiler.h>
27 typedef vector<FGTaxiSegment*> FGTaxiSegmentVector;
28 typedef FGTaxiSegmentVector::iterator FGTaxiSegmentVectorIterator;
30 bool sortByHeadingDiff(FGTaxiSegment *a, FGTaxiSegment *b);
31 bool sortByLength (FGTaxiSegment *a, FGTaxiSegment *b);
32 double processPosition(const string& pos);
40 FGTaxiSegmentVector next; // a vector of pointers to all the segments leaving from this node
44 FGTaxiNode(double, double, int);
46 void setIndex(int idx) { index = idx;};
47 void setLatitude (double val) { lat = val;};
48 void setLongitude(double val) { lon = val;};
49 void setLatitude (const string& val) { lat = processPosition(val); };
50 void setLongitude(const string& val) { lon = processPosition(val); };
51 void addSegment(FGTaxiSegment *segment) { next.push_back(segment); };
53 double getLatitude() { return lat;};
54 double getLongitude(){ return lon;};
56 int getIndex() { return index; };
57 FGTaxiNode *getAddress() { return this;};
58 FGTaxiSegmentVectorIterator getBeginRoute() { return next.begin(); };
59 FGTaxiSegmentVectorIterator getEndRoute() { return next.end(); };
60 bool operator<(const FGTaxiNode &other) const { return index < other.index; };
62 void sortEndSegments(bool);
64 // used in way finding
66 FGTaxiNode* previousnode;
67 FGTaxiSegment* previousseg;
71 typedef vector<FGTaxiNode*> FGTaxiNodeVector;
72 typedef FGTaxiNodeVector::iterator FGTaxiNodeVectorIterator;