android/GlueIOIOPort: fix spurious errors after IOIO baud rate change
[xcsoar.git] / src / Renderer / TaskPointRenderer.hpp
blobc566ccbc8d8a461a5ded904a40e5ae046893ece6
1 /*
2 Copyright_License {
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"
30 #include "Compiler.h"
32 class Canvas;
33 class WindowProjection;
34 class OZRenderer;
35 class TaskPoint;
36 class OrderedTaskPoint;
37 class AATPoint;
38 class TaskProjection;
39 struct TaskLook;
41 class TaskPointRenderer
43 public:
44 enum TargetVisibility {
45 ALL,
46 ACTIVE,
47 NONE,
50 protected:
51 Canvas &canvas;
52 const WindowProjection &m_proj;
53 MapCanvas map_canvas;
54 const TaskLook &task_look;
55 const TaskProjection &task_projection;
57 const bool draw_bearing;
58 TargetVisibility target_visibility;
60 GeoPoint last_point;
61 unsigned index;
62 OZRenderer &ozv;
63 unsigned active_index;
64 const GeoPoint location;
65 FlatBoundingBox bb_screen;
66 bool location_available;
67 bool mode_optional_start;
69 public:
70 enum Layer {
71 LAYER_OZ_SHADE,
72 LAYER_LEG,
73 LAYER_OZ_OUTLINE,
74 LAYER_SYMBOLS,
77 TaskPointRenderer(Canvas &_canvas,
78 const WindowProjection &_projection,
79 const TaskLook &task_look,
80 const TaskProjection &_task_projection,
81 OZRenderer &_ozv,
82 bool _draw_bearing,
83 TargetVisibility _target_visibility,
84 bool location_available, const GeoPoint &_location);
86 void ResetIndex() {
87 index = 0;
90 void SetActiveIndex(unsigned _active_index) {
91 active_index = _active_index;
94 void SetBoundingBox(const FlatBoundingBox &bb) {
95 bb_screen = bb;
98 void SetModeOptional(const bool mode) {
99 mode_optional_start = mode;
102 void Draw(const TaskPoint &tp, Layer layer);
104 protected:
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;
119 gcc_pure
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);
130 #endif