4 XCSoar Glide Computer - http://www.xcsoar.org/
5 Copyright (C) 2000-2013 The XCSoar Project
6 A detailed list of copyright holders can be found in the file "AUTHORS".
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 #ifndef THERMAL_ASSISTENT_RENDERER_HPP
25 #define THERMAL_ASSISTENT_RENDERER_HPP
27 #include "Screen/BufferWindow.hpp"
28 #include "NMEA/CirclingInfo.hpp"
29 #include "NMEA/VarioInfo.hpp"
33 struct ThermalAssistantLook
;
37 class ThermalAssistantRenderer
39 class LiftPoints
: public std::array
<RasterPoint
,
40 std::tuple_size
<LiftDatabase
>::value
>
43 RasterPoint
GetAverage() const;
47 const ThermalAssistantLook
&look
;
52 * The minimum distance between the window boundary and the biggest
58 * The radius of the biggest circle in pixels.
65 CirclingInfo circling
;
69 ThermalAssistantRenderer(const ThermalAssistantLook
&look
,
70 unsigned _padding
, bool _small
= false);
73 const RasterPoint
&GetMiddle() const {
77 unsigned GetRadius() const{
81 void Update(const AttitudeState
&attitude
, const DerivedInfo
&_derived
);
83 void UpdateLayout(const PixelRect
&rc
);
84 void Paint(Canvas
&canvas
);
86 const ThermalAssistantLook
&GetLook() {
92 * Normalize the lift to the range of 0.0 to 1.0
93 * 0.0: lift = -max_lift
94 * 0.5: lift = zero lift
95 * 1.0: lift = max_lift
97 static fixed
NormalizeLift(fixed lift
, fixed max_lift
);
99 void CalculateLiftPoints(LiftPoints
&lift_points
, fixed max_lift
) const;
100 fixed
CalculateMaxLift() const;
101 void PaintRadarPlane(Canvas
&canvas
) const;
102 void PaintRadarBackground(Canvas
&canvas
, fixed max_lift
) const;
103 void PaintPoints(Canvas
&canvas
, const LiftPoints
&lift_points
) const;
104 void PaintAdvisor(Canvas
&canvas
, const LiftPoints
&lift_points
) const;
105 void PaintNotCircling(Canvas
&canvas
) const;