本文整理汇总了C++中Waypoints::end方法的典型用法代码示例。如果您正苦于以下问题:C++ Waypoints::end方法的具体用法?C++ Waypoints::end怎么用?C++ Waypoints::end使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Waypoints
的用法示例。
在下文中一共展示了Waypoints::end方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WriteCup
void
WriteCup(TextWriter &writer, const Waypoints &waypoints,
WaypointOrigin origin)
{
// Iterate through the waypoint list and save each waypoint with
// the right file number to the TextWriter
/// @todo JMW: iteration ordered by ID would be preferred
for (auto it = waypoints.begin(); it != waypoints.end(); ++it) {
const Waypoint& wp = *it;
if (wp.origin == origin)
WriteCup(writer, wp);
}
}
示例2: composeLine
void
WayPointFileWinPilot::saveFile(TextWriter &writer, const Waypoints &way_points)
{
// Iterate through the waypoint list and save each waypoint
// into the file defined by fp
/// @todo JMW: iteration ordered by ID would be preferred
for (Waypoints::WaypointTree::const_iterator it = way_points.begin();
it != way_points.end(); it++) {
const Waypoint& wp = it->get_waypoint();
if (wp.FileNum == file_num)
composeLine(writer, wp);
}
}
示例3: test_nearest
unsigned test_nearest(const Waypoints& waypoints)
{
const Waypoint *r = waypoints.lookup_id(3);
if (r) {
Waypoints::WaypointTree::const_iterator it = waypoints.find_nearest(r->Location);
if (it != waypoints.end()) {
return true;
} else {
return false;
}
}
return false;
}
示例4:
void
CAI302WaypointUploader::Run(OperationEnvironment &env)
{
Waypoints waypoints;
env.SetText(_("Loading Waypoints..."));
if (!reader.Parse(waypoints, env)) {
env.SetErrorMessage(_("Failed to load file."));
return;
}
if (waypoints.size() > 9999) {
env.SetErrorMessage(_("Too many waypoints."));
return;
}
env.SetText(_("Uploading Waypoints"));
env.SetProgressRange(waypoints.size() + 1);
env.SetProgressPosition(0);
if (!device.ClearPoints(env)) {
if (!env.IsCancelled())
env.SetErrorMessage(_("Failed to erase waypoints."));
return;
}
if (!device.EnableBulkMode(env)) {
if (!env.IsCancelled())
env.SetErrorMessage(_("Failed to switch baud rate."));
return;
}
unsigned id = 1;
for (auto i = waypoints.begin(), end = waypoints.end();
i != end; ++i, ++id) {
if (env.IsCancelled())
break;
env.SetProgressPosition(id);
if (!device.WriteNavpoint(id, *i, env)) {
if (!env.IsCancelled())
env.SetErrorMessage(_("Failed to write waypoint."));
break;
}
}
device.DisableBulkMode(env);
}
示例5: setup_waypoints
/**
* Initialises waypoints with random and non-random waypoints
* for testing
*
* @param waypoints waypoints class to add waypoints to
*/
bool setup_waypoints(Waypoints &waypoints, const unsigned n)
{
Waypoint wp = waypoints.create(GeoPoint(Angle::degrees(fixed_zero),
Angle::degrees(fixed_zero)));
wp.Flags.Airport = true;
wp.Altitude = fixed(0.25);
waypoints.append(wp);
wp = waypoints.create(GeoPoint(Angle::degrees(fixed_zero),
Angle::degrees(fixed_one)));
wp.Flags.Airport = true;
wp.Altitude = fixed(0.25);
waypoints.append(wp);
wp = waypoints.create(GeoPoint(Angle::degrees(fixed_one),
Angle::degrees(fixed_one)));
wp.Name = _T("Hello");
wp.Flags.Airport = true;
wp.Altitude = fixed_half;
waypoints.append(wp);
wp = waypoints.create(GeoPoint(Angle::degrees(fixed(0.8)),
Angle::degrees(fixed(0.5))));
wp.Name = _T("Unk");
wp.Flags.Airport = true;
wp.Altitude = fixed(0.25);
waypoints.append(wp);
wp = waypoints.create(GeoPoint(Angle::degrees(fixed_one),
Angle::degrees(fixed_zero)));
wp.Flags.Airport = true;
wp.Altitude = fixed(0.25);
waypoints.append(wp);
wp = waypoints.create(GeoPoint(Angle::degrees(fixed_zero),
Angle::degrees(fixed(0.23))));
wp.Flags.Airport = true;
wp.Altitude = fixed(0.25);
waypoints.append(wp);
for (unsigned i=0; i<(unsigned)std::max((int)n-6,0); i++) {
int x = rand()%1200-100;
int y = rand()%1200-100;
double z = rand()% std::max(terrain_height,1);
wp = waypoints.create(GeoPoint(Angle::degrees(fixed(x/1000.0)),
Angle::degrees(fixed(y/1000.0))));
wp.Flags.Airport = false;
wp.Altitude = fixed(z);
waypoints.append(wp);
}
waypoints.optimise();
if (verbose) {
std::ofstream fin("results/res-wp-in.txt");
for (unsigned i=1; i<=waypoints.size(); i++) {
Waypoints::WaypointTree::const_iterator it = waypoints.find_id(i);
if (it != waypoints.end()) {
#ifdef DO_PRINT
fin << it->get_waypoint();
#endif
}
}
}
return true;
}