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


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

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


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

示例1: createStart

bool 
AbstractTaskFactory::replace(const OrderedTaskPoint &new_tp,
                             const unsigned position,
                             const bool auto_mutate)
{
  if (auto_mutate) {
    if (validType(new_tp, position))
      // ok to replace directly
      return m_task.replace(new_tp, position);

    // will need to convert type of candidate
    OrderedTaskPoint *tp;
    if (position == 0) {
      // candidate must be transformed into a startpoint
      tp = createStart(new_tp.get_waypoint());
    } else if (is_position_finish(position) && (position + 1 == m_task.task_size())) {
      // this point must be mutated into a finish
      tp = createFinish(new_tp.get_waypoint());
    } else {
      // this point must be mutated into an intermediate
      tp = createIntermediate(new_tp.get_waypoint());
    }

    bool success = m_task.replace(*tp, position);
    delete tp;
    return success;
  }

  return m_task.replace(new_tp, position);
}
开发者ID:Mrdini,项目名称:XCSoar,代码行数:30,代码来源:AbstractTaskFactory.cpp

示例2: tpv

static void
RefreshView()
{
  wTaskView->invalidate();

  OrderedTaskPoint* tp = ordered_task->get_tp(active_index);
  if (!tp)
    return;

  Refreshing = true; // tell onChange routines not to save form!

  TPLabelObservationZone ozv;
  ObservationZoneConstVisitor &visitor = ozv;
  visitor.Visit(*tp->get_oz());

  WndFrame* wfrm = NULL;

  wfrm = ((WndFrame*)wf->FindByName(_T("lblType")));
  if (wfrm)
    wfrm->SetCaption(OrderedTaskPointName(ordered_task->get_factory().getType(*tp)));

  WndButton* wb;
  wb = ((WndButton*)wf->FindByName(_T("butPrevious")));
  if (wb)
    wb->set_enabled(active_index > 0);

  wb = ((WndButton*)wf->FindByName(_T("butNext")));
  if (wb)
    wb->set_enabled(active_index < (ordered_task->task_size() - 1));

  wb = (WndButton*)wf->FindByName(_T("cmdOptionalStarts"));
  assert(wb);
  wb->set_visible(active_index == 0);
  if (ordered_task->optional_start_points_size() == 0)
    wb->SetCaption(_("Enable Alternate Starts"));
  else {
    TCHAR tmp[50];
    _stprintf(tmp, _T("%s (%d)"), _("Edit Alternates"),
        ordered_task->optional_start_points_size());
    wb->SetCaption(tmp);
  }

  EnableSizeEdit(ordered_task->get_factory_type() != TaskBehaviour::FACTORY_FAI_GENERAL);

  TCHAR bufType[100];
  TCHAR bufNamePrefix[100];
  TPLabelTaskPoint tpv(bufType, bufNamePrefix);
  TaskPointConstVisitor &tp_visitor = tpv;
  tp_visitor.Visit(*tp);
  wf->SetCaption(tpv.textType);

  wfrm = ((WndFrame*)wf->FindByName(_T("lblLocation")));
  if (wfrm) {
    TCHAR buff[100];
    _stprintf(buff, _T("%s %s"), tpv.textNamePrefix,
        tp->get_waypoint().Name.c_str());
    wfrm->SetCaption(buff);
  }
  Refreshing = false; // reactivate onChange routines
}
开发者ID:joachimwieland,项目名称:xcsoar-jwieland,代码行数:60,代码来源:dlgTaskPoint.cpp

示例3: append

bool 
AbstractTaskFactory::insert(const OrderedTaskPoint &new_tp,
                            const unsigned position,
                            const bool auto_mutate)
{
  if (position >= m_task.task_size())
    return append(new_tp, auto_mutate);

  if (auto_mutate) {
    if (position == 0) {
      if (m_task.has_start()) {
        // old start must be mutated into an intermediate point
        IntermediateTaskPoint* sp =
            createIntermediate(m_task.getTaskPoint(0)->get_waypoint());
        m_task.replace(*sp, 0);
        delete sp;
      }
      if (validType(new_tp, 0)) {
        return m_task.insert(new_tp, 0);
      } else {
        // candidate must be transformed into a startpoint
        StartPoint* sp = createStart(new_tp.get_waypoint());
        bool success = m_task.insert(*sp, 0);
        delete sp;
        return success;
      }
    } else {
      if (new_tp.is_intermediate()) {
        // candidate ok for direct insertion
        return m_task.insert(new_tp, position);
      } else {
        // candidate must be transformed into a intermediatepoint
        IntermediateTaskPoint* sp = createIntermediate(new_tp.get_waypoint());
        bool success = m_task.insert(*sp, position);
        delete sp;
        return success;
      }
    }
  }

  return m_task.insert(new_tp, position);
}
开发者ID:Mrdini,项目名称:XCSoar,代码行数:42,代码来源:AbstractTaskFactory.cpp


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