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.
22 #include <simgear/compiler.h>
23 #include <simgear/structure/SGSharedPtr.hxx>
25 #include <Navaids/positioned.hxx>
29 typedef std::vector<FGTaxiSegment*> FGTaxiSegmentVector;
30 typedef FGTaxiSegmentVector::iterator FGTaxiSegmentVectorIterator;
32 bool sortByHeadingDiff(FGTaxiSegment *a, FGTaxiSegment *b);
33 bool sortByLength (FGTaxiSegment *a, FGTaxiSegment *b);
35 class FGTaxiNode : public FGPositioned
42 FGTaxiSegmentVector next; // a vector of pointers to all the segments leaving from this node
44 // used in way finding - should really move to a dynamic struct
46 FGTaxiNode* previousNode;
47 FGTaxiSegment* previousSeg;
51 FGTaxiNode(PositionedID aGuid, int index, const SGGeod& pos, bool aOnRunway, int aHoldType);
52 virtual ~FGTaxiNode();
54 void setElevation(double val);
55 void addSegment(FGTaxiSegment *segment) { next.push_back(segment); };
57 void setPathScore (double val) { pathScore = val; };
58 void setPreviousNode(FGTaxiNode *val) { previousNode = val; };
59 void setPreviousSeg (FGTaxiSegment *val) { previousSeg = val; };
61 FGTaxiNode *getPreviousNode() { return previousNode; };
62 FGTaxiSegment *getPreviousSegment() { return previousSeg; };
64 double getPathScore() { return pathScore; };
66 double getElevationM (double refelev);
67 double getElevationFt(double refelev);
69 int getIndex() const { return index; };
70 int getHoldPointType() const { return holdType; };
71 bool getIsOnRunway() const { return isOnRunway; };
73 const FGTaxiSegmentVector& arcs() const
76 /// find the arg which leads from this node to another.
77 /// returns NULL if no such arc exists.
78 FGTaxiSegment* getArcTo(FGTaxiNode* aEnd) const;
80 bool operator<(const FGTaxiNode &other) const { return index < other.index; };
85 typedef SGSharedPtr<FGTaxiNode> FGTaxiNode_ptr;
86 typedef std::vector<FGTaxiNode_ptr> FGTaxiNodeVector;
87 typedef FGTaxiNodeVector::iterator FGTaxiNodeVectorIterator;