本文整理汇总了C++中AbstractAirspace::intercept方法的典型用法代码示例。如果您正苦于以下问题:C++ AbstractAirspace::intercept方法的具体用法?C++ AbstractAirspace::intercept怎么用?C++ AbstractAirspace::intercept使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AbstractAirspace
的用法示例。
在下文中一共展示了AbstractAirspace::intercept方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
AirspaceInterceptSolution
AirspaceSoonestSort::solve_intercept(const AbstractAirspace &a) const
{
const GeoPoint loc = a.closest_point(m_state.Location);
AirspaceInterceptSolution sol;
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_one;
}
return sol;
}
示例2: closest
virtual void closest(const AbstractAirspace& as) {
GeoPoint c = as.closest_point(state.Location);
#ifdef DO_PRINT
*fout << "# closest point\n";
*fout << c.Longitude << " " << c.Latitude << " " << "\n";
*fout << state.Location.Longitude << " " << state.Location.Latitude << " " << "\n\n";
#endif
AirspaceInterceptSolution solution;
GeoVector vec(state.Location, c);
vec.Distance = fixed(20000); // set big distance (for testing)
if (as.intercept(state, vec, m_perf, solution)) {
#ifdef DO_PRINT
*fout << "# intercept in " << solution.elapsed_time << " h " << solution.altitude << "\n";
#endif
}
}
示例3:
AirspaceInterceptSolution
AirspaceIntersectionVisitor::intercept(const AbstractAirspace& as,
const AIRCRAFT_STATE& state,
const AirspaceAircraftPerformance &perf,
bool all) const
{
AirspaceInterceptSolution solution;
if (m_intersections.empty()) {
return solution;
}
for (AirspaceIntersectionVector::const_iterator it = m_intersections.begin();
it != m_intersections.end(); ++it) {
as.intercept(state, perf, solution, it->first, it->second);
if (!all) {
return solution;
}
}
return solution;
}