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);
42 FGRunwayRef selectedRunway() const;
43 void setSelectedRunway(FGRunwayRef r);
45 void setApproachExtensionDistance(double distanceNm);
47 void clickedRunway(FGRunwayRef rwy);
49 void clickedParking(FGParkingRef park);
52 virtual void mouseReleaseEvent(QMouseEvent* me);
54 void paintContents(QPainter*) Q_DECL_OVERRIDE;
56 void doComputeBounds() Q_DECL_OVERRIDE;
60 void buildPavements();
62 FGAirportRef m_airport;
70 QVector<RunwayData> m_runways;
76 bool operator<(const TaxiwayData& other) const
78 return widthM < other.widthM;
82 QVector<TaxiwayData> m_taxiways;
83 QVector<QPainterPath> m_pavements;
91 QVector<ParkingData> m_parking;
93 double m_approachDistanceNm;
94 FGRunwayRef m_selectedRunway;
96 void drawILS(QPainter *painter, FGRunwayRef runway) const;
99 #endif // of GUI_AIRPORT_DIAGRAM_HXX