您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ AbstractAirspace类代码示例

51自学网 2021-06-03 12:04:49
  C++
这篇教程C++ AbstractAirspace类代码示例写得很实用,希望能帮到您。

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

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

示例1:

boolAirspaceFilterData::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,


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


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


示例4:

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


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


示例6:

boolAirspacePredicateHeightRangeExcludeTwo::condition(const AbstractAirspace& t) const{  if (!check_height(t))    return false;  return !t.Inside(p1) && !t.Inside(p2);}
开发者ID:macsux,项目名称:XCSoar,代码行数:8,


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


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


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


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


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


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


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


示例14: Invalid

AirspaceInterceptSolutionAirspaceNearestSort::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,


示例15: Render

  /**   * Renders the AbstractAirspace on the canvas   * @param as AbstractAirspace to render   */  void  Render(const AbstractAirspace& as)  {    int type = as.get_type();    if (type <= 0)      return;    // No intersections for this airspace    if (m_intersections.empty())      return;    // Select pens and brushes#ifdef ENABLE_SDL    Color color =      Graphics::GetAirspaceColour(settings.colours[type]);#ifdef ENABLE_OPENGL    color = color.with_alpha(48);#endif    Brush brush(color);#else    const Brush &brush = Graphics::GetAirspaceBrushByClass(type, settings);    canvas.set_text_color(light_color(Graphics::GetAirspaceColourByClass(type, settings)));#endif    PixelRect rcd;    // Calculate top and bottom coordinate    rcd.top = chart.screenY(as.get_top_altitude(state));    if (as.is_base_terrain())      rcd.bottom = chart.screenY(fixed_zero);    else      rcd.bottom = chart.screenY(as.get_base_altitude(state));    // Iterate through the intersections    for (AirspaceIntersectionVector::const_iterator it = m_intersections.begin();         it != m_intersections.end(); ++it) {      const GeoPoint p_start = it->first;      const GeoPoint p_end = it->second;      const fixed distance_start = start.distance(p_start);      const fixed distance_end = start.distance(p_end);      // Determine left and right coordinate      rcd.left = chart.screenX(distance_start);      rcd.right = chart.screenX(distance_end);      // only one edge found, next edge must be beyond screen      if ((rcd.left == rcd.right) && (p_start == p_end)) {        rcd.right = chart.screenX(chart.getXmax());      }      // Draw the airspace      RenderBox(rcd, brush, settings.black_outline, type);    }  }
开发者ID:Mrdini,项目名称:XCSoar,代码行数:57,


示例16:

AirspaceInterceptSolutionAirspaceNearestSort::solve_intercept(const AbstractAirspace &a) const{  if (a.inside(m_location)) {    AirspaceInterceptSolution null_sol;    return null_sol;  } else {    AirspaceInterceptSolution sol;    sol.location = a.closest_point(m_location);    sol.distance = sol.location.distance(m_location);    return sol;  }}
开发者ID:Plantain,项目名称:XCSoar,代码行数:13,


示例17: Render

  /**   * Renders the AbstractAirspace on the canvas   * @param as AbstractAirspace to render   */  void  Render(const AbstractAirspace& as)  {    int type = as.GetType();    if (type <= 0)      return;    // No intersections for this airspace    if (m_intersections.empty())      return;    // Select pens and brushes#ifndef USE_GDI    Color color = airspace_look.colors[settings.colours[type]];#ifdef ENABLE_OPENGL    color = color.WithAlpha(48);#endif    Brush brush(color);#else    const Brush &brush = airspace_look.brushes[settings.brushes[type]];    canvas.SetTextColor(LightColor(airspace_look.colors[settings.colours[type]]));#endif    PixelRect rcd;    // Calculate top and bottom coordinate    rcd.top = chart.screenY(as.GetTopAltitude(state));    if (as.IsBaseTerrain())      rcd.bottom = chart.screenY(fixed_zero);    else      rcd.bottom = chart.screenY(as.GetBaseAltitude(state));    // Iterate through the intersections    for (auto it = m_intersections.begin(); it != m_intersections.end(); ++it) {      const GeoPoint p_start = it->first;      const GeoPoint p_end = it->second;      const fixed distance_start = start.Distance(p_start);      const fixed distance_end = start.Distance(p_end);      // Determine left and right coordinate      rcd.left = chart.screenX(distance_start);      rcd.right = chart.screenX(distance_end);      // only one edge found, next edge must be beyond screen      if ((rcd.left == rcd.right) && (p_start == p_end)) {        rcd.right = chart.screenX(chart.getXmax());      }      // Draw the airspace      RenderBox(rcd, brush, settings.black_outline, type);    }  }
开发者ID:pascaltempez,项目名称:xcsoar,代码行数:55,


示例18: setup_outline

 void setup_outline(const AbstractAirspace &airspace) {   if (settings.black_outline)     canvas.SelectBlackPen();   else     canvas.Select(airspace_look.pens[airspace.GetType()]);   canvas.SelectHollowBrush(); }
开发者ID:davidswelt,项目名称:XCSoar,代码行数:7,


示例19:

AirspaceInterceptSolution AirspaceSoonestSort::solve_intercept(const AbstractAirspace &a) const{  const GeoPoint loc = a.closest_point(m_state.Location);  AirspaceInterceptSolution sol;  bool valid = a.intercept(m_state, m_perf, sol, loc, loc);  if (sol.elapsed_time > m_max_time) {    valid = false;  }  if (!valid) {    sol.elapsed_time = -fixed_one;  }  return sol;}
开发者ID:Mrdini,项目名称:XCSoar,代码行数:16,


示例20: closest

 void closest(const AbstractAirspace &as) {   GeoPoint c = as.ClosestPoint(state.location, projection);   if (fout) {     *fout << "# closest point/n";     *fout << c.longitude << " " << c.latitude << " " << "/n";     *fout << state.location.longitude << " " << state.location.latitude << " " << "/n/n";   }   AirspaceInterceptSolution solution;   GeoVector vec(state.location, c);   vec.distance = fixed(20000); // set big distance (for testing)   if (as.Intercept(state, vec.EndPoint(state.location), projection, m_perf, solution)) {     if (fout) {       *fout << "# intercept in " << solution.elapsed_time << " h " << solution.altitude << "/n";     }   } }
开发者ID:Andy-1954,项目名称:XCSoar,代码行数:16,


示例21: operator

  bool operator()(const AbstractAirspace& airspace) const {    // Airspace should be visible or have a warning/inside status    // and airspace needs to be at specified location    return (visible_predicate(airspace) || warnings.Contains(airspace)) &&      airspace.Inside(location);  }
开发者ID:rkohel,项目名称:XCSoar,代码行数:7,


示例22: CalculateSoonestAirspace

static inline SoonestAirspaceCalculateSoonestAirspace(const AircraftState &state,                         const AirspaceAircraftPerformance &perf,                         const double max_time,                         const FlatProjection &projection,                         const AbstractAirspace &airspace){  const auto closest = airspace.ClosestPoint(state.location, projection);  assert(closest.IsValid());  const auto solution = airspace.Intercept(state, perf, closest, closest);  if (!solution.IsValid() ||      solution.elapsed_time > max_time)    return SoonestAirspace();  return SoonestAirspace(airspace, solution.elapsed_time);}
开发者ID:Advi42,项目名称:XCSoar,代码行数:17,


示例23: CheckAirspace

gcc_purestatic boolCheckAirspace(const AbstractAirspace &airspace){  const AirspaceWarningConfig &config =    CommonInterface::GetComputerSettings().airspace.warnings;  return config.IsClassEnabled(airspace.GetType()) && !IsAcked(airspace);}
开发者ID:damianob,项目名称:xcsoar,代码行数:9,


示例24: fixed

AirspaceInterceptSolutionAirspaceSoonestSort::solve_intercept(const AbstractAirspace &a,                                     const TaskProjection &projection) const{  const GeoPoint loc = a.ClosestPoint(m_state.location, projection);  AirspaceInterceptSolution sol =    AirspaceInterceptSolution::Invalid();  bool valid = a.Intercept(m_state, m_perf, sol, loc, loc);  if (sol.elapsed_time > m_max_time) {    valid = false;  }  if (!valid) {    sol.elapsed_time = fixed(-1);  }  return sol;}
开发者ID:Adrien81,项目名称:XCSoar,代码行数:18,


示例25: visit_abstract

  void visit_abstract(const AbstractAirspace &as) {    assert(!m_intersections.empty());    GeoPoint point = m_intersections[0].first;    RouteLink l = rpolar.generate_intermediate(link.first,                                               RoutePoint(proj.project(point), link.second.altitude),                                               proj);    if ((l.second.altitude< (short)as.get_base().Altitude) ||        (l.second.altitude> (short)as.get_top().Altitude))      return;    if (negative(min_distance) || (l.d < min_distance)) {      min_distance = l.d;      nearest = std::make_pair(&as, l.second);    }  }
开发者ID:Mrdini,项目名称:XCSoar,代码行数:18,


示例26: airspace_random_properties

static voidairspace_random_properties(AbstractAirspace& as){    AirspaceClass Type = (AirspaceClass)(rand()%14);    AirspaceAltitude base;    AirspaceAltitude top;    base.altitude = fixed(rand()%4000);    top.altitude = base.altitude+fixed(rand()%3000);    as.SetProperties(_T("hello"), Type, base, top);}
开发者ID:kwtskran,项目名称:XCSoar,代码行数:10,



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


C++ AbstractDistMatrix类代码示例
C++ AboutDialog类代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。