3 XCSoar Glide Computer - http://www.xcsoar.org/
4 Copyright (C) 2000-2013 The XCSoar Project
5 A detailed list of copyright holders can be found in the file "AUTHORS".
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either version 2
10 of the License, or (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 #ifndef MAPTASKMANAGER_H
24 #define MAPTASKMANAGER_H
30 * Appends wp to current Ordered task and activates the ordered task if
31 * the current ordered task is valid.
32 * If the current ordered task is invalid or empty, then
33 * either creates a Goto task with the selected waypoint, or if in Goto mode
34 * already, it creates an ordered task from the previous Goto point and the
37 namespace MapTaskManager
48 TaskEditResult
AppendToTask(const Waypoint
&wp
);
49 TaskEditResult
InsertInTask(const Waypoint
&wp
);
52 * inserts the waypoint into the Ordered Task
53 * It is up to the caller to decide whether to commit the new task or not.
54 * Task manager must be in Ordered Mode when called
55 * @param task. Pointer to an ordered Mat task
56 * @param waypoint. The wp to insert into the task before the active tp
58 TaskEditResult
InsertInMatProForma(OrderedTask
&task
,
59 const Waypoint
&waypoint
);
60 TaskEditResult
ReplaceInTask(const Waypoint
&wp
);
61 TaskEditResult
RemoveFromTask(const Waypoint
&wp
);
65 * @return TurnPointIndex if MODE_ORDERED and wp is in task
68 int GetIndexInTask(const Waypoint
&wp
);
71 * is this wp an unachieved task point?
72 * @param waypoint. the wp being tested
73 * @return. -1 or last index in ordered task where the wp is an
74 * unachieved intermediate point. -1 if mode != MODE_ORDDERED
76 int GetUnachievedIndexInTask(const Waypoint
&waypoint
);