本文整理汇总了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());
}
示例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);
}
示例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);
}
示例4: assert
void
AirspaceListWidget::OnActivateItem(unsigned i)
{
if (items.empty()) {
assert(i == 0);
return;
}
assert(i < items.size());
dlgAirspaceDetails(items[i].GetAirspace(), airspace_warnings);
}
示例5: assert
static void
OnAirspaceListEnter(unsigned i)
{
if (AirspaceSelectInfo.empty()) {
assert(i == 0);
return;
}
assert(i < AirspaceSelectInfo.size());
dlgAirspaceDetails(*AirspaceSelectInfo[i].airspace, airspace_warnings);
}
示例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);
}
示例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();
}
示例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();
}
示例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();
}
示例10: Visit
virtual void Visit(const AbstractAirspace &as) {
if (filter.Match(location, projection, as))
result.push_back(as);
}
示例11: Visit
void Visit(const AbstractAirspace &as) override {
if (filter.Match(location, projection, as))
result.emplace_back(as);
}