本文整理汇总了C++中Waypoints::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ Waypoints::Clear方法的具体用法?C++ Waypoints::Clear怎么用?C++ Waypoints::Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Waypoints
的用法示例。
在下文中一共展示了Waypoints::Clear方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: glide_polar
static bool
test_null()
{
GlidePolar glide_polar(fixed(2));
Waypoints waypoints;
SetupWaypoints(waypoints);
if (verbose)
PrintDistanceCounts();
TaskBehaviour task_behaviour;
task_behaviour.SetDefaults();
task_behaviour.DisableAll();
task_behaviour.enable_trace = false;
TaskManager task_manager(task_behaviour, waypoints);
TaskEventsPrint default_events(verbose);
task_manager.SetTaskEvents(default_events);
task_manager.SetGlidePolar(glide_polar);
task_report(task_manager, "null");
waypoints.Clear(); // clear waypoints so abort wont do anything
autopilot_parms.goto_target = true;
return run_flight(task_manager, autopilot_parms, 0);
}
示例2: glide_polar
static bool
test_olc(int n_wind, Contest olc_type)
{
GlidePolar glide_polar(fixed_two);
Waypoints waypoints;
SetupWaypoints(waypoints);
if (verbose)
PrintDistanceCounts();
TaskBehaviour task_behaviour;
task_behaviour.SetDefaults();
task_behaviour.DisableAll();
if (!verbose)
task_behaviour.enable_trace = false;
TaskManager task_manager(task_behaviour, waypoints);
TaskEventsPrint default_events(verbose);
task_manager.SetTaskEvents(default_events);
task_manager.SetGlidePolar(glide_polar);
test_task(task_manager, waypoints, 1);
waypoints.Clear(); // clear waypoints so abort wont do anything
autopilot_parms.goto_target = true;
return run_flight(task_manager, autopilot_parms, n_wind);
}
示例3: center
int
main(int argc, char** argv)
{
if (!ParseArgs(argc, argv))
return 0;
plan_tests(52);
Waypoints waypoints;
GeoPoint center(Angle::Degrees(51.4), Angle::Degrees(7.85));
// AddSpiralWaypoints creates 151 waypoints from
// 0km to 150km distance in 1km steps
AddSpiralWaypoints(waypoints, center);
ok1(!waypoints.IsEmpty());
ok1(waypoints.size() == 151);
TestLookups(waypoints, center);
TestNamePrefixVisitor(waypoints);
TestRangeVisitor(waypoints, center);
TestGetNearest(waypoints, center);
TestIterator(waypoints);
ok(TestCopy(waypoints), "waypoint copy", 0);
ok(TestErase(waypoints, 3), "waypoint erase", 0);
ok(TestReplace(waypoints, 4), "waypoint replace", 0);
// test clear
waypoints.Clear();
ok1(waypoints.IsEmpty());
ok1(waypoints.size() == 0);
return exit_status();
}
示例4: LogStartUp
bool
WaypointGlue::LoadWaypoints(Waypoints &way_points,
const RasterTerrain *terrain,
OperationEnvironment &operation)
{
LogStartUp(_T("ReadWaypoints"));
operation.SetText(_("Loading Waypoints..."));
bool found = false;
// Delete old waypoints
way_points.Clear();
// ### FIRST FILE ###
found |= LoadWaypointFile(1, way_points, terrain, operation);
// ### SECOND FILE ###
found |= LoadWaypointFile(2, way_points, terrain, operation);
// ### WATCHED WAYPOINT/THIRD FILE ###
found |= LoadWaypointFile(3, way_points, terrain, operation);
// ### MAP/FOURTH FILE ###
// If no waypoint file found yet
if (!found)
found = LoadMapFileWaypoints(0, szProfileMapFile, way_points, terrain,
operation);
// Optimise the waypoint list after attaching new waypoints
way_points.Optimise();
// Return whether waypoints have been loaded into the waypoint list
return found;
}
示例5: LogFormat
bool
WaypointGlue::LoadWaypoints(Waypoints &way_points,
const RasterTerrain *terrain,
OperationEnvironment &operation)
{
LogFormat("ReadWaypoints");
operation.SetText(_("Loading Waypoints..."));
bool found = false;
// Delete old waypoints
way_points.Clear();
TCHAR path[MAX_PATH];
LoadWaypointFile(way_points, LocalPath(path, _T("user.cup")),
WaypointFileType::SEEYOU,
WaypointOrigin::USER, terrain, operation);
// ### FIRST FILE ###
if (Profile::GetPath(ProfileKeys::WaypointFile, path))
found |= LoadWaypointFile(way_points, path, WaypointOrigin::PRIMARY,
terrain, operation);
// ### SECOND FILE ###
if (Profile::GetPath(ProfileKeys::AdditionalWaypointFile, path))
found |= LoadWaypointFile(way_points, path, WaypointOrigin::ADDITIONAL,
terrain, operation);
// ### WATCHED WAYPOINT/THIRD FILE ###
if (Profile::GetPath(ProfileKeys::WatchedWaypointFile, path))
found |= LoadWaypointFile(way_points, path, WaypointOrigin::WATCHED,
terrain, operation);
// ### MAP/FOURTH FILE ###
// If no waypoint file found yet
if (!found) {
auto dir = OpenMapFile();
if (dir != nullptr) {
found |= LoadWaypointFile(way_points, dir, "waypoints.xcw",
WaypointFileType::WINPILOT,
WaypointOrigin::MAP,
terrain, operation);
found |= LoadWaypointFile(way_points, dir, "waypoints.cup",
WaypointFileType::SEEYOU,
WaypointOrigin::MAP,
terrain, operation);
zzip_dir_close(dir);
}
}
// Optimise the waypoint list after attaching new waypoints
way_points.Optimise();
// Return whether waypoints have been loaded into the waypoint list
return found;
}
示例6: glide_polar
TestFlightResult
test_flight(TestFlightComponents components, int test_num, int n_wind,
const double speed_factor, const bool auto_mc)
{
// multipurpose flight test
GlidePolar glide_polar(fixed(2));
Waypoints waypoints;
SetupWaypoints(waypoints);
if (verbose)
PrintDistanceCounts();
TaskBehaviour task_behaviour;
task_behaviour.SetDefaults();
task_behaviour.enable_trace = false;
task_behaviour.auto_mc = auto_mc;
task_behaviour.calc_glide_required = false;
if ((test_num == 0) || (test_num == 2))
task_behaviour.optimise_targets_bearing = false;
TaskManager task_manager(task_behaviour, waypoints);
TaskEventsPrint default_events(verbose);
task_manager.SetTaskEvents(default_events);
task_manager.SetGlidePolar(glide_polar);
OrderedTaskSettings otb = task_manager.GetOrderedTask().GetOrderedTaskSettings();
otb.aat_min_time = aat_min_time(test_num);
task_manager.SetOrderedTaskSettings(otb);
bool goto_target = false;
switch (test_num) {
case 0:
case 2:
case 7:
goto_target = true;
break;
};
autopilot_parms.goto_target = goto_target;
test_task(task_manager, waypoints, test_num);
waypoints.Clear(); // clear waypoints so abort wont do anything
return run_flight(components, task_manager, autopilot_parms, n_wind,
speed_factor);
}
示例7: LogFormat
bool
WaypointGlue::LoadWaypoints(Waypoints &way_points,
const RasterTerrain *terrain,
OperationEnvironment &operation)
{
LogFormat("ReadWaypoints");
operation.SetText(_("Loading Waypoints..."));
bool found = false;
// Delete old waypoints
way_points.Clear();
TCHAR path[MAX_PATH];
// ### FIRST FILE ###
if (Profile::GetPath(ProfileKeys::WaypointFile, path))
found |= LoadWaypointFile(way_points, path, 1, terrain, operation);
// ### SECOND FILE ###
if (Profile::GetPath(ProfileKeys::AdditionalWaypointFile, path))
found |= LoadWaypointFile(way_points, path, 2, terrain, operation);
// ### WATCHED WAYPOINT/THIRD FILE ###
if (Profile::GetPath(ProfileKeys::WatchedWaypointFile, path))
found |= LoadWaypointFile(way_points, path, 3, terrain, operation);
// ### MAP/FOURTH FILE ###
// If no waypoint file found yet
if (!found && Profile::GetPath(ProfileKeys::MapFile, path)) {
TCHAR *tail = path + _tcslen(path);
_tcscpy(tail, _T("/waypoints.xcw"));
found |= LoadWaypointFile(way_points, path, 0, terrain, operation);
_tcscpy(tail, _T("/waypoints.cup"));
found |= LoadWaypointFile(way_points, path, 0, terrain, operation);
}
// Optimise the waypoint list after attaching new waypoints
way_points.Optimise();
// Return whether waypoints have been loaded into the waypoint list
return found;
}
示例8: LogStartUp
void
XCSoarInterface::Shutdown()
{
VerboseOperationEnvironment operation;
gcc_unused ScopeBusyIndicator busy;
// Show progress dialog
operation.SetText(_("Shutdown, please wait..."));
// Log shutdown information
LogStartUp(_T("Entering shutdown..."));
StartupLogFreeRamAndStorage();
// Turn off all displays
globalRunningEvent.Reset();
#ifdef HAVE_TRACKING
if (tracking != NULL)
tracking->StopAsync();
#endif
// Stop logger and save igc file
operation.SetText(_("Shutdown, saving logs..."));
logger.GUIStopLogger(Basic(), true);
delete flight_logger;
flight_logger = NULL;
GetLiveBlackboard().RemoveListener(glide_computer_events);
FlarmFriends::Save();
// Save settings to profile
operation.SetText(_("Shutdown, saving profile..."));
Profile::Save();
// Stop sound
AudioVarioGlue::Deinitialise();
operation.SetText(_("Shutdown, please wait..."));
// Stop threads
LogStartUp(_T("Stop threads"));
#ifndef ENABLE_OPENGL
draw_thread->BeginStop();
#endif
calculation_thread->BeginStop();
merge_thread->BeginStop();
// Wait for the calculations thread to finish
LogStartUp(_T("Waiting for calculation thread"));
merge_thread->Join();
delete merge_thread;
merge_thread = NULL;
calculation_thread->Join();
delete calculation_thread;
calculation_thread = NULL;
// Wait for the drawing thread to finish
#ifndef ENABLE_OPENGL
LogStartUp(_T("Waiting for draw thread"));
draw_thread->Join();
delete draw_thread;
#endif
LogStartUp(_T("delete MapWindow"));
main_window.Deinitialise();
// Save the task for the next time
operation.SetText(_("Shutdown, saving task..."));
LogStartUp(_T("Save default task"));
protected_task_manager->TaskSaveDefault();
// Clear waypoint database
LogStartUp(_T("Close waypoints"));
way_points.Clear();
operation.SetText(_("Shutdown, please wait..."));
// Clear weather database
LogStartUp(_T("CloseRASP"));
RASP.Close();
// Clear terrain database
LogStartUp(_T("CloseTerrain"));
delete terrain;
LogStartUp(_T("CloseTopography"));
delete topography;
delete protected_marks;
delete marks;
// Close any device connections
//.........这里部分代码省略.........