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.
22 #include <QPainterPath>
24 #include <Airports/airports_fwd.hxx>
25 #include <simgear/math/sg_geodesy.hxx>
27 class AirportDiagram : public QWidget
31 AirportDiagram(QWidget* pr);
33 void setAirport(FGAirportRef apt);
35 void addRunway(FGRunwayRef rwy);
36 void addParking(FGParking* park);
38 FGRunwayRef selectedRunway() const;
39 void setSelectedRunway(FGRunwayRef r);
41 void clickedRunway(FGRunwayRef rwy);
44 virtual void paintEvent(QPaintEvent* pe);
45 // wheel event for zoom
49 virtual void mouseReleaseEvent(QMouseEvent* me);
53 void extendBounds(const QPointF& p);
54 QPointF project(const SGGeod& geod) const;
55 QTransform transform() const;
58 void buildPavements();
60 FGAirportRef m_airport;
61 SGGeod m_projectionCenter;
71 QList<RunwayData> m_runways;
77 bool operator<(const TaxiwayData& other) const
79 return widthM < other.widthM;
83 QList<TaxiwayData> m_taxiways;
84 QList<QPainterPath> m_pavements;
86 FGRunwayRef m_selectedRunway;