本文整理汇总了C++中AbstractAirspace::Intercept方法的典型用法代码示例。如果您正苦于以下问题:C++ AbstractAirspace::Intercept方法的具体用法?C++ AbstractAirspace::Intercept怎么用?C++ AbstractAirspace::Intercept使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AbstractAirspace
的用法示例。
在下文中一共展示了AbstractAirspace::Intercept方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
}
示例2: Invalid
AirspaceInterceptSolution
AirspaceIntersectionVisitor::Intercept(const AbstractAirspace &as,
const AircraftState &state,
const AirspaceAircraftPerformance &perf) const
{
if (intersections.empty())
return AirspaceInterceptSolution::Invalid();
AirspaceInterceptSolution solution;
for (const auto &i : intersections)
as.Intercept(state, perf, solution, i.first, i.second);
return solution;
}
示例3: 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";
}
}
}
示例4: SoonestAirspace
static inline SoonestAirspace
CalculateSoonestAirspace(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);
}
示例5: fixed
AirspaceInterceptSolution
AirspaceSoonestSort::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;
}