本文整理汇总了C++中DistanceStat::SetDistance方法的典型用法代码示例。如果您正苦于以下问题:C++ DistanceStat::SetDistance方法的具体用法?C++ DistanceStat::SetDistance怎么用?C++ DistanceStat::SetDistance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DistanceStat
的用法示例。
在下文中一共展示了DistanceStat::SetDistance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tm
void
OrderedTask::GlideSolutionPlanned(const AircraftState &aircraft,
const GlidePolar &glide_polar,
GlideResult &total,
GlideResult &leg,
DistanceStat &total_remaining_effective,
DistanceStat &leg_remaining_effective,
const GlideResult &solution_remaining_total,
const GlideResult &solution_remaining_leg)
{
TaskMacCreadyTotal tm(task_points, active_task_point,
task_behaviour.glide, glide_polar);
total = tm.glide_solution(aircraft);
leg = tm.get_active_solution();
if (solution_remaining_total.IsOk())
total_remaining_effective.SetDistance(tm.effective_distance(solution_remaining_total.time_elapsed));
else
total_remaining_effective.Reset();
if (solution_remaining_leg.IsOk())
leg_remaining_effective.SetDistance(tm.effective_leg_distance(solution_remaining_leg.time_elapsed));
else
leg_remaining_effective.Reset();
}
示例2:
static void
Copy(DistanceStat &stat, const GlideResult &solution)
{
if (solution.IsDefined())
stat.SetDistance(solution.vector.distance);
else
stat.Reset();
}
示例3:
void
UnorderedTask::GlideSolutionPlanned(const AircraftState &state,
const GlidePolar &glide_polar,
GlideResult &total,
GlideResult &leg,
DistanceStat &total_remaining_effective,
DistanceStat &leg_remaining_effective,
const GlideResult &solution_remaining_total,
const GlideResult &solution_remaining_leg)
{
total = solution_remaining_total;
leg = solution_remaining_leg;
if (total.IsOk())
total_remaining_effective.SetDistance(total.vector.distance);
else
total_remaining_effective.Reset();
if (leg.IsOk())
leg_remaining_effective.SetDistance(leg.vector.distance);
else
leg_remaining_effective.Reset();
}