本文整理汇总了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;
}
示例2: AddCircle
void
AddCircle(Airspaces &airspace_database)
{
AbstractAirspace *as = new AirspaceCircle(Center, Radius);
as->set_properties(Name, Type, Base, Top);
airspace_database.insert(as);
}
示例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;
}
}
示例4:
bool
AirspacePredicateHeightRangeExcludeTwo::operator()(const AbstractAirspace& t) const
{
if (!check_height(t))
return false;
return !t.inside(p1) && !t.inside(p2);
}
示例5: AddPolygon
void
AddPolygon(Airspaces &airspace_database)
{
AbstractAirspace *as = new AirspacePolygon(points);
as->set_properties(Name, Type, Base, Top);
airspace_database.insert(as);
}
示例6:
bool
AirspacePredicateHeightRangeExcludeTwo::condition(const AbstractAirspace& t) const
{
if (!check_height(t))
return false;
return !t.Inside(p1) && !t.Inside(p2);
}
示例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))));
}
示例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
}
}
示例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);
}
示例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);
}
示例11: Visit
void Visit(const AbstractAirspace &as) {
if (do_report) {
*fout << as;
*fout << "# Name: " << as.GetName()
<< "Base: " << as.GetBase()
<< " Top: " << as.GetTop()
<< "\n";
}
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
}