3 #include <boost/foreach.hpp>
5 #include "groundnetwork.hxx"
7 #include <Navaids/NavDataCache.hxx>
8 #include <Main/globals.hxx>
9 #include <Scenery/scenery.hxx>
11 using namespace flightgear;
13 /**************************************************************************
15 *************************************************************************/
17 FGTaxiNode::FGTaxiNode(PositionedID aGuid, const SGGeod& pos, bool aOnRunway, int aHoldType) :
18 FGPositioned(aGuid, FGPositioned::PARKING, "", pos),
19 isOnRunway(aOnRunway),
25 FGTaxiNode::~FGTaxiNode()
29 void FGTaxiNode::setElevation(double val)
31 // ignored for the moment
34 double FGTaxiNode::getElevationFt()
36 if (mPosition.getElevationFt() == 0.0) {
37 SGGeod center2 = mPosition;
38 FGScenery* local_scenery = globals->get_scenery();
39 center2.setElevationM(SG_MAX_ELEVATION_M);
40 double elevationEnd = -100;
41 if (local_scenery->get_elevation_m( center2, elevationEnd, NULL )) {
43 SGGeod newPos = mPosition;
44 newPos.setElevationM(elevationEnd);
45 // this will call modifyPosition to update mPosition
46 NavDataCache::instance()->updatePosition(guid(), newPos);
50 return mPosition.getElevationFt();
53 double FGTaxiNode::getElevationM()
55 return getElevationFt() * SG_FEET_TO_METER;