1 // AirportDiagram.hxx - part of GUI launcher using Qt5
3 // Written by James Turner, started December 2014.
5 // Copyright (C) 2014 James Turner <zakalawe@mac.com>
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #ifndef GUI_AIRPORT_DIAGRAM_HXX
22 #define GUI_AIRPORT_DIAGRAM_HXX
24 #include "BaseDiagram.hxx"
26 #include <Airports/parking.hxx>
27 #include <Airports/runways.hxx>
28 #include <simgear/math/sg_geodesy.hxx>
30 class AirportDiagram : public BaseDiagram
34 AirportDiagram(QWidget* pr);
35 virtual ~AirportDiagram();
37 void setAirport(FGAirportRef apt);
39 void addRunway(FGRunwayRef rwy);
40 void addParking(FGParkingRef park);
41 void addHelipad(FGHelipadRef pad);
43 FGRunwayRef selectedRunway() const;
44 void setSelectedRunway(FGRunwayRef r);
46 void setSelectedHelipad(FGHelipadRef pad);
48 void setApproachExtensionDistance(double distanceNm);
50 void clickedRunway(FGRunwayRef rwy);
51 void clickedHelipad(FGHelipadRef pad);
52 void clickedParking(FGParkingRef park);
55 virtual void mouseReleaseEvent(QMouseEvent* me);
57 void paintContents(QPainter*) Q_DECL_OVERRIDE;
59 void doComputeBounds() Q_DECL_OVERRIDE;
63 void buildPavements();
65 void drawILS(QPainter *painter, FGRunwayRef runway) const;
66 void drawParkings(QPainter *p);
67 void drawHelipads(QPainter *painter);
69 FGAirportRef m_airport;
77 QVector<RunwayData> m_runways;
83 bool operator<(const TaxiwayData& other) const
85 return widthM < other.widthM;
89 QVector<TaxiwayData> m_taxiways;
90 QVector<QPainterPath> m_pavements;
98 QVector<ParkingData> m_parking;
103 FGHelipadRef helipad;
106 QVector<HelipadData> m_helipads;
108 QPainterPath m_parkingIconPath, // arrow points right
109 m_parkingIconLeftPath; // arrow points left
110 double m_approachDistanceNm;
111 FGRunwayRef m_selectedRunway;
114 #endif // of GUI_AIRPORT_DIAGRAM_HXX