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


C++ GeoPoint::Middle方法代码示例

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


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

示例1: OnPaint

  virtual void OnPaint(Canvas &canvas) override {
    canvas.ClearWhite();

    const GeoPoint a(Angle::Degrees(7.70722),
                     Angle::Degrees(51.052));
    const GeoPoint b(Angle::Degrees(11.5228),
                     Angle::Degrees(50.3972));

    WindowProjection projection;
    projection.SetScreenOrigin(canvas.GetWidth() / 2, canvas.GetHeight() / 2);
    projection.SetGeoLocation(a.Middle(b));
    projection.SetScreenSize(canvas.GetSize());
    projection.SetScaleFromRadius(fixed(400000));
    projection.UpdateScreenBounds();

    canvas.SelectBlackPen();
    canvas.SelectHollowBrush();

    RasterPoint pa = projection.GeoToScreen(a);
    canvas.DrawCircle(pa.x, pa.y, 4);

    RasterPoint pb = projection.GeoToScreen(b);
    canvas.DrawCircle(pb.x, pb.y, 4);

    RenderFAISector(canvas, projection, a, b, false, settings);
  }
开发者ID:MindMil,项目名称:XCSoar,代码行数:26,代码来源:RunFAITriangleSectorRenderer.cpp

示例2: bb_target

void 
Airspaces::VisitIntersecting(const GeoPoint &loc, const GeoPoint &end,
                             AirspaceIntersectionVisitor& visitor) const
{
  if (empty())
    // nothing to do
    return;

  const GeoPoint c = loc.Middle(end);
  Airspace bb_target(c, task_projection);
  int projected_range = task_projection.ProjectRangeInteger(c, loc.Distance(end) / 2);
  IntersectingAirspaceVisitorAdapter adapter(loc, end, task_projection, visitor);
  airspace_tree.visit_within_range(bb_target, -projected_range, adapter);

#ifdef INSTRUMENT_TASK
  n_queries++;
#endif
}
开发者ID:StefanL74,项目名称:XCSoar,代码行数:18,代码来源:Airspaces.cpp


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