X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAirports%2Fgnnode.hxx;h=a7627715e8e55190add131526e69edc09bcda447;hb=808c4c635d9d07f812041169d4b30257fd80742f;hp=d265ff5ad913eecd30925f234599486f5170dece;hpb=871b92ae339b33a2c6ee5ede4a61dbc39c9ca3f3;p=flightgear.git diff --git a/src/Airports/gnnode.hxx b/src/Airports/gnnode.hxx index d265ff5ad..a7627715e 100644 --- a/src/Airports/gnnode.hxx +++ b/src/Airports/gnnode.hxx @@ -22,22 +22,17 @@ #include #include -using std::string; -using std::vector; - 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; @@ -51,8 +46,6 @@ private: public: FGTaxiNode() : - lat (0.0), - lon (0.0), index(0), isOnRunway(false), holdType(0), @@ -63,8 +56,7 @@ public: }; FGTaxiNode(const FGTaxiNode &other) : - lat(other.lat), - lon(other.lon), + geod(other.geod), index(other.index), isOnRunway(other.isOnRunway), holdType(other.holdType), @@ -77,8 +69,7 @@ public: FGTaxiNode &operator =(const FGTaxiNode &other) { - lat = other.lat; - lon = other.lon; + geod = other.geod; index = other.index; isOnRunway = other.isOnRunway; holdType = other.holdType; @@ -90,10 +81,11 @@ FGTaxiNode &operator =(const FGTaxiNode &other) }; 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 setLatitude (double val); + void setLongitude(double val); + void setElevation(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; }; @@ -106,10 +98,11 @@ FGTaxiNode &operator =(const FGTaxiNode &other) FGTaxiSegment *getPreviousSegment() { return previousSeg; }; double getPathScore() { return pathScore; }; - double getLatitude() { return lat;}; - double getLongitude(){ return lon;}; + double getLatitude() { return geod.getLatitudeDeg();}; + double getLongitude(){ return geod.getLongitudeDeg();}; + double getElevation() { return geod.getElevationM();}; - SGGeod geod() const { return SGGeod::fromDeg(lon, lat); } + const SGGeod& getGeod() const { return geod; } int getIndex() { return index; }; int getHoldPointType() { return holdType; }; @@ -120,11 +113,11 @@ FGTaxiNode &operator =(const FGTaxiNode &other) FGTaxiSegmentVectorIterator getEndRoute() { return next.end(); }; bool operator<(const FGTaxiNode &other) const { return index < other.index; }; - void sortEndSegments(bool); + //void sortEndSegments(bool); }; -typedef vector FGTaxiNodeVector; +typedef std::vector FGTaxiNodeVector; typedef FGTaxiNodeVector::iterator FGTaxiNodeVectorIterator; #endif