当前位置: 首页>>代码示例>>C++>>正文


C++ SearchPointVector::end方法代码示例

本文整理汇总了C++中SearchPointVector::end方法的典型用法代码示例。如果您正苦于以下问题:C++ SearchPointVector::end方法的具体用法?C++ SearchPointVector::end怎么用?C++ SearchPointVector::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SearchPointVector的用法示例。


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

示例1:

static FlatGeoPoint
nearest_point_convex(const SearchPointVector& spv, const FlatGeoPoint &p3)
{
  unsigned distance_min = 0-1;

  SearchPointVector::const_iterator i_best = spv.end();

  // find nearest point in vector
  for (SearchPointVector::const_iterator i = spv.begin(); 
       i!= spv.end(); ++i) {

    unsigned d_this = p3.distance_sq_to(i->get_flatLocation());
    if (d_this<distance_min) {
      distance_min = d_this;
      i_best = i;
    }
  }

  FlatGeoPoint pc = i_best->get_flatLocation();

  // find nearest point on this segment
  FlatGeoPoint pa = segment_nearest_point(spv,i_best,p3);
  if (!(pa == pc)) {
    unsigned d_seg = pa.distance_sq_to(p3);
    if (d_seg < distance_min) {
      distance_min = d_seg;
      pc = pa;
    }
  }

  // find nearest point on previous segment
  SearchPointVector::const_iterator i_prev;
  if (i_best == spv.begin()) {
    i_prev = spv.end()-1;
  } else {
    i_prev = i_best-1;
  }

  FlatGeoPoint pb = segment_nearest_point(spv,i_prev,p3);
  if (!(pb == pc)) {
    unsigned d_seg = pb.distance_sq_to(p3);
    if (d_seg < distance_min) {
      distance_min = d_seg;
      pc = pb;
    }
  }

  return pc;
}
开发者ID:Plantain,项目名称:XCSoar,代码行数:49,代码来源:SearchPointVector.cpp

示例2:

void
MapCanvas::project(const Projection &projection,
                   const SearchPointVector &points, RasterPoint *screen)
{
  for (auto it = points.begin(); it != points.end(); ++it)
    *screen++ = projection.GeoToScreen(it->get_location());
}
开发者ID:davidswelt,项目名称:XCSoar,代码行数:7,代码来源:MapCanvas.cpp

示例3:

void
MapCanvas::Project(const Projection &projection,
                   const SearchPointVector &points, BulkPixelPoint *screen)
{
  for (auto it = points.begin(); it != points.end(); ++it)
    *screen++ = projection.GeoToScreen(it->GetLocation());
}
开发者ID:Advi42,项目名称:XCSoar,代码行数:7,代码来源:MapCanvas.cpp

示例4: write_spv

void write_spv (const SearchPointVector& spv)
{
  for (auto v = spv.begin(); v != spv.end(); ++v) {
    write_point(*v, v->get_flatLocation(), "spv");
  }
  printf("spv\n");
  fflush(stdout);
}
开发者ID:davidswelt,项目名称:XCSoar,代码行数:8,代码来源:Printing.cpp

示例5: nearest_point

static FlatGeoPoint
segment_nearest_point(const SearchPointVector& spv,
                      const SearchPointVector::const_iterator i1,
                      const FlatGeoPoint &p3)
{
  if (i1+1 == spv.end()) {
    return nearest_point(i1->get_flatLocation(),
                         spv.begin()->get_flatLocation(),
                         p3);
  } else {
    return nearest_point(i1->get_flatLocation(),
                         (i1+1)->get_flatLocation(),
                         p3);
  }
}
开发者ID:Plantain,项目名称:XCSoar,代码行数:15,代码来源:SearchPointVector.cpp

示例6: NearestPoint

gcc_pure
static FlatGeoPoint
SegmentNearestPoint(const SearchPointVector& spv,
                      const SearchPointVector::const_iterator i1,
                      const FlatGeoPoint &p3)
{
  if (i1+1 == spv.end()) {
    return NearestPoint(i1->GetFlatLocation(),
                        spv.begin()->GetFlatLocation(),
                        p3);
  } else {
    return NearestPoint(i1->GetFlatLocation(),
                        (i1 + 1)->GetFlatLocation(),
                        p3);
  }
}
开发者ID:Adrien81,项目名称:XCSoar,代码行数:16,代码来源:SearchPointVector.cpp

示例7: SegmentNearestPoint

static FlatGeoPoint
NearestPointNonConvex(const SearchPointVector& spv, const FlatGeoPoint &p3)
{
  unsigned distance_min = 0-1;
  FlatGeoPoint point_best;
  for (SearchPointVector::const_iterator i = spv.begin(); 
       i!= spv.end(); ++i) {

    FlatGeoPoint pa = SegmentNearestPoint(spv,i,p3);
    unsigned d_this = p3.distance_sq_to(pa);
    if (d_this<distance_min) {
      distance_min = d_this;
      point_best = pa;
    }
  }
  return point_best;
}
开发者ID:macsux,项目名称:XCSoar,代码行数:17,代码来源:SearchPointVector.cpp

示例8: size

GrahamScan::GrahamScan(SearchPointVector& sps, const fixed sign_tolerance):
  raw_points(sps.begin(), sps.end()), raw_vector(sps), size(sps.size()),
  tolerance(sign_tolerance)
{
}
开发者ID:davidswelt,项目名称:XCSoar,代码行数:5,代码来源:GrahamScan.cpp


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