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


C++ OrderedTaskPoint::update_oz方法代码示例

本文整理汇总了C++中OrderedTaskPoint::update_oz方法的典型用法代码示例。如果您正苦于以下问题:C++ OrderedTaskPoint::update_oz方法的具体用法?C++ OrderedTaskPoint::update_oz怎么用?C++ OrderedTaskPoint::update_oz使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OrderedTaskPoint的用法示例。


在下文中一共展示了OrderedTaskPoint::update_oz方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: test_task_aat

bool test_task_aat(TaskManager& task_manager,
                   const Waypoints &waypoints)
{
  const TaskProjection &projection =
    task_manager.get_ordered_task().get_task_projection();

  task_manager.set_factory(OrderedTask::FACTORY_AAT);
  AbstractTaskFactory &fact = task_manager.get_factory();
  const Waypoint *wp;

  task_report(task_manager, "# adding start\n");
  wp = waypoints.lookup_id(1);
  if (wp) {
    if (!fact.append(fact.createStart(*wp),false)) {
      return false;
    }
  }

  task_manager.setActiveTaskPoint(0);
  task_manager.resume();

  task_report(task_manager, "# adding intermediate\n");
  wp = waypoints.lookup_id(2);
  if (wp) {
    OrderedTaskPoint* tp = fact.createIntermediate(AbstractTaskFactory::AAT_CYLINDER,*wp);
    if (tp->get_oz()->shape == ObservationZonePoint::CYLINDER) {
      CylinderZone *cz = (CylinderZone *)tp->get_oz();
      cz->setRadius(fixed(30000.0));
      tp->update_oz(projection);
    }
    if (!fact.append(tp,false)) {
      return false;
    }
  }

  task_report(task_manager, "# adding intermediate\n");
  wp = waypoints.lookup_id(3);
  if (wp) {
    OrderedTaskPoint* tp = fact.createIntermediate(AbstractTaskFactory::AAT_CYLINDER,*wp);
    if (tp->get_oz()->shape == ObservationZonePoint::CYLINDER) {
      CylinderZone *cz = (CylinderZone *)tp->get_oz();
      cz->setRadius(fixed(40000.0));
      tp->update_oz(projection);
    }
    if (!fact.append(tp,false)) {
      return false;
    }
  }

  task_report(task_manager, "# adding finish\n");
  wp = waypoints.lookup_id(1);
  if (wp) {
    if (!fact.append(fact.createFinish(*wp),false)) {
      return false;
    }
  }

  task_report(task_manager, "# checking task..\n");
  if (!fact.validate()) {
    return false;
  }

  if (!task_manager.check_ordered_task()) {
    return false;
  }
  return true;
}
开发者ID:galippi,项目名称:xcsoar,代码行数:67,代码来源:harness_task.cpp

示例2: test_task_mixed

bool test_task_mixed(TaskManager& task_manager,
                     const Waypoints &waypoints)
{
  const TaskProjection &projection =
    task_manager.get_ordered_task().get_task_projection();

  OrderedTaskPoint *tp;
  const Waypoint *wp;

  task_manager.set_factory(TaskBehaviour::FACTORY_MIXED);
  AbstractTaskFactory &fact = task_manager.get_factory();

  task_report(task_manager, "# adding start\n");
  wp = waypoints.lookup_id(1);
  if (wp) {
    tp = fact.createStart(AbstractTaskFactory::START_LINE,*wp);
    if (tp->get_oz()->shape == ObservationZonePoint::CYLINDER) {
      CylinderZone *cz = (CylinderZone *)tp->get_oz();
      cz->setRadius(fixed(5000.0));
      tp->update_oz(projection);
    }
    if (!fact.append(*tp,false)) return false;
    delete tp;
  } else {
    return false;
  }

  task_manager.setActiveTaskPoint(0);
  task_manager.resume();

  task_report(task_manager, "# adding intermdiate\n");
  wp = waypoints.lookup_id(2);
  if (wp) {
    tp = fact.createIntermediate(AbstractTaskFactory::AST_CYLINDER,*wp);
    if (!fact.append(*tp,false)) return false;
    delete tp;
  } else {
    return false;
  }

  task_report(task_manager, "# adding intermdiate\n");
  wp = waypoints.lookup_id(3);
  if (wp) {
    tp = fact.createIntermediate(AbstractTaskFactory::AAT_CYLINDER,*wp);
    if (tp->get_oz()->shape == ObservationZonePoint::CYLINDER) {
      CylinderZone *cz = (CylinderZone *)tp->get_oz();
      cz->setRadius(fixed(30000.0));
      tp->update_oz(projection);
    }
    if (!fact.append(*tp,false)) return false;
    delete tp;
  } else {
    return false;
  }

  task_report(task_manager, "# adding intermediate\n");
  wp = waypoints.lookup_id(4);
  if (wp) {
    tp = fact.createIntermediate(AbstractTaskFactory::AAT_CYLINDER,*wp);
    if (!fact.append(*tp,false)) return false;
    delete tp;
  } else {
    return false;
  }

  task_report(task_manager, "# adding intermediate\n");
  wp = waypoints.lookup_id(5);
  if (wp) {
    tp = fact.createIntermediate(AbstractTaskFactory::AAT_CYLINDER,*wp);
    if (tp->get_oz()->shape == ObservationZonePoint::CYLINDER) {
      CylinderZone *cz = (CylinderZone *)tp->get_oz();
      cz->setRadius(fixed(30000.0));
      tp->update_oz(projection);
    }
    if (!fact.append(*tp,false)) return false;
    delete tp;
  } else {
    return false;
  }

  task_report(task_manager, "# adding finish\n");
  wp = waypoints.lookup_id(1);
  if (wp) {
    tp = fact.createFinish(AbstractTaskFactory::FINISH_LINE,*wp);
    if (!fact.append(*tp,false)) return false;
    delete tp;
  } else {
    return false;
  }

  task_report(task_manager, "# checking task\n");
  if (!fact.validate()) {
    return false;
  }

  if (!task_manager.check_ordered_task()) {
    return false;
  }
  return true;
}
开发者ID:joachimwieland,项目名称:xcsoar-jwieland,代码行数:100,代码来源:harness_task.cpp


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