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
|
|
|
|
|
|
|
#include <Main/globals.hxx>
|
|
|
|
#include <Scenery/scenery.hxx>
|
|
|
|
|
2007-07-15 14:08:31 +00:00
|
|
|
/**************************************************************************
|
|
|
|
* FGTaxiNode
|
|
|
|
*************************************************************************/
|
|
|
|
|
2012-09-25 00:31:17 +01:00
|
|
|
FGTaxiNode::FGTaxiNode(PositionedID aGuid, int index, const SGGeod& pos, bool aOnRunway, int aHoldType) :
|
|
|
|
FGPositioned(aGuid, FGPositioned::PARKING, "", pos),
|
|
|
|
index(index),
|
|
|
|
isOnRunway(aOnRunway),
|
|
|
|
holdType(aHoldType)
|
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
|
|
|
}
|
|
|
|
|
2011-10-09 00:25:04 +02:00
|
|
|
double FGTaxiNode::getElevationFt(double refelev)
|
|
|
|
{
|
2012-09-25 00:31:17 +01:00
|
|
|
#if 0
|
2012-09-25 22:09:26 +02:00
|
|
|
double elevF = elevation();
|
2011-10-09 00:25:04 +02:00
|
|
|
double elevationEnd = 0;
|
|
|
|
if ((elevF == 0) || (elevF == refelev)) {
|
2012-09-25 00:31:17 +01:00
|
|
|
SGGeod center2 = mPosition;
|
2011-10-09 00:25:04 +02:00
|
|
|
FGScenery * local_scenery = globals->get_scenery();
|
|
|
|
center2.setElevationM(SG_MAX_ELEVATION_M);
|
|
|
|
if (local_scenery->get_elevation_m( center2, elevationEnd, NULL )) {
|
|
|
|
geod.setElevationM(elevationEnd);
|
|
|
|
}
|
|
|
|
}
|
2012-09-25 00:31:17 +01:00
|
|
|
#endif
|
|
|
|
return mPosition.getElevationFt();
|
2011-10-09 00:25:04 +02:00
|
|
|
}
|
2011-09-03 11:26:17 +02:00
|
|
|
|
2011-10-09 00:25:04 +02:00
|
|
|
double FGTaxiNode::getElevationM(double refelev)
|
|
|
|
{
|
2012-09-25 00:31:17 +01:00
|
|
|
return geod().getElevationM();
|
|
|
|
}
|
|
|
|
|
|
|
|
FGTaxiSegment* FGTaxiNode::getArcTo(FGTaxiNode* aEnd) const
|
|
|
|
{
|
|
|
|
BOOST_FOREACH(FGTaxiSegment* arc, next) {
|
|
|
|
if (arc->getEnd() == aEnd) {
|
|
|
|
return arc;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
2011-10-09 00:25:04 +02:00
|
|
|
}
|