2017-03-25 10:28:05 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
2007-07-15 14:08:31 +00:00
|
|
|
#include "gnnode.hxx"
|
|
|
|
|
2012-09-25 00:31:17 +01:00
|
|
|
#include <boost/foreach.hpp>
|
|
|
|
|
|
|
|
#include "groundnetwork.hxx"
|
2011-10-09 00:25:04 +02:00
|
|
|
|
2012-10-01 17:18:36 +01:00
|
|
|
#include <Navaids/NavDataCache.hxx>
|
2011-10-09 00:25:04 +02:00
|
|
|
#include <Main/globals.hxx>
|
|
|
|
#include <Scenery/scenery.hxx>
|
|
|
|
|
2012-10-01 17:18:36 +01:00
|
|
|
using namespace flightgear;
|
|
|
|
|
2007-07-15 14:08:31 +00:00
|
|
|
/**************************************************************************
|
|
|
|
* FGTaxiNode
|
|
|
|
*************************************************************************/
|
|
|
|
|
2015-12-01 00:01:27 +00:00
|
|
|
FGTaxiNode::FGTaxiNode(int index, const SGGeod& pos, bool aOnRunway, int aHoldType) :
|
|
|
|
FGPositioned(TRANSIENT_ID, FGPositioned::PARKING, "", pos),
|
|
|
|
m_index(index),
|
2012-09-25 00:31:17 +01:00
|
|
|
isOnRunway(aOnRunway),
|
2015-12-01 00:01:27 +00:00
|
|
|
holdType(aHoldType),
|
|
|
|
m_isPushback(false)
|
2009-06-09 19:39:18 +00:00
|
|
|
{
|
2012-09-25 00:31:17 +01:00
|
|
|
|
2009-06-09 19:39:18 +00:00
|
|
|
}
|
|
|
|
|
2012-09-25 00:31:17 +01:00
|
|
|
FGTaxiNode::~FGTaxiNode()
|
2009-06-09 19:39:18 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-09-25 00:31:17 +01:00
|
|
|
void FGTaxiNode::setElevation(double val)
|
2009-06-09 19:39:18 +00:00
|
|
|
{
|
2012-09-25 00:31:17 +01:00
|
|
|
// ignored for the moment
|
2009-06-09 19:39:18 +00:00
|
|
|
}
|
|
|
|
|
2012-10-01 17:18:36 +01:00
|
|
|
double FGTaxiNode::getElevationFt()
|
2011-10-09 00:25:04 +02:00
|
|
|
{
|
2014-03-01 20:18:02 +01:00
|
|
|
const SGGeod& pos = geod();
|
|
|
|
if( pos.getElevationFt() == 0.0)
|
|
|
|
{
|
|
|
|
SGGeod center2 = pos;
|
2012-10-01 17:18:36 +01:00
|
|
|
FGScenery* local_scenery = globals->get_scenery();
|
|
|
|
center2.setElevationM(SG_MAX_ELEVATION_M);
|
|
|
|
double elevationEnd = -100;
|
2014-03-01 20:18:02 +01:00
|
|
|
if (local_scenery->get_elevation_m( center2, elevationEnd, NULL ))
|
|
|
|
{
|
|
|
|
SGGeod newPos = pos;
|
2012-11-10 14:48:00 +00:00
|
|
|
newPos.setElevationM(elevationEnd);
|
2014-03-01 20:18:02 +01:00
|
|
|
// this will call modifyPosition to update mPosition
|
2015-12-01 00:01:27 +00:00
|
|
|
modifyPosition(newPos);
|
2011-10-09 00:25:04 +02:00
|
|
|
}
|
2012-10-01 17:18:36 +01:00
|
|
|
}
|
|
|
|
|
2014-03-01 20:18:02 +01:00
|
|
|
return pos.getElevationFt();
|
2011-10-09 00:25:04 +02:00
|
|
|
}
|
2011-09-03 11:26:17 +02:00
|
|
|
|
2015-12-01 00:01:27 +00:00
|
|
|
int FGTaxiNode::getIndex() const
|
|
|
|
{
|
|
|
|
return m_index;
|
|
|
|
}
|
|
|
|
|
|
|
|
void FGTaxiNode::setIsPushback()
|
|
|
|
{
|
|
|
|
m_isPushback = true;
|
|
|
|
}
|
|
|
|
|
2012-10-01 17:18:36 +01:00
|
|
|
double FGTaxiNode::getElevationM()
|
2011-10-09 00:25:04 +02:00
|
|
|
{
|
2012-10-01 17:18:36 +01:00
|
|
|
return getElevationFt() * SG_FEET_TO_METER;
|
2011-10-09 00:25:04 +02:00
|
|
|
}
|