+
+ if (drawAircraft) {
+ p->setTransform(t);
+ paintAirplaneIcon(p, aircraftPos, headingDeg);
+ }
+}
+
+
+void AirportDiagram::drawParkings(QPainter* painter)
+{
+ QTransform t = painter->transform();
+
+
+ QFont f = painter->font();
+ f.setPixelSize(16);
+ painter->setFont(f);
+
+ Q_FOREACH(const ParkingData& p, m_parking) {
+ painter->setTransform(t);
+ painter->translate(p.pt);
+
+ double hdg = p.parking->getHeading();
+ bool useLeftIcon = false;
+ QRect labelRect(-62, -14, 40, 28);
+
+ if (hdg > 180.0) {
+ hdg += 90;
+ useLeftIcon = true;
+ labelRect = QRect(22, -14, 40, 28);
+ } else {
+ hdg -= 90;
+ }
+
+ painter->rotate(hdg);
+
+ painter->setBrush(QColor(255, 196, 196)); // kind of pink
+ painter->drawPath(useLeftIcon ? m_parkingIconLeftPath : m_parkingIconPath);
+
+ painter->fillRect(labelRect, Qt::white);
+
+ // draw text
+ painter->setPen(Qt::black);
+ painter->drawText(labelRect,
+ Qt::AlignVCenter | Qt::AlignHCenter,
+ QString::fromStdString(p.parking->name()));
+ }
+
+ painter->setTransform(t);
+}
+
+void AirportDiagram::drawILS(QPainter* painter, FGRunwayRef runway) const
+{
+ if (!runway)
+ return;
+
+ FGNavRecord* loc = runway->ILS();
+ if (!loc)
+ return;
+
+ double halfBeamWidth = loc->localizerWidth() * 0.5;
+ QPointF threshold = project(runway->threshold());
+ double rangeM = loc->get_range() * SG_NM_TO_METER;
+ double radial = loc->get_multiuse();
+ SG_NORMALIZE_RANGE(radial, 0.0, 360.0);
+
+// compute the three end points at the wide end of the arrow
+ QPointF endCentre = project(SGGeodesy::direct(loc->geod(), radial, -rangeM));
+ QPointF endR = project(SGGeodesy::direct(loc->geod(), radial + halfBeamWidth, -rangeM * 1.1));
+ QPointF endL = project(SGGeodesy::direct(loc->geod(), radial - halfBeamWidth, -rangeM * 1.1));
+
+ painter->drawLine(threshold, endCentre);
+ painter->drawLine(threshold, endL);
+ painter->drawLine(threshold, endR);
+ painter->drawLine(endL, endCentre);
+ painter->drawLine(endR, endCentre);