本文整理汇总了C++中TaskPoint类的典型用法代码示例。如果您正苦于以下问题:C++ TaskPoint类的具体用法?C++ TaskPoint怎么用?C++ TaskPoint使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TaskPoint类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: gs
GlideResult
TaskSolution::glide_solution_planned(const TaskPoint& taskpoint,
const AIRCRAFT_STATE &ac,
const GlidePolar &polar,
const fixed minH)
{
GlideState gs(taskpoint.get_vector_planned(),
max(minH,taskpoint.get_elevation()),
ac.NavAltitude, ac.wind);
return MacCready::solve(polar, gs);
}
示例2: gs
GlideResult
TaskSolution::GlideSolutionTravelled(const TaskPoint &taskpoint,
const AircraftState &ac,
const GlideSettings &settings,
const GlidePolar &polar,
const fixed min_h)
{
GlideState gs(taskpoint.GetVectorTravelled(),
max(min_h,taskpoint.GetElevation()),
ac.altitude, ac.wind);
return MacCready::Solve(settings, polar, gs);
}
示例3: Visit
virtual void Visit(const TaskPoint& tp) override {
switch (tp.GetType()) {
case TaskPointType::UNORDERED:
printf("# got a tp\n");
break;
case TaskPointType::FINISH:
printf("# got an ftp\n");
ozv.Visit(((const FinishPoint &)tp).GetObservationZone());
break;
case TaskPointType::START:
printf("# got an stp\n");
ozv.Visit(((const StartPoint &)tp).GetObservationZone());
break;
case TaskPointType::AAT:
printf("# got an aat\n");
ozv.Visit(((const AATPoint &)tp).GetObservationZone());
break;
case TaskPointType::AST:
printf("# got an ast\n");
ozv.Visit(((const ASTPoint &)tp).GetObservationZone());
break;
}
}
示例4: switch
bool
TaskAdvance::IsStateReady(const TaskPoint &tp,
const AircraftState &state,
const bool x_enter,
const bool x_exit) const
{
switch (tp.GetType()) {
case TaskPointType::UNORDERED:
gcc_unreachable();
case TaskPointType::START:
return x_exit;
case TaskPointType::AAT: {
const AATPoint &ap = (const AATPoint &)tp;
return IsAATStateReady(ap.HasEntered(), ap.IsCloseToTarget(state));
}
case TaskPointType::AST: {
const ASTPoint &ip = (const ASTPoint &)tp;
return ip.GetScoreExit()
? x_exit
: ip.HasEntered();
}
case TaskPointType::FINISH:
return false;
}
gcc_unreachable();
}
示例5: switch
void
TaskPointConstVisitor::Visit(const TaskPoint &tp)
{
switch (tp.GetType()) {
case TaskPoint::ROUTE:
assert(1); // not supported yet
break;
case TaskPoint::UNORDERED:
Visit((const UnorderedTaskPoint &)tp);
break;
case TaskPoint::START:
Visit((const StartPoint &)tp);
break;
case TaskPoint::AST:
Visit((const ASTPoint &)tp);
break;
case TaskPoint::AAT:
Visit((const AATPoint &)tp);
break;
case TaskPoint::FINISH:
Visit((const FinishPoint &)tp);
break;
}
}
示例6:
void
RenderTaskPoint::DrawBearing(const TaskPoint &tp)
{
if (!draw_bearing || !PointCurrent())
return;
canvas.Select(task_look.bearing_pen);
map_canvas.offset_line(location, tp.GetLocationRemaining());
}
示例7:
void
TaskPointRenderer::DrawBearing(const TaskPoint &tp)
{
if (!location_available || !draw_bearing || !PointCurrent())
return;
canvas.Select(task_look.bearing_pen);
map_canvas.DrawLineWithOffset(location, tp.GetLocationRemaining());
}
示例8: draw_target
void
draw_target(const TaskPoint &tp)
{
if (!do_draw_target(tp))
return;
RasterPoint sc;
if (m_proj.GeoToScreenIfVisible(tp.get_location_remaining(), sc))
Graphics::hBmpTarget.draw(canvas, sc.x, sc.y);
}
示例9: assert
GlideResult
TaskMacCreadyTravelled::SolvePoint(const TaskPoint &tp,
const AircraftState &aircraft,
fixed minH) const
{
assert(tp.GetType() != TaskPointType::UNORDERED);
const OrderedTaskPoint &otp = (const OrderedTaskPoint &)tp;
return TaskSolution::GlideSolutionTravelled(otp, aircraft,
settings, glide_polar, minH);
}
示例10: GetSafetyHeight
static fixed
GetSafetyHeight(const TaskPoint &tp)
{
switch (tp.GetType()) {
case TaskPointType::FINISH:
return task_behaviour.safety_height_arrival;
default:
return task_behaviour.route_planner.safety_height_terrain;
}
}
示例11: PointCurrent
bool
TaskPointRenderer::IsTargetVisible(const TaskPoint &tp) const
{
if (!tp.HasTarget() || target_visibility == NONE)
return false;
if (target_visibility == ALL)
return true;
return PointCurrent();
}
示例12: IsStateReady
bool
SmartTaskAdvance::CheckReadyToAdvance(const TaskPoint &tp,
const AircraftState &aircraft,
const bool x_enter, const bool x_exit)
{
const bool state_ready = IsStateReady(tp, aircraft, x_enter, x_exit);
if (armed)
request_armed = false;
switch (tp.GetType()) {
case TaskPointType::UNORDERED:
gcc_unreachable();
case TaskPointType::START: {
const StartPoint &sp = (const StartPoint &)tp;
if (sp.DoesRequireArm()) {
if (armed) {
state = TaskAdvance::START_ARMED;
} else {
state = TaskAdvance::START_DISARMED;
if (sp.IsInSector(aircraft))
request_armed = true;
}
return armed && state_ready;
} else {
state = TaskAdvance::AUTO;
return state_ready;
}
}
case TaskPointType::AAT:
if (armed) {
state = TaskAdvance::TURN_ARMED;
} else {
state = TaskAdvance::TURN_DISARMED;
if (state_ready)
request_armed = true;
}
return armed && state_ready;
case TaskPointType::AST: {
state = TaskAdvance::AUTO;
return state_ready;
}
case TaskPointType::FINISH:
return false;
}
gcc_unreachable();
}
示例13: Visit
void Visit(const TaskPoint &tp) override {
switch (tp.GetType()) {
case TaskPointType::UNORDERED:
AddWaypoint(((const UnorderedTaskPoint &)tp).GetWaypointPtr(), true);
break;
case TaskPointType::START:
case TaskPointType::AST:
case TaskPointType::AAT:
case TaskPointType::FINISH:
AddWaypoint(((const OrderedTaskPoint &)tp).GetWaypointPtr(), true);
break;
}
}
示例14: Solve
GlideResult
TaskMacCreadyRemaining::SolvePoint(const TaskPoint &tp,
const AircraftState &aircraft,
fixed minH) const
{
GlideState gs = GlideState::Remaining(tp, aircraft, minH);
if (!include_travel_to_start && active_index == 0 &&
tp.GetType() == TaskPointType::START &&
!((const OrderedTaskPoint &)tp).HasEntered())
/* ignore the travel to the start point */
gs.vector.distance = fixed(0);
return MacCready::Solve(settings, glide_polar, gs);
}
示例15: switch
bool
TaskAdvanceLegacy::mode_ready(const TaskPoint &tp) const
{
switch (mode) {
case ADVANCE_MANUAL:
return false;
case ADVANCE_AUTO:
return true;
case ADVANCE_ARM:
return m_armed;
case ADVANCE_ARMSTART:
return m_armed || tp.GetType() != TaskPoint::START;
};
return false;
}