]> git.mxchange.org Git - flightgear.git/blob - src/Airports/gnnode.cxx
Interim windows build fix
[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(int index, const SGGeod& pos, bool aOnRunway, int aHoldType) :
18   FGPositioned(TRANSIENT_ID, FGPositioned::PARKING, "", pos),
19   m_index(index),
20   isOnRunway(aOnRunway),
21   holdType(aHoldType),
22   m_isPushback(false)
23 {
24   
25 }
26
27 FGTaxiNode::~FGTaxiNode()
28 {
29 }
30
31 void FGTaxiNode::setElevation(double val)
32 {
33   // ignored for the moment
34 }
35
36 double FGTaxiNode::getElevationFt()
37 {
38   const SGGeod& pos = geod();
39   if( pos.getElevationFt() == 0.0)
40   {
41     SGGeod center2 = pos;
42     FGScenery* local_scenery = globals->get_scenery();
43     center2.setElevationM(SG_MAX_ELEVATION_M);
44     double elevationEnd = -100;
45     if (local_scenery->get_elevation_m( center2, elevationEnd, NULL ))
46     {
47       SGGeod newPos = pos;
48       newPos.setElevationM(elevationEnd);
49       // this will call modifyPosition to update mPosition
50       modifyPosition(newPos);
51     }
52   }
53   
54   return pos.getElevationFt();
55 }
56
57 int FGTaxiNode::getIndex() const
58 {
59     return m_index;
60 }
61
62 void FGTaxiNode::setIsPushback()
63 {
64     m_isPushback = true;
65 }
66
67 double FGTaxiNode::getElevationM()
68 {
69   return getElevationFt() * SG_FEET_TO_METER;
70 }