Driver/Volkslogger: eliminate class VLA_SYS
[xcsoar.git] / src / Renderer / OZRenderer.hpp
blob7db37b9e0a2195221c63a8045ef179a7142a7a8b
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_OBSERVATION_ZONE_HPP
25 #define XCSOAR_RENDER_OBSERVATION_ZONE_HPP
27 struct TaskLook;
28 struct AirspaceLook;
29 class Canvas;
30 class Projection;
31 struct AirspaceRendererSettings;
32 class ObservationZonePoint;
34 /** Utility class to render an ObzervationZonePoint to a canvas */
35 class OZRenderer {
36 public:
37 enum Layer {
38 /** the background shade */
39 LAYER_SHADE,
41 /** the inactive boundaries */
42 LAYER_INACTIVE,
44 /** the active boundaries */
45 LAYER_ACTIVE,
48 protected:
49 const TaskLook &task_look;
50 const AirspaceLook &airspace_look;
51 const AirspaceRendererSettings &settings;
53 public:
54 OZRenderer(const TaskLook &task_look, const AirspaceLook &airspace_look,
55 const AirspaceRendererSettings &_settings);
57 void Draw(Canvas &canvas, Layer _layer, const Projection &projection,
58 const ObservationZonePoint &oz, int offset);
60 private:
61 /**
62 * Configure brush and pen on the Canvas for the current layer.
64 * @param offset the offset of this task point to the current task
65 * point; 0 means it is the current task point, a negative value
66 * means it is a "past" task point
67 * @return false if nothing is to be drawn in this layer
69 void Prepare(Canvas &canvas, Layer layer, int offset) const;
71 /**
72 * Cleans up the settings after drawing has been finished. This
73 * method must be invoked if draw_style() has returned true.
75 void Finish(Canvas &canvas, Layer layer) const;
78 #endif