本文整理汇总了C++中TracePointVector::size方法的典型用法代码示例。如果您正苦于以下问题:C++ TracePointVector::size方法的具体用法?C++ TracePointVector::size怎么用?C++ TracePointVector::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TracePointVector
的用法示例。
在下文中一共展示了TracePointVector::size方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Prepare
void
TrailRenderer::DrawTraceVector(Canvas &canvas, const Projection &projection,
const TracePointVector &trace)
{
const unsigned n = trace.size();
RasterPoint *p = Prepare(n);
for (const auto &i : trace)
*p++ = projection.GeoToScreen(i.GetLocation());
DrawPreparedPolyline(canvas, n);
}
示例2:
bool
OLCLeague::solve(bool exhaustive)
{
TracePointVector trace;
trace_master.get_trace_edges(trace);
if (trace.size()!=2) {
return false;
}
if (!finish_altitude_valid(trace[0], trace[1])) {
return false;
}
// solution found, so set start/finish points
solution[0] = trace[0];
solution[4] = trace[1];
// scan through classic solution to find points there to add
unsigned index_fill = 1;
for (unsigned index_classic = 1; index_classic+1 < solution_classic.size(); ++index_classic) {
if ((solution_classic[index_classic].time > solution[index_fill-1].time)
&&(solution_classic[index_classic].time < trace[1].time)) {
solution[index_fill] = solution_classic[index_classic];
index_fill++;
if (index_fill==4) {
break;
}
}
}
// if insufficient points found, add repeats of previous points
for (; index_fill<4; ++index_fill) {
solution[index_fill] = solution[index_fill-1];
}
solution_found = true;
return true;
}