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


C++ AbstractAirspace类代码示例

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


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

示例1:

bool
AirspaceFilterData::Match(const GeoPoint &location,
                          const FlatProjection &projection,
                          const AbstractAirspace &as) const
{
  if (cls != AirspaceClass::AIRSPACECLASSCOUNT && as.GetType() != cls)
    return false;

  if (name_prefix != nullptr && !as.MatchNamePrefix(name_prefix))
    return false;

  if (!direction.IsNegative()) {
    const auto closest = as.ClosestPoint(location, projection);
    const auto bearing = location.Bearing(closest);
    auto direction_error = (bearing - direction).AsDelta().AbsoluteDegrees();
    if (direction_error > fixed(18))
      return false;
  }

  if (!negative(distance)) {
    const auto closest = as.ClosestPoint(location, projection);
    const auto distance = location.Distance(closest);
    if (distance > distance)
      return false;
  }

  return true;
}
开发者ID:ThomasXBMC,项目名称:XCSoar,代码行数:28,代码来源:AirspaceSorter.cpp

示例2: AddCircle

 void
 AddCircle(Airspaces &airspace_database)
 {
   AbstractAirspace *as = new AirspaceCircle(Center, Radius);
   as->set_properties(Name, Type, Base, Top);
   airspace_database.insert(as);
 }
开发者ID:Plantain,项目名称:XCSoar,代码行数:7,代码来源:AirspaceParser.cpp

示例3: Intersection

  /**
   * Check whether this intersection should be added to, or updated in, the warning manager
   *
   * @param airspace Airspace corresponding to current intersection
   */
  void Intersection(const AbstractAirspace& airspace) {
    if (!airspace.IsActive())
      return; // ignore inactive airspaces completely

    if (!warning_manager.GetConfig().IsClassEnabled(airspace.GetType()) ||
        ExcludeAltitude(airspace))
      return;

    AirspaceWarning *warning = warning_manager.GetWarningPtr(airspace);
    if (warning == NULL || warning->IsStateAccepted(warning_state)) {

      AirspaceInterceptSolution solution;

      if (mode_inside) {
        airspace.Intercept(state, perf, solution, state.location, state.location);
      } else {
        solution = Intercept(airspace, state, perf);
      }
      if (!solution.IsValid())
        return;
      if (solution.elapsed_time > max_time)
        return;

      if (warning == NULL)
        warning = warning_manager.GetNewWarningPtr(airspace);

      warning->UpdateSolution(warning_state, solution);
      found = true;
    }
  }
开发者ID:DRIZO,项目名称:xcsoar,代码行数:35,代码来源:AirspaceWarningManager.cpp

示例4:

bool
AirspacePredicateHeightRangeExcludeTwo::operator()(const AbstractAirspace& t) const
{
  if (!check_height(t))
    return false;
  return !t.inside(p1) && !t.inside(p2);
}
开发者ID:Mrdini,项目名称:XCSoar,代码行数:7,代码来源:AirspacePredicate.cpp

示例5: AddPolygon

 void
 AddPolygon(Airspaces &airspace_database)
 {
   AbstractAirspace *as = new AirspacePolygon(points);
   as->set_properties(Name, Type, Base, Top);
   airspace_database.insert(as);
 }
开发者ID:Plantain,项目名称:XCSoar,代码行数:7,代码来源:AirspaceParser.cpp

示例6:

bool
AirspacePredicateHeightRangeExcludeTwo::condition(const AbstractAirspace& t) const
{
  if (!check_height(t))
    return false;

  return !t.Inside(p1) && !t.Inside(p2);
}
开发者ID:macsux,项目名称:XCSoar,代码行数:8,代码来源:AirspacePredicateHeightRange.cpp

示例7: 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

示例8: visit_general

  virtual void visit_general(const AbstractAirspace& as) {
    if (do_report) {
#ifdef DO_PRINT
      *fout << "# Name: " << as.get_name_text() 
            << " " << as.get_vertical_text() 
            << "\n";
#endif
    }
  }
开发者ID:,项目名称:,代码行数:9,代码来源:

示例9: AddPolygon

 void
 AddPolygon(Airspaces &airspace_database)
 {
   AbstractAirspace *as = new AirspacePolygon(points);
   as->set_properties(Name, Type, Base, Top);
   as->set_radio(Radio);
   as->set_days(days_of_operation);
   airspace_database.insert(as);
 }
开发者ID:Mrdini,项目名称:XCSoar,代码行数:9,代码来源:AirspaceParser.cpp

示例10: AddPolygon

 void
 AddPolygon(Airspaces &airspace_database)
 {
   AbstractAirspace *as = new AirspacePolygon(points);
   as->SetProperties(name, type, base, top);
   as->SetRadio(radio);
   as->SetDays(days_of_operation);
   airspace_database.Add(as);
 }
开发者ID:DRIZO,项目名称:xcsoar,代码行数:9,代码来源:AirspaceParser.cpp

示例11: 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

示例12: AddCircle

 void
 AddCircle(Airspaces &airspace_database)
 {
   AbstractAirspace *as = new AirspaceCircle(center, radius);
   as->SetProperties(std::move(name), type, base, top);
   as->SetRadio(radio);
   as->SetDays(days_of_operation);
   airspace_database.Add(as);
 }
开发者ID:Adrien81,项目名称:XCSoar,代码行数:9,代码来源:AirspaceParser.cpp

示例13: write_border

void write_border (const AbstractAirspace& as)
{
  const SearchPointVector& spv = as.GetPoints();
  for (auto v = spv.begin(); v != spv.end(); ++v)
    write_point(*v, v->get_flatLocation(), "polygon");

  printf("polygon\n");
  write_spv(as.GetClearance());
  fflush(stdout);
}
开发者ID:davidswelt,项目名称:XCSoar,代码行数:10,代码来源:AirspacePrinting.cpp

示例14: AddPolygon

  void
  AddPolygon(Airspaces &airspace_database)
  {
    if (points.size() < 3)
      return;

    AbstractAirspace *as = new AirspacePolygon(points);
    as->SetProperties(std::move(name), type, base, top);
    as->SetRadio(radio);
    as->SetDays(days_of_operation);
    airspace_database.Add(as);
  }
开发者ID:Adrien81,项目名称:XCSoar,代码行数:12,代码来源:AirspaceParser.cpp

示例15: Invalid

AirspaceInterceptSolution
AirspaceNearestSort::solve_intercept(const AbstractAirspace &a) const
{
  if (a.Inside(m_location)) {
    return AirspaceInterceptSolution::Invalid();
  } else {
    AirspaceInterceptSolution sol;
    sol.location = a.ClosestPoint(m_location);
    sol.distance = sol.location.Distance(m_location);
    return sol;
  }
}
开发者ID:davidswelt,项目名称:XCSoar,代码行数:12,代码来源:AirspaceNearestSort.cpp


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