X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAirports%2Fgnnode.hxx;h=3358ea51e6e891a87adebad77adef2958bb3ec80;hb=386aefe69358ce41a11c9afeb8f56e26758fe56b;hp=54dd662841952afb6736758293ed97d37cc95628;hpb=b452234cb203c3336cfc5299be8ff4789a0eb416;p=flightgear.git diff --git a/src/Airports/gnnode.hxx b/src/Airports/gnnode.hxx index 54dd66284..3358ea51e 100644 --- a/src/Airports/gnnode.hxx +++ b/src/Airports/gnnode.hxx @@ -18,42 +18,94 @@ #include #include -#include -SG_USING_STD(string); -SG_USING_STD(vector); +#include +#include class FGTaxiSegment; -typedef vector FGTaxiSegmentVector; +typedef std::vector FGTaxiSegmentVector; typedef FGTaxiSegmentVector::iterator FGTaxiSegmentVectorIterator; bool sortByHeadingDiff(FGTaxiSegment *a, FGTaxiSegment *b); bool sortByLength (FGTaxiSegment *a, FGTaxiSegment *b); -double processPosition(const string& pos); class FGTaxiNode { private: - double lat; - double lon; + SGGeod geod; int index; + + bool isOnRunway; + int holdType; FGTaxiSegmentVector next; // a vector of pointers to all the segments leaving from this node - + + // used in way finding + double pathScore; + FGTaxiNode* previousNode; + FGTaxiSegment* previousSeg; + public: - FGTaxiNode(); - FGTaxiNode(double, double, int); - - void setIndex(int idx) { index = idx;}; - void setLatitude (double val) { lat = val;}; - void setLongitude(double val) { lon = val;}; - void setLatitude (const string& val) { lat = processPosition(val); }; - void setLongitude(const string& val) { lon = processPosition(val); }; - void addSegment(FGTaxiSegment *segment) { next.push_back(segment); }; - - double getLatitude() { return lat;}; - double getLongitude(){ return lon;}; + FGTaxiNode() : + index(0), + isOnRunway(false), + holdType(0), + pathScore(0), + previousNode(0), + previousSeg(0) +{ +}; + + FGTaxiNode(const FGTaxiNode &other) : + geod(other.geod), + index(other.index), + isOnRunway(other.isOnRunway), + holdType(other.holdType), + next(other.next), + pathScore(other.pathScore), + previousNode(other.previousNode), + previousSeg(other.previousSeg) +{ +}; + +FGTaxiNode &operator =(const FGTaxiNode &other) +{ + geod = other.geod; + index = other.index; + isOnRunway = other.isOnRunway; + holdType = other.holdType; + next = other.next; + pathScore = other.pathScore; + previousNode = other.previousNode; + previousSeg = other.previousSeg; + return *this; +}; + + void setIndex(int idx) { index = idx; }; + void setLatitude (double val); + void setLongitude(double val); + void setLatitude (const std::string& val); + void setLongitude(const std::string& val); + void addSegment(FGTaxiSegment *segment) { next.push_back(segment); }; + void setHoldPointType(int val) { holdType = val; }; + void setOnRunway(bool val) { isOnRunway = val; }; + + void setPathScore (double val) { pathScore = val; }; + void setPreviousNode(FGTaxiNode *val) { previousNode = val; }; + void setPreviousSeg (FGTaxiSegment *val) { previousSeg = val; }; + + FGTaxiNode *getPreviousNode() { return previousNode; }; + FGTaxiSegment *getPreviousSegment() { return previousSeg; }; + + double getPathScore() { return pathScore; }; + double getLatitude() { return geod.getLatitudeDeg();}; + double getLongitude(){ return geod.getLongitudeDeg();}; + + const SGGeod& getGeod() const { return geod; } int getIndex() { return index; }; + int getHoldPointType() { return holdType; }; + bool getIsOnRunway() { return isOnRunway; }; + FGTaxiNode *getAddress() { return this;}; FGTaxiSegmentVectorIterator getBeginRoute() { return next.begin(); }; FGTaxiSegmentVectorIterator getEndRoute() { return next.end(); }; @@ -61,14 +113,9 @@ public: void sortEndSegments(bool); - // used in way finding - double pathscore; - FGTaxiNode* previousnode; - FGTaxiSegment* previousseg; - }; -typedef vector FGTaxiNodeVector; +typedef std::vector FGTaxiNodeVector; typedef FGTaxiNodeVector::iterator FGTaxiNodeVectorIterator; #endif