]> git.mxchange.org Git - flightgear.git/blob - src/Airports/gnnode.cxx
Alexis Bory:
[flightgear.git] / src / Airports / gnnode.cxx
1 #include "gnnode.hxx"
2
3 #include <boost/foreach.hpp>
4
5 #include "groundnetwork.hxx"
6
7 #include <Main/globals.hxx>
8 #include <Scenery/scenery.hxx>
9
10 /**************************************************************************
11  * FGTaxiNode
12  *************************************************************************/
13
14 FGTaxiNode::FGTaxiNode(PositionedID aGuid, int index, const SGGeod& pos, bool aOnRunway, int aHoldType) :
15   FGPositioned(aGuid, FGPositioned::PARKING, "", pos),
16   index(index),
17   isOnRunway(aOnRunway),
18   holdType(aHoldType)
19 {
20   
21 }
22
23 FGTaxiNode::~FGTaxiNode()
24 {
25 }
26
27 void FGTaxiNode::setElevation(double val)
28 {
29   // ignored for the moment
30 }
31
32 double FGTaxiNode::getElevationFt(double refelev)
33 {
34 #if 0
35     double elevF = elevation();
36     double elevationEnd = 0;
37     if ((elevF == 0) || (elevF == refelev)) {
38         SGGeod center2 = mPosition;
39         FGScenery * local_scenery = globals->get_scenery();
40         center2.setElevationM(SG_MAX_ELEVATION_M);
41         if (local_scenery->get_elevation_m( center2, elevationEnd, NULL )) {
42             geod.setElevationM(elevationEnd);
43         }
44     }
45 #endif
46   return mPosition.getElevationFt();
47 }
48
49 double FGTaxiNode::getElevationM(double refelev)
50 {
51     return geod().getElevationM();
52 }
53
54 FGTaxiSegment* FGTaxiNode::getArcTo(FGTaxiNode* aEnd) const
55 {
56   BOOST_FOREACH(FGTaxiSegment* arc, next) {
57     if (arc->getEnd() == aEnd) {
58       return arc;
59     }
60   }
61   
62   return NULL;
63 }