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);
43 FGTaxiSegmentVector next; // a vector of pointers to all the segments leaving from this node
45 // used in way finding
47 FGTaxiNode* previousNode;
48 FGTaxiSegment* previousSeg;
63 FGTaxiNode(const FGTaxiNode &other) :
67 isOnRunway(other.isOnRunway),
68 holdType(other.holdType),
70 pathScore(other.pathScore),
71 previousNode(other.previousNode),
72 previousSeg(other.previousSeg)
76 FGTaxiNode &operator =(const FGTaxiNode &other)
81 isOnRunway = other.isOnRunway;
82 holdType = other.holdType;
84 pathScore = other.pathScore;
85 previousNode = other.previousNode;
86 previousSeg = other.previousSeg;
90 void setIndex(int idx) { index = idx; };
91 void setLatitude (double val) { lat = val; };
92 void setLongitude(double val) { lon = val; };
93 void setLatitude (const string& val) { lat = processPosition(val); };
94 void setLongitude(const string& val) { lon = processPosition(val); };
95 void addSegment(FGTaxiSegment *segment) { next.push_back(segment); };
96 void setHoldPointType(int val) { holdType = val; };
97 void setOnRunway(bool val) { isOnRunway = val; };
99 void setPathScore (double val) { pathScore = val; };
100 void setPreviousNode(FGTaxiNode *val) { previousNode = val; };
101 void setPreviousSeg (FGTaxiSegment *val) { previousSeg = val; };
103 FGTaxiNode *getPreviousNode() { return previousNode; };
104 FGTaxiSegment *getPreviousSegment() { return previousSeg; };
106 double getPathScore() { return pathScore; };
107 double getLatitude() { return lat;};
108 double getLongitude(){ return lon;};
110 int getIndex() { return index; };
111 int getHoldPointType() { return holdType; };
112 bool getIsOnRunway() { return isOnRunway; };
114 FGTaxiNode *getAddress() { return this;};
115 FGTaxiSegmentVectorIterator getBeginRoute() { return next.begin(); };
116 FGTaxiSegmentVectorIterator getEndRoute() { return next.end(); };
117 bool operator<(const FGTaxiNode &other) const { return index < other.index; };
119 void sortEndSegments(bool);
123 typedef vector<FGTaxiNode*> FGTaxiNodeVector;
124 typedef FGTaxiNodeVector::iterator FGTaxiNodeVectorIterator;