本文整理汇总了C++中TracePointVector::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ TracePointVector::begin方法的具体用法?C++ TracePointVector::begin怎么用?C++ TracePointVector::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TracePointVector
的用法示例。
在下文中一共展示了TracePointVector::begin方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fs
void
PrintHelper::contestmanager_print(const ContestManager &man,
const Trace &trace_full,
const Trace &trace_triangle,
const Trace &trace_sprint)
{
Directory::Create(_T("output/results"));
{
std::ofstream fs("output/results/res-olc-trace.txt");
TracePointVector v;
trace_full.GetPoints(v);
for (auto it = v.begin(); it != v.end(); ++it)
fs << it->GetLocation().longitude << " " << it->GetLocation().latitude
<< " " << it->GetAltitude() << " " << it->GetTime()
<< "\n";
}
{
std::ofstream fs("output/results/res-olc-trace_triangle.txt");
TracePointVector v;
trace_triangle.GetPoints(v);
for (auto it = v.begin(); it != v.end(); ++it)
fs << it->GetLocation().longitude << " " << it->GetLocation().latitude
<< " " << it->GetAltitude() << " " << it->GetTime()
<< "\n";
}
{
std::ofstream fs("output/results/res-olc-trace_sprint.txt");
TracePointVector v;
trace_sprint.GetPoints(v);
for (auto it = v.begin(); it != v.end(); ++it)
fs << it->GetLocation().longitude << " " << it->GetLocation().latitude
<< " " << it->GetAltitude() << " " << it->GetTime()
<< "\n";
}
std::ofstream fs("output/results/res-olc-solution.txt");
if (man.stats.solution[0].empty()) {
fs << "# no solution\n";
return;
}
if (positive(man.stats.result[0].time)) {
for (auto it = man.stats.solution[0].begin();
it != man.stats.solution[0].end(); ++it) {
fs << it->GetLocation().longitude << " " << it->GetLocation().latitude
<< " " << it->GetTime()
<< "\n";
}
}
}
示例2: make_pair
static std::pair<double, double>
GetMinMax(TrailSettings::Type type, const TracePointVector &trace)
{
double value_min, value_max;
if (type == TrailSettings::Type::ALTITUDE) {
value_max = 1000;
value_min = 500;
for (auto it = trace.begin(); it != trace.end(); ++it) {
value_max = std::max(it->GetAltitude(), value_max);
value_min = std::min(it->GetAltitude(), value_min);
}
} else {
value_max = 0.75;
value_min = -2.0;
for (auto it = trace.begin(); it != trace.end(); ++it) {
value_max = std::max(it->GetVario(), value_max);
value_min = std::min(it->GetVario(), value_min);
}
value_max = std::min(7.5, value_max);
value_min = std::max(-5.0, value_min);
}
return std::make_pair(value_min, value_max);
}
示例3: make_pair
static std::pair<fixed, fixed>
GetMinMax(TrailSettings::Type type, const TracePointVector &trace)
{
fixed value_min, value_max;
if (type == TrailSettings::Type::ALTITUDE) {
value_max = fixed(1000);
value_min = fixed(500);
for (auto it = trace.begin(); it != trace.end(); ++it) {
value_max = std::max(it->GetAltitude(), value_max);
value_min = std::min(it->GetAltitude(), value_min);
}
} else {
value_max = fixed(0.75);
value_min = fixed(-2.0);
for (auto it = trace.begin(); it != trace.end(); ++it) {
value_max = std::max(it->GetVario(), value_max);
value_min = std::min(it->GetVario(), value_min);
}
value_max = std::min(fixed(7.5), value_max);
value_min = std::max(fixed(-5.0), value_min);
}
return std::make_pair(value_min, value_max);
}