#include <vector>
#include <string>
-#include <simgear/compiler.h>
-SG_USING_STD(string);
-SG_USING_STD(vector);
+#include <simgear/compiler.h>
+#include <simgear/math/sg_geodesy.hxx>
class FGTaxiSegment;
-typedef vector<FGTaxiSegment*> FGTaxiSegmentVector;
+typedef std::vector<FGTaxiSegment*> 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;
FGTaxiNode* previousNode;
FGTaxiSegment* previousSeg;
+
public:
FGTaxiNode() :
- lat (0.0),
- lon (0.0),
index(0),
isOnRunway(false),
holdType(0),
};
FGTaxiNode(const FGTaxiNode &other) :
- lat(other.lat),
- lon(other.lon),
+ geod(other.geod),
index(other.index),
isOnRunway(other.isOnRunway),
holdType(other.holdType),
FGTaxiNode &operator =(const FGTaxiNode &other)
{
- lat = other.lat;
- lon = other.lon;
- index = other.index;
- isOnRunway = other.isOnRunway;
- holdType = other.holdType;
- next = other.next;
- pathScore = other.pathScore;
- previousNode = other.previousNode;
- previousSeg = other.previousSeg;
+ 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) { 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; };
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();};
+
+ const SGGeod& getGeod() const { return geod; }
int getIndex() { return index; };
int getHoldPointType() { return holdType; };
FGTaxiSegmentVectorIterator getEndRoute() { return next.end(); };
bool operator<(const FGTaxiNode &other) const { return index < other.index; };
- void sortEndSegments(bool);
};
-typedef vector<FGTaxiNode*> FGTaxiNodeVector;
+typedef std::vector<FGTaxiNode*> FGTaxiNodeVector;
typedef FGTaxiNodeVector::iterator FGTaxiNodeVectorIterator;
#endif