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


C++ AbstractAirspace::GetTop方法代码示例

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


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

示例1: switch

bool
IsAirspaceAltitudeVisible(const AbstractAirspace &airspace,
                          const AltitudeState &state,
                          const AirspaceComputerSettings &computer_settings,
                          const AirspaceRendererSettings &renderer_settings)
{
  /// @todo airspace visibility did use ToMSL(..., map.Calculated().TerrainAlt); 

  switch (renderer_settings.altitude_mode) {
  case AirspaceDisplayMode::ALLON:
    return true;

  case AirspaceDisplayMode::CLIP:
    return airspace.GetBase().GetAltitude(state) <= fixed(renderer_settings.clip_altitude);

  case AirspaceDisplayMode::AUTO:
    return airspace.GetBase().IsBelow(state, fixed(computer_settings.warnings.altitude_warning_margin))
      && airspace.GetTop().IsAbove(state, fixed(computer_settings.warnings.altitude_warning_margin));

  case AirspaceDisplayMode::ALLBELOW:
    return airspace.GetBase().IsBelow(state, fixed(computer_settings.warnings.altitude_warning_margin));

  case AirspaceDisplayMode::INSIDE:
    return (airspace.GetBase().IsBelow(state) && airspace.GetTop().IsAbove(state));

  case AirspaceDisplayMode::ALLOFF:
    return false;
  }
  return true;
}
开发者ID:Adrien81,项目名称:XCSoar,代码行数:30,代码来源:AirspaceVisibility.cpp

示例2: Visit

 void Visit(const AbstractAirspace &as) {
     if (do_report) {
         *fout << as;
         *fout << "# Name: " << as.GetName()
               << "Base: " << as.GetBase()
               << " Top: " << as.GetTop()
               << "\n";
     }
 }
开发者ID:kwtskran,项目名称:XCSoar,代码行数:9,代码来源:harness_airspace.cpp

示例3: operator

 virtual bool operator()(const AbstractAirspace &airspace) const {
   return CheckAirspace(airspace) &&
     /* skip airspaces that we already entered */
     !airspace.Inside(location) &&
     /* check altitude; hard-coded margin of 50m (for now) */
     (!altitude_available ||
      (airspace.GetBase().IsBelow(altitude, fixed(50)) &&
       airspace.GetTop().IsAbove(altitude, fixed(50))));
 }
开发者ID:damianob,项目名称:xcsoar,代码行数:9,代码来源:Airspace.cpp

示例4: switch

bool
AirspaceVisiblePredicate::IsAltitudeVisible(const AbstractAirspace& airspace) const
{
  /// @todo airspace visibility did use ToMSL(..., map.Calculated().TerrainAlt); 

  switch (renderer_settings.altitude_mode) {
  case ALLON:
    return true;
  case CLIP:
    return airspace.GetBase().GetAltitude(state) <= fixed(renderer_settings.clip_altitude);
  case AUTO:
    return airspace.GetBase().IsBelow(state, fixed(computer_settings.warnings.AltWarningMargin))
      && airspace.GetTop().IsAbove(state, fixed(computer_settings.warnings.AltWarningMargin));
  case ALLBELOW:
    return airspace.GetBase().IsBelow(state, fixed(computer_settings.warnings.AltWarningMargin));
  case INSIDE:
    return (airspace.GetBase().IsBelow(state) && airspace.GetTop().IsAbove(state));

  case ALLOFF:
    return false;
  }
  return true;
}
开发者ID:davidswelt,项目名称:XCSoar,代码行数:23,代码来源:AirspaceVisibility.cpp

示例5: visit_abstract

  void visit_abstract(const AbstractAirspace &as) {
    assert(!m_intersections.empty());

    GeoPoint point = m_intersections[0].first;

    RouteLink l = rpolar.GenerateIntermediate(link.first,
                                               RoutePoint(proj.project(point), link.second.altitude),
                                               proj);

    if (l.second.altitude < RoughAltitude(as.GetBase().altitude) ||
        l.second.altitude > RoughAltitude(as.GetTop().altitude))
      return;

    if (negative(min_distance) || (l.d < min_distance)) {
      min_distance = l.d;
      nearest = std::make_pair(&as, l.second);
    }
  }
开发者ID:,项目名称:,代码行数:18,代码来源:

示例6: Check

  void Check(const AbstractAirspace &airspace) {
    if (!active_predicate(airspace))
      return;

    /* check delta below */
    fixed base = airspace.GetBase().GetAltitude(altitude);
    fixed base_delta = base - altitude.altitude;
    if (!negative(base_delta) && base_delta < fabs(nearest_delta)) {
      nearest = &airspace;
      nearest_delta = base_delta;
    }

    /* check delta above */
    fixed top = airspace.GetTop().GetAltitude(altitude);
    fixed top_delta = altitude.altitude - top;
    if (!negative(top_delta) && top_delta < fabs(nearest_delta)) {
      nearest = &airspace;
      nearest_delta = -top_delta;
    }
  }
开发者ID:CnZoom,项目名称:XcSoarPull,代码行数:20,代码来源:NearestAirspace.cpp

示例7: Visit

  void Visit(const AbstractAirspace &as) override {
    assert(!intersections.empty());

    GeoPoint point = intersections[0].first;

    RouteLink l =
      rpolar.GenerateIntermediate(link.first,
                                  RoutePoint(proj.ProjectInteger(point),
                                             link.second.altitude),
                                  proj);

    if (l.second.altitude < as.GetBase().altitude ||
        l.second.altitude > as.GetTop().altitude)
      return;

    if (min_distance < 0 || l.d < min_distance) {
      min_distance = l.d;
      nearest = std::make_pair(&as, l.second);
    }
  }
开发者ID:Advi42,项目名称:XCSoar,代码行数:20,代码来源:AirspaceRoute.cpp

示例8: return

bool
AirspacePredicateHeightRange::check_height(const AbstractAirspace& t) const
{
  return (int)t.GetTop().altitude >= h_min &&
         (int)t.GetBase().altitude <= h_max;
}
开发者ID:macsux,项目名称:XCSoar,代码行数:6,代码来源:AirspacePredicateHeightRange.cpp

示例9: RoughAltitude

bool
AirspacePredicateHeightRange::check_height(const AbstractAirspace& t) const
{
  return RoughAltitude(t.GetTop().altitude) >= h_min &&
    RoughAltitude(t.GetBase().altitude) <= h_max;
}
开发者ID:StefanL74,项目名称:XCSoar,代码行数:6,代码来源:AirspacePredicateHeightRange.cpp

示例10: _T

tstring
AirspaceFormatter::GetVerticalText(const AbstractAirspace &airspace)
{
  return _T("Base: ") + airspace.GetBase().GetAsText(false) +
         _T(" Top: ") + airspace.GetTop().GetAsText(false);
}
开发者ID:damianob,项目名称:xcsoar,代码行数:6,代码来源:AirspaceFormatter.cpp


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