]> git.mxchange.org Git - flightgear.git/blob - src/Airports/gnnode.cxx
Fix a typo.
[flightgear.git] / src / Airports / gnnode.cxx
1 #include "gnnode.hxx"
2
3 #include <boost/foreach.hpp>
4
5 #include "groundnetwork.hxx"
6
7 #include <Navaids/NavDataCache.hxx>
8 #include <Main/globals.hxx>
9 #include <Scenery/scenery.hxx>
10
11 using namespace flightgear;
12
13 /**************************************************************************
14  * FGTaxiNode
15  *************************************************************************/
16
17 FGTaxiNode::FGTaxiNode(PositionedID aGuid, const SGGeod& pos, bool aOnRunway, int aHoldType) :
18   FGPositioned(aGuid, FGPositioned::PARKING, "", pos),
19   isOnRunway(aOnRunway),
20   holdType(aHoldType)
21 {
22   
23 }
24
25 FGTaxiNode::~FGTaxiNode()
26 {
27 }
28
29 void FGTaxiNode::setElevation(double val)
30 {
31   // ignored for the moment
32 }
33
34 double FGTaxiNode::getElevationFt()
35 {
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 )) {
42       
43       SGGeod newPos = mPosition;
44       newPos.setElevationM(elevationEnd);
45     // this will call modifyPosition to update mPosition
46       NavDataCache::instance()->updatePosition(guid(), newPos);
47     }
48   }
49   
50   return mPosition.getElevationFt();
51 }
52
53 double FGTaxiNode::getElevationM()
54 {
55   return getElevationFt() * SG_FEET_TO_METER;
56 }