]> git.mxchange.org Git - flightgear.git/blob - src/GUI/AirportDiagram.hxx
In-app launcher for Mac, based on Qt5.
[flightgear.git] / src / GUI / AirportDiagram.hxx
1 #include <QWidget>
2 #include <QPainterPath>
3
4 #include <Airports/airports_fwd.hxx>
5 #include <simgear/math/sg_geodesy.hxx>
6
7 class AirportDiagram : public QWidget
8 {
9 public:
10     AirportDiagram(QWidget* pr);
11
12     void setAirport(FGAirportRef apt);
13
14     void addRunway(FGRunwayRef rwy);
15     void addParking(FGParking* park);
16 protected:
17     virtual void paintEvent(QPaintEvent* pe);
18     // wheel event for zoom
19
20     // mouse drag for pan
21
22
23 private:
24     void extendBounds(const QPointF& p);
25     QPointF project(const SGGeod& geod) const;
26
27     void buildTaxiways();
28     void buildPavements();
29
30     FGAirportRef m_airport;
31     SGGeod m_projectionCenter;
32     double m_scale;
33     QRectF m_bounds;
34
35     struct RunwayData {
36         QPointF p1, p2;
37         int widthM;
38         FGRunwayRef runway;
39     };
40     
41     QList<RunwayData> m_runways;
42
43     struct TaxiwayData {
44         QPointF p1, p2;
45         int widthM;
46
47         bool operator<(const TaxiwayData& other) const
48         {
49             return widthM < other.widthM;
50         }
51     };
52
53     QList<TaxiwayData> m_taxiways;
54     QList<QPainterPath> m_pavements;
55 };