当前位置: 首页>>代码示例>>C++>>正文


C++ TaskPoint类代码示例

本文整理汇总了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);
}
开发者ID:joachimwieland,项目名称:xcsoar-jwieland,代码行数:11,代码来源:TaskSolution.cpp

示例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);
}
开发者ID:davidswelt,项目名称:XCSoar,代码行数:12,代码来源:TaskSolution.cpp

示例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;
        }
    }
开发者ID:j-konopka,项目名称:XCSoar-TE,代码行数:27,代码来源:harness_task.cpp

示例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();
}
开发者ID:DRIZO,项目名称:xcsoar,代码行数:31,代码来源:TaskAdvance.cpp

示例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;
  }
}
开发者ID:damianob,项目名称:xcsoar,代码行数:30,代码来源:TaskPointVisitor.cpp

示例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());
}
开发者ID:davidswelt,项目名称:XCSoar,代码行数:9,代码来源:RenderTaskPoint.cpp

示例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());
}
开发者ID:damianob,项目名称:xcsoar,代码行数:9,代码来源:TaskPointRenderer.cpp

示例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);
  }
开发者ID:galippi,项目名称:xcsoar,代码行数:10,代码来源:MapWindowTask.cpp

示例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);
}
开发者ID:Adrien81,项目名称:XCSoar,代码行数:11,代码来源:TaskMacCreadyTravelled.cpp

示例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;
  }
}
开发者ID:StefanL74,项目名称:XCSoar,代码行数:11,代码来源:TestOrderedTask.cpp

示例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();
}
开发者ID:damianob,项目名称:xcsoar,代码行数:11,代码来源:TaskPointRenderer.cpp

示例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();
}
开发者ID:MindMil,项目名称:XCSoar,代码行数:52,代码来源:SmartTaskAdvance.cpp

示例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;
    }
  }
开发者ID:Advi42,项目名称:XCSoar,代码行数:14,代码来源:WaypointRenderer.cpp

示例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);
}
开发者ID:CnZoom,项目名称:XcSoarPull,代码行数:15,代码来源:TaskMacCreadyRemaining.cpp

示例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;
}
开发者ID:joachimwieland,项目名称:xcsoar-jwieland,代码行数:15,代码来源:TaskAdvanceLegacy.cpp


注:本文中的TaskPoint类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。