X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAirports%2Fgnnode.hxx;h=2ade6673d57bc43ff22a184b4131ed022b308098;hb=afcdbd3158503773644aa07dd86cd92d67946bd4;hp=c64b51fd0fb51248a2d92d97229f3cbaa095b1b5;hpb=b1854459b3100e4c51e3a5704caa4e2c3869228c;p=flightgear.git diff --git a/src/Airports/gnnode.hxx b/src/Airports/gnnode.hxx index c64b51fd0..2ade6673d 100644 --- a/src/Airports/gnnode.hxx +++ b/src/Airports/gnnode.hxx @@ -16,109 +16,33 @@ #ifndef _GN_NODE_HXX_ #define _GN_NODE_HXX_ -#include -#include - #include -#include - -class FGTaxiSegment; -typedef std::vector FGTaxiSegmentVector; -typedef FGTaxiSegmentVector::iterator FGTaxiSegmentVectorIterator; +#include -bool sortByHeadingDiff(FGTaxiSegment *a, FGTaxiSegment *b); -bool sortByLength (FGTaxiSegment *a, FGTaxiSegment *b); +#include -class FGTaxiNode +class FGTaxiNode : public FGPositioned { protected: - 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() : - 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); +public: + FGTaxiNode(PositionedID aGuid, const SGGeod& pos, bool aOnRunway, int aHoldType); + virtual ~FGTaxiNode(); + 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; }; - - 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();}; - double getElevationM (double refelev=0); - double getElevationFt(double refelev=0); - - const SGGeod& getGeod() const { return geod; } - - int getIndex() const { return index; }; + double getElevationM (); + double getElevationFt(); + + PositionedID getIndex() const { return guid(); }; int getHoldPointType() const { return holdType; }; bool getIsOnRunway() const { return isOnRunway; }; - - FGTaxiNode *getAddress() { return this;}; - FGTaxiSegmentVectorIterator getBeginRoute() { return next.begin(); }; - FGTaxiSegmentVectorIterator getEndRoute() { return next.end(); }; - bool operator<(const FGTaxiNode &other) const { return index < other.index; }; - - }; -typedef std::vector FGTaxiNodeVector; +typedef SGSharedPtr FGTaxiNode_ptr; +typedef std::vector FGTaxiNodeVector; typedef FGTaxiNodeVector::iterator FGTaxiNodeVectorIterator; #endif