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 XCSOAR_RENDER_TASK_POINT_HPP
25 #define XCSOAR_RENDER_TASK_POINT_HPP
27 #include "Geo/GeoPoint.hpp"
28 #include "Geo/Flat/FlatBoundingBox.hpp"
29 #include "MapWindow/MapCanvas.hpp"
33 class WindowProjection
;
36 class OrderedTaskPoint
;
41 class TaskPointRenderer
44 enum TargetVisibility
{
52 const WindowProjection
&m_proj
;
54 const TaskLook
&task_look
;
55 const TaskProjection
&task_projection
;
57 const bool draw_bearing
;
58 TargetVisibility target_visibility
;
63 unsigned active_index
;
64 const GeoPoint location
;
65 FlatBoundingBox bb_screen
;
66 bool location_available
;
67 bool mode_optional_start
;
77 TaskPointRenderer(Canvas
&_canvas
,
78 const WindowProjection
&_projection
,
79 const TaskLook
&task_look
,
80 const TaskProjection
&_task_projection
,
83 TargetVisibility _target_visibility
,
84 bool location_available
, const GeoPoint
&_location
);
90 void SetActiveIndex(unsigned _active_index
) {
91 active_index
= _active_index
;
94 void SetBoundingBox(const FlatBoundingBox
&bb
) {
98 void SetModeOptional(const bool mode
) {
99 mode_optional_start
= mode
;
102 void Draw(const TaskPoint
&tp
, Layer layer
);
105 void DrawOrdered(const OrderedTaskPoint
&tp
, Layer layer
);
107 bool LegActive() const {
108 return index
>= active_index
;
111 bool PointPast() const {
112 return index
< active_index
;
115 bool PointCurrent() const {
116 return index
== active_index
;
120 bool IsTargetVisible(const TaskPoint
&tp
) const;
122 void DrawBearing(const TaskPoint
&tp
);
123 void DrawTarget(const TaskPoint
&tp
);
124 void DrawTaskLine(const GeoPoint
&start
, const GeoPoint
&end
);
125 void DrawIsoline(const AATPoint
&tp
);
126 void DrawOZBackground(Canvas
&canvas
, const OrderedTaskPoint
&tp
);
127 void DrawOZForeground(const OrderedTaskPoint
&tp
);