QFlightInstruments
QFlightInstruments is a Qt library containing flight instruments widgets.
qfi_TC.h
1 /****************************************************************************//*
2  * Copyright (C) 2021 Marek M. Cel
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining
5  * a copy of this software and associated documentation files (the "Software"),
6  * to deal in the Software without restriction, including without limitation
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  * and/or sell copies of the Software, and to permit persons to whom
9  * the Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included
12  * in all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20  * IN THE SOFTWARE.
21  ******************************************************************************/
22 #ifndef QFI_TC_H
23 #define QFI_TC_H
24 
26 
27 #include <QGraphicsView>
28 #include <QGraphicsSvgItem>
29 
31 
35 class qfi_TC : public QGraphicsView
36 {
37  Q_OBJECT
38 
39 public:
40 
42  qfi_TC( QWidget *parent = Q_NULLPTR );
43 
45  virtual ~qfi_TC();
46 
48  void reinit();
49 
51  void redraw();
52 
54  void setTurnRate( double turnRate );
55 
57  void setSlipSkid( double slipSkid );
58 
59 protected:
60 
62  void resizeEvent( QResizeEvent *event );
63 
64 private:
65 
66  QGraphicsScene *_scene;
67 
68  QGraphicsSvgItem *_itemBack;
69  QGraphicsSvgItem *_itemBall;
70  QGraphicsSvgItem *_itemFace_1;
71  QGraphicsSvgItem *_itemFace_2;
72  QGraphicsSvgItem *_itemMark;
73  QGraphicsSvgItem *_itemCase;
74 
75  double _turnRate;
76  double _slipSkid;
77 
78  double _scaleX;
79  double _scaleY;
80 
81  const int _originalHeight;
82  const int _originalWidth;
83 
84  QPointF _originalMarkCtr;
85  QPointF _originalBallCtr;
86 
87  const int _backZ;
88  const int _ballZ;
89  const int _face1Z;
90  const int _face2Z;
91  const int _markZ;
92  const int _caseZ;
93 
94  void init();
95 
96  void reset();
97 
98  void updateView();
99 };
100 
102 
103 #endif // QFI_TC_H
qfi_TC::setSlipSkid
void setSlipSkid(double slipSkid)
Definition: qfi_TC.cpp:122
qfi_TC::qfi_TC
qfi_TC(QWidget *parent=Q_NULLPTR)
Definition: qfi_TC.cpp:33
qfi_TC::redraw
void redraw()
Definition: qfi_TC.cpp:102
qfi_TC::setTurnRate
void setTurnRate(double turnRate)
Definition: qfi_TC.cpp:112
qfi_TC::~qfi_TC
virtual ~qfi_TC()
Definition: qfi_TC.cpp:76
qfi_TC
Turn Coordinator widget class.
Definition: qfi_TC.h:35
qfi_TC::reinit
void reinit()
Definition: qfi_TC.cpp:90