From: James Turner Date: Sun, 15 Nov 2015 15:55:07 +0000 (+0000) Subject: Draw aircraft on airport diagram X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e63a95feb93436750e55c057d55fb374935cc6aa;p=flightgear.git Draw aircraft on airport diagram --- diff --git a/src/GUI/AirportDiagram.cxx b/src/GUI/AirportDiagram.cxx index 2fd2ce7e9..dea718e54 100644 --- a/src/GUI/AirportDiagram.cxx +++ b/src/GUI/AirportDiagram.cxx @@ -217,6 +217,10 @@ void AirportDiagram::paintContents(QPainter* p) drawILS(p, r.runway->reciprocalRunway()); } + bool drawAircraft = false; + SGGeod aircraftPos; + int headingDeg; + // now draw the runways for real Q_FOREACH(const RunwayData& r, m_runways) { @@ -256,6 +260,12 @@ void AirportDiagram::paintContents(QPainter* p) p->drawText(QRect(-100, 5, 200, 200), recipIdent, Qt::AlignHCenter | Qt::AlignTop); } + if (m_selectedRunway) { + drawAircraft = true; + aircraftPos = m_selectedRunway->geod(); + headingDeg = m_selectedRunway->headingDeg(); + } + if (m_selectedRunway && (m_approachDistanceNm > 0.0)) { p->setTransform(t); // draw approach extension point @@ -266,11 +276,14 @@ void AirportDiagram::paintContents(QPainter* p) pen.setWidth(2.0 / m_scale); p->setPen(pen); p->drawLine(pt, pt2); - } + aircraftPos = m_selectedRunway->pointOnCenterline(-d); + } - // aircraft pos and heading... - // paintAirplaneIcon(painter, ); + if (drawAircraft) { + p->setTransform(t); + paintAirplaneIcon(p, aircraftPos, headingDeg); + } } void AirportDiagram::drawILS(QPainter* painter, FGRunwayRef runway) const