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

  return !t.Inside(p1) && !t.Inside(p2);
}
Beispiel #2
0
  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);
  }
Beispiel #3
0
 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))));
 }
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;
  }
}
bool 
AirspacePredicateAircraftInside::operator()(const AbstractAirspace &airspace) const
{
  return airspace.Inside(state);
}
bool
OutsideAirspacePredicate::operator()(const AbstractAirspace &airspace) const
{
  return !airspace.Inside(location);
}
Beispiel #7
0
bool 
AirspacePredicateInside::condition(const AbstractAirspace &airspace) const
{
  return airspace.Inside(location);
}