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


C++ Waypoint::IsAirport方法代码示例

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


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

示例1: AddText

void
WaypointEditWidget::Prepare(gcc_unused ContainerWindow &parent,
                            gcc_unused const PixelRect &rc)
{
  AddText(_("Name"), nullptr, value.name.c_str());
  AddText(_("Comment"), nullptr, value.comment.c_str());
  Add(_("Location"), nullptr, new GeoPointDataField(value.location,UIGlobals::GetFormatSettings().coordinate_format));
  AddFloat(_("Altitude"), nullptr,
           _T("%.0f %s"), _T("%.0f"),
           0, 30000, 5, false,
           UnitGroup::ALTITUDE, value.elevation);
  AddEnum(_("Type"), nullptr, waypoint_types,
          value.IsAirport() ? 1u : (value.IsLandable() ? 2u : 0u ));
}
开发者ID:rkohel,项目名称:XCSoar,代码行数:14,代码来源:dlgWaypointEdit.cpp

示例2: AddText

void
WaypointEditWidget::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
    AddText(_("Name"), nullptr, value.name.c_str());
    AddText(_("Comment"), nullptr, value.comment.c_str());
    Add(_("Location"), nullptr, new GeoPointDataField(value.location,
            // TODO: use configured CoordinateFormat
            CoordinateFormat::DDMMSS));
    AddFloat(_("Altitude"), nullptr,
             _T("%.0f %s"), _T("%.0f"),
             fixed(0), fixed(30000), fixed(5), false,
             UnitGroup::ALTITUDE, value.elevation);
    AddEnum(_("Type"), nullptr, waypoint_types,
            value.IsAirport() ? 1u : (value.IsLandable() ? 2u : 0u ));
}
开发者ID:hm17gh1,项目名称:XCSoar,代码行数:15,代码来源:dlgWaypointEdit.cpp

示例3: ToASCII

bool
CAI302Device::WriteNavpoint(unsigned id, const Waypoint &wp,
                            OperationEnvironment &env)
{
  if (!DownloadMode(env))
    return false;

  char name[64], remark[64];
  ToASCII(name, ARRAY_SIZE(name), wp.name.c_str());
  ToASCII(remark, ARRAY_SIZE(remark), wp.comment.c_str());

  if (!CAI302::DownloadNavpoint(port, wp.location, (int)wp.elevation, id,
                                wp.IsTurnpoint(), wp.IsAirport(), false,
                                wp.IsLandable(), wp.IsStartpoint(),
                                wp.IsFinishpoint(), wp.flags.home,
                                false, wp.IsTurnpoint(), false,
                                name, remark, env)) {
    mode = Mode::UNKNOWN;
    return false;
  }

  return true;
}
开发者ID:alon,项目名称:xcsoar,代码行数:23,代码来源:Manage.cpp

示例4: if

void
WaypointIconRenderer::DrawLandable(const Waypoint &waypoint,
                                   const PixelPoint &point,
                                   Reachability reachable)
{

    if (!settings.vector_landable_rendering) {
        const MaskedIcon *icon;

        if (reachable == ReachableTerrain)
            icon = waypoint.IsAirport()
                   ? &look.airport_reachable_icon
                   : &look.field_reachable_icon;
        else if (reachable == ReachableStraight)
            icon = waypoint.IsAirport()
                   ? &look.airport_marginal_icon
                   : &look.field_marginal_icon;
        else
            icon = waypoint.IsAirport()
                   ? &look.airport_unreachable_icon
                   : &look.field_unreachable_icon;

        icon->Draw(canvas, point);
        return;
    }

    // SW rendering of landables
    double scale = std::max(Layout::VptScale(settings.landable_rendering_scale),
                            110u) / 177.;
    double radius = 10 * scale;

    canvas.SelectBlackPen();

    const bool is_reachable = reachable != Invalid && reachable != Unreachable;

    switch (settings.landable_style) {
    case WaypointRendererSettings::LandableStyle::PURPLE_CIRCLE:
        // Render landable with reachable state
        if (is_reachable) {
            canvas.Select(reachable == ReachableTerrain
                          ? look.reachable_brush
                          : look.terrain_unreachable_brush);
            DrawLandableBase(canvas, point, waypoint.IsAirport(), 1.5 * radius);
        }
        canvas.Select(look.magenta_brush);
        break;

    case WaypointRendererSettings::LandableStyle::BW:
        if (is_reachable)
            canvas.Select(reachable == ReachableTerrain
                          ? look.reachable_brush
                          : look.terrain_unreachable_brush);
        else if (waypoint.IsAirport())
            canvas.Select(look.white_brush);
        else
            canvas.Select(look.light_gray_brush);
        break;

    case WaypointRendererSettings::LandableStyle::TRAFFIC_LIGHTS:
        if (is_reachable)
            canvas.Select(reachable == ReachableTerrain
                          ? look.reachable_brush
                          : look.orange_brush);
        else
            canvas.Select(look.unreachable_brush);
        break;
    }

    DrawLandableBase(canvas, point, waypoint.IsAirport(), radius);

    // Render runway indication
    const Runway &runway = waypoint.runway;
    if (runway.IsDirectionDefined()) {
        double len;
        if (settings.scale_runway_length && runway.IsLengthDefined())
            len = radius / 2. +
                  (((int) runway.GetLength() - 500) / 500) * radius / 4.;
        else
            len = radius;
        len += 2 * scale;
        Angle runwayDrawingAngle = runway.GetDirection() - screen_rotation;
        canvas.Select(look.white_brush);
        DrawLandableRunway(canvas, point, runwayDrawingAngle, len, 5 * scale);
    }
}
开发者ID:ahsparrow,项目名称:xcsoar,代码行数:85,代码来源:WaypointIconRenderer.cpp

示例5: if

void
WaypointIconRenderer::DrawLandable(const Waypoint &waypoint,
                                   const RasterPoint &point,
                                   Reachability reachable)
{

  if (!settings.vector_landable_rendering) {
    const MaskedIcon *icon;

    if (reachable == ReachableTerrain)
      icon = waypoint.IsAirport()
        ? &look.airport_reachable_icon
        : &look.field_reachable_icon;
    else if (reachable == ReachableStraight)
      icon = waypoint.IsAirport()
        ? &look.airport_marginal_icon
        : &look.field_marginal_icon;
    else
      icon = waypoint.IsAirport()
        ? &look.airport_unreachable_icon
        : &look.field_unreachable_icon;

    icon->draw(canvas, point);
    return;
  }

  // SW rendering of landables
  fixed scale = fixed(Layout::SmallScale(settings.landable_rendering_scale)) /
                fixed_int_constant(150);
  fixed radius = fixed_int_constant(10) * scale;

  canvas.black_pen();
  if (settings.landable_style == wpLandableWinPilot) {
    // Render landable with reachable state
    if (reachable != Unreachable) {
      canvas.select(reachable == ReachableTerrain
                    ? look.reachable_brush
                    : look.terrain_unreachable_brush);
      DrawLandableBase(canvas, point, waypoint.IsAirport(),
                       radius + radius / fixed_two);
    }
    canvas.select(look.magenta_brush);
  } else if (settings.landable_style == wpLandableAltB) {
    if (reachable != Unreachable)
      canvas.select(reachable == ReachableTerrain
                    ? look.reachable_brush
                    : look.orange_brush);
    else
      canvas.select(look.unreachable_brush);
  } else {
    if (reachable != Unreachable)
      canvas.select(reachable == ReachableTerrain
                    ? look.reachable_brush
                    : look.terrain_unreachable_brush);
    else if (waypoint.IsAirport())
      canvas.select(look.white_brush);
    else
      canvas.select(look.light_gray_brush);
  }
  DrawLandableBase(canvas, point, waypoint.IsAirport(), radius);

  // Render runway indication
  const Runway &runway = waypoint.runway;
  if (runway.IsDirectionDefined()) {
    fixed len;
    if (settings.scale_runway_length && runway.IsLengthDefined())
      len = (radius / fixed_two) +
        (((int) runway.GetLength() - 500) / 500) * (radius / fixed_four);
    else
      len = radius;
    len += fixed_two * scale;
    Angle runwayDrawingAngle = runway.GetDirection() - screen_rotation;
    canvas.select(look.white_brush);
    DrawLandableRunway(canvas, point, runwayDrawingAngle, len,
                       fixed_int_constant(5) * scale);
  }
}
开发者ID:joachimwieland,项目名称:xcsoar-jwieland,代码行数:77,代码来源:WaypointIconRenderer.cpp


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