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 const SGGeod& pos = geod();
37 if( pos.getElevationFt() == 0.0)
40 FGScenery* local_scenery = globals->get_scenery();
41 center2.setElevationM(SG_MAX_ELEVATION_M);
42 double elevationEnd = -100;
43 if (local_scenery->get_elevation_m( center2, elevationEnd, NULL ))
46 newPos.setElevationM(elevationEnd);
47 // this will call modifyPosition to update mPosition
48 NavDataCache* cache = NavDataCache::instance();
49 NavDataCache::Transaction txn(cache);
50 cache->updatePosition(guid(), newPos);
55 return pos.getElevationFt();
58 double FGTaxiNode::getElevationM()
60 return getElevationFt() * SG_FEET_TO_METER;