本文整理汇总了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);
}
示例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
}
示例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);
}