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


C++ AirspaceSelectInfoVector类代码示例

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


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

示例1:

void
AirspaceSorter::filter_name(AirspaceSelectInfoVector& vec,
                            const unsigned char c) const
{
  MatchChar = c;
  vec.erase(std::remove_if(vec.begin(), vec.end(), AirspaceNameFilter), vec.end());
}
开发者ID:Plantain,项目名称:XCSoar,代码行数:7,代码来源:AirspaceSorter.cpp

示例2: SortByName

static void
SortByName(AirspaceSelectInfoVector &vec)
{
  auto compare = [&] (const AirspaceSelectInfo &elem1,
                      const AirspaceSelectInfo &elem2) {
    return StringCollate(elem1.GetAirspace().GetName(),
                         elem2.GetAirspace().GetName()) < 0;
  };

  std::sort(vec.begin(), vec.end(), compare);
}
开发者ID:ThomasXBMC,项目名称:XCSoar,代码行数:11,代码来源:AirspaceSorter.cpp

示例3: SortByDistance

static void
SortByDistance(AirspaceSelectInfoVector &vec, const GeoPoint &location,
               const FlatProjection &projection)
{
  auto compare = [&] (const AirspaceSelectInfo &elem1,
                      const AirspaceSelectInfo &elem2) {
    return elem1.GetVector(location, projection).distance <
           elem2.GetVector(location, projection).distance;
  };

  std::sort(vec.begin(), vec.end(), compare);
}
开发者ID:ThomasXBMC,项目名称:XCSoar,代码行数:12,代码来源:AirspaceSorter.cpp

示例4: assert

void
AirspaceListWidget::OnActivateItem(unsigned i)
{
  if (items.empty()) {
    assert(i == 0);
    return;
  }

  assert(i < items.size());

  dlgAirspaceDetails(items[i].GetAirspace(), airspace_warnings);
}
开发者ID:robertscottbeattie,项目名称:xcsoardev,代码行数:12,代码来源:AirspaceList.cpp

示例5: assert

static void
OnAirspaceListEnter(unsigned i)
{
    if (AirspaceSelectInfo.empty()) {
        assert(i == 0);
        return;
    }

    assert(i < AirspaceSelectInfo.size());

    dlgAirspaceDetails(*AirspaceSelectInfo[i].airspace, airspace_warnings);
}
开发者ID:davidswelt,项目名称:XCSoar,代码行数:12,代码来源:dlgAirspaceSelect.cpp

示例6: assert

void
AirspaceListDialog::OnActivateItem(unsigned i)
{
  if (airspace_list.empty()) {
    assert(i == 0);
    return;
  }

  assert(i < airspace_list.size());

  dlgAirspaceDetails(airspace_list[i].GetAirspace(), airspace_warnings);
}
开发者ID:henrik1g,项目名称:XCSoar,代码行数:12,代码来源:AirspaceList.cpp

示例7: FilterAirspaces

static void
UpdateList()
{
  AirspaceFilterData data;
  data.Clear();

  if (dialog_state.type != WILDCARD)
    data.cls = (AirspaceClass)dialog_state.type;

  const TCHAR *name_filter = name_control->GetDataField()->GetAsString();
  if (!StringIsEmpty(name_filter))
    data.name_prefix = name_filter;

  if (dialog_state.direction != WILDCARD) {
    data.direction = dialog_state.direction == 0
      ? CommonInterface::Basic().attitude.heading
      : Angle::Degrees(dialog_state.direction);
  }

  if (positive(dialog_state.distance))
    data.distance = dialog_state.distance;

  airspace_list = FilterAirspaces(*airspaces,
                                  CommonInterface::Basic().location,
                                  data);

  airspace_list_control->SetLength(std::max((size_t)1, airspace_list.size()));
  airspace_list_control->Invalidate();
}
开发者ID:henrik1g,项目名称:XCSoar,代码行数:29,代码来源:AirspaceList.cpp

示例8: FilterAirspaces

void
AirspaceListWidget::UpdateList()
{
  AirspaceFilterData data;
  data.Clear();

  if (dialog_state.type != WILDCARD)
    data.cls = (AirspaceClass)dialog_state.type;

  const TCHAR *name_filter = filter_widget.GetValueString(NAME);
  if (!StringIsEmpty(name_filter))
    data.name_prefix = name_filter;

  if (dialog_state.direction != WILDCARD) {
    data.direction = dialog_state.direction == 0
      ? CommonInterface::Basic().attitude.heading
      : Angle::Degrees(dialog_state.direction);
  }

  if (positive(dialog_state.distance))
    data.distance = dialog_state.distance;

  items = FilterAirspaces(*airspaces,
                          CommonInterface::Basic().location,
                          data);

  GetList().SetLength(std::max((size_t)1, items.size()));
  GetList().Invalidate();
}
开发者ID:robertscottbeattie,项目名称:xcsoardev,代码行数:29,代码来源:AirspaceList.cpp

示例9: UpdateList

static void UpdateList()
{
    AirspaceSelectInfo = airspace_sorter->get_list();

    if (TypeFilterIdx != WILDCARD)
        airspace_sorter->filter_class(AirspaceSelectInfo, (AirspaceClass)TypeFilterIdx);

    bool sort_distance = false;
    if (positive(distance_filter)) {
        sort_distance = true;
        airspace_sorter->filter_distance(AirspaceSelectInfo, distance_filter);
    }
    if (direction_filter != WILDCARD) {
        sort_distance = true;
        Angle a = direction_filter == 0
                  ? CommonInterface::Calculated().heading
                  : Angle::Degrees(fixed(direction_filter));
        airspace_sorter->filter_direction(AirspaceSelectInfo, a);
    }
    if (sort_distance) {
        airspace_sorter->sort_distance(AirspaceSelectInfo);
    }

    const TCHAR *name_filter = wpName->GetDataField()->GetAsString();
    if (!StringIsEmpty(name_filter))
        airspace_sorter->FilterNamePrefix(AirspaceSelectInfo, name_filter);

    wAirspaceList->SetLength(max((size_t)1, AirspaceSelectInfo.size()));
    wAirspaceList->invalidate();
}
开发者ID:davidswelt,项目名称:XCSoar,代码行数:30,代码来源:dlgAirspaceSelect.cpp

示例10: Visit

 virtual void Visit(const AbstractAirspace &as) {
   if (filter.Match(location, projection, as))
     result.push_back(as);
 }
开发者ID:StefanL74,项目名称:XCSoar,代码行数:4,代码来源:AirspaceSorter.cpp

示例11: Visit

 void Visit(const AbstractAirspace &as) override {
   if (filter.Match(location, projection, as))
     result.emplace_back(as);
 }
开发者ID:ThomasXBMC,项目名称:XCSoar,代码行数:4,代码来源:AirspaceSorter.cpp


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