FlightGear next
CarrierDiagram.hxx
Go to the documentation of this file.
1// CarrierDiagram.hxx - part of GUI launcher using Qt5
2//
3// Written by Stuart Buchanan, started April 2020.
4//
5// Copyright (C) 2022 Stuart Buchanan <stuart13@gmail.com>
6//
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.
11//
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.
16//
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.
20
21#ifndef GUI_CARRIER_DIAGRAM_HXX
22#define GUI_CARRIER_DIAGRAM_HXX
23
24#include "BaseDiagram.hxx"
25#include "QmlPositioned.hxx"
26#include "UnitsModel.hxx"
27
28#include <Navaids/navrecord.hxx>
29#include <simgear/math/sg_geodesy.hxx>
30
32{
33 Q_OBJECT
34
35 Q_PROPERTY(QmlGeod geod READ geod WRITE setGeod NOTIFY locationChanged)
37 Q_PROPERTY(bool abeam READ isAbeam WRITE setAbeam NOTIFY offsetChanged)
39public:
40 CarrierDiagram(QQuickItem* pr = nullptr);
41
42 //void setCarrier(qlonglong nav);
43 //qlonglong navaid() const;
44
45 void setGeod(QmlGeod geod);
46 QmlGeod geod() const;
47
48 void setGeod(const SGGeod& geod);
49
50 bool isOffsetEnabled() const
51 { return m_offsetEnabled; }
52
53 bool isAbeam() const
54 { return m_abeam; }
55
56 void setOffsetEnabled(bool offset);
57 void setAbeam(bool abeam);
58
59 void setOffsetDistance(QuantityValue distance);
61 { return m_offsetDistance; }
62
63signals:
66
67protected:
68 void paintContents(QPainter *) override;
69
70 void doComputeBounds() override;
71private:
72 FGPositionedRef m_Carrier;
73 SGGeod m_geod;
74
75 bool m_offsetEnabled = false;
76 bool m_abeam = false;
77 QuantityValue m_offsetDistance;
78};
79
80#endif // of GUI_CARRIER_DIAGRAM_HXX
SGSharedPtr< FGPositioned > FGPositionedRef
Definition airways.hxx:30
BaseDiagram(QQuickItem *pr=nullptr)
QuantityValue offsetDistance
void doComputeBounds() override
void setOffsetEnabled(bool offset)
void setOffsetDistance(QuantityValue distance)
CarrierDiagram(QQuickItem *pr=nullptr)
void locationChanged()
void offsetChanged()
bool isAbeam() const
void setGeod(QmlGeod geod)
QuantityValue offsetDistance() const
bool isOffsetEnabled() const
void setAbeam(bool abeam)
void paintContents(QPainter *) override
Expose an SGGeod as Qml-friendly class.