• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ TracePointVector类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中TracePointVector的典型用法代码示例。如果您正苦于以下问题:C++ TracePointVector类的具体用法?C++ TracePointVector怎么用?C++ TracePointVector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了TracePointVector类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: begin

void
Trace::GetPoints(TracePointVector &v, unsigned min_time,
                 const GeoPoint &location, fixed min_distance) const
{
  /* skip the trace points that are before min_time */
  Trace::const_iterator i = begin(), end = this->end();
  unsigned skipped = 0;
  while (true) {
    if (i == end)
      /* nothing left */
      return;

    if (i->GetTime() >= min_time)
      /* found the first point that is within range */
      break;

    ++i;
    ++skipped;
  }

  assert(skipped < size());

  v.reserve(size() - skipped);
  const unsigned range = ProjectRange(location, min_distance);
  const unsigned sq_range = range * range;
  do {
    v.push_back(*i);
    i.NextSquareRange(sq_range, end);
  } while (i != end);
}
开发者ID:damianob,项目名称:xcsoar,代码行数:30,代码来源:Trace.cpp


示例2: GetMinMax

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);
}
开发者ID:kwtskran,项目名称:XCSoar,代码行数:28,代码来源:TrailRenderer.cpp


示例3: end

void
Trace::GetPoints(TracePointVector& iov) const
{
  iov.clear();
  iov.reserve(size());
  std::copy(begin(), end(), std::back_inserter(iov));
}
开发者ID:damianob,项目名称:xcsoar,代码行数:7,代码来源:Trace.cpp


示例4: GetMinMax

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);
}
开发者ID:ThomasXBMC,项目名称:XCSoar,代码行数:28,代码来源:TrailRenderer.cpp


示例5:

void 
OLCLeague::copy_solution(TracePointVector &vec) const
{
  vec.clear();
  vec.reserve(5);
  if (solution_found) {
    for (unsigned i = 0; i < 5; ++i)
      vec.push_back(best_solution[i]);
  }
}
开发者ID:galippi,项目名称:xcsoar,代码行数:10,代码来源:OLCLeague.cpp


示例6:

void
OLCDijkstra::copy_solution(TracePointVector &vec)
{
  vec.clear();
  if (solution_found) {
    vec.reserve(num_stages);
    for (unsigned i = 0; i < num_stages; ++i)
      vec.push_back(best_solution[i]);
  }
}
开发者ID:Plantain,项目名称:XCSoar,代码行数:10,代码来源:OLCDijkstra.cpp


示例7: 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";
    }
  }
}
开发者ID:Adrien81,项目名称:XCSoar,代码行数:60,代码来源:ContestPrinting.cpp


示例8:

bool 
OnlineContest::update_trace_sample(const AIRCRAFT_STATE &state,
                                   TracePointVector& vec)
{
  if (vec.empty())
    return false;
    
  if (state.NavAltitude < vec.back().NavAltitude) {
    // replace if lower even if not significant distance away
    vec.back().NavAltitude = state.NavAltitude;
    return true;
  }

  return false;
}
开发者ID:hnpilot,项目名称:XCSoar,代码行数:15,代码来源:OnlineContest.cpp


示例9:

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;
}
开发者ID:Mrdini,项目名称:XCSoar,代码行数:44,代码来源:OLCLeague.cpp


示例10: 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);
}
开发者ID:kwtskran,项目名称:XCSoar,代码行数:12,代码来源:TrailRenderer.cpp


示例11: TracePointVector

TracePointVector
Trace::get_trace_points(const unsigned max_points) const
{
  if (max_points == 2) {
    if (trace_tree.size()<2) {
      return TracePointVector();
    }
    // special case - just look for points within time range
    TracePoint p;
    unsigned tmin = (unsigned)-1;
    for (TraceTree::const_iterator tr = trace_tree.begin();
         tr != trace_tree.end(); ++tr) {
      if (inside_time_window(tr->time) && (tr->time< tmin)) {
        p = *tr;
        tmin = tr->time;
      }
    }
    TracePointVector v;
    v.push_back(p);
    v.push_back(m_last_point);
    return v;
  }

  TracePointSet tset(begin(), end());

  if (tset.empty())
    return TracePointVector();

  TracePointList tlist(tset.begin(), tset.end());

  unsigned mrange = 3;

  while (tlist.size() > max_points) {
    thin_trace(tlist, mrange);
    mrange = (mrange * 4) / 3;
  }

  return TracePointVector(tlist.begin(), tlist.end());
}
开发者ID:galippi,项目名称:xcsoar,代码行数:39,代码来源:Trace.cpp


示例12: ScanBounds

 void ScanBounds(GeoBounds &bounds) const {
   trace.ScanBounds(bounds);
 }
开发者ID:kwtskran,项目名称:XCSoar,代码行数:3,代码来源:TrailRenderer.hpp



注:本文中的TracePointVector类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ Tracer类代码示例发布时间:2022-05-31
下一篇:
C++ TracePoint类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap