本文整理汇总了C++中OrderedTask::UpdateGeometry方法的典型用法代码示例。如果您正苦于以下问题:C++ OrderedTask::UpdateGeometry方法的具体用法?C++ OrderedTask::UpdateGeometry怎么用?C++ OrderedTask::UpdateGeometry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OrderedTask
的用法示例。
在下文中一共展示了OrderedTask::UpdateGeometry方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char **argv)
{
Args args(argc, argv, "TASKFILE REPLAYFILE");
const auto task_path = args.ExpectNextPath();
DebugReplay *replay = CreateDebugReplay(args);
if (replay == NULL)
return EXIT_FAILURE;
args.ExpectEnd();
TaskBehaviour task_behaviour;
task_behaviour.SetDefaults();
OrderedTask *task = TaskFile::GetTask(task_path, task_behaviour,
NULL, 0);
if (task == NULL) {
fprintf(stderr, "Failed to load task\n");
return EXIT_FAILURE;
}
task->UpdateGeometry();
const GlidePolar glide_polar(1);
Run(*replay, *task, glide_polar);
delete task;
delete replay;
return EXIT_SUCCESS;
}
示例2: RefreshView
void
TaskEditPanel::OnMakeFinish()
{
ordered_task->UpdateStatsGeometry();
if (ordered_task->GetFactory().CheckAddFinish())
ordered_task->UpdateGeometry();
RefreshView();
}
示例3: GetList
void
TaskEditPanel::MoveDown()
{
unsigned index = GetList().GetCursorIndex();
if (index >= ordered_task->TaskSize())
return;
if (!ordered_task->GetFactory().Swap(index, true))
return;
GetList().SetCursorIndex(index + 1);
*task_modified = true;
ordered_task->ClearName();
ordered_task->UpdateGeometry();
RefreshView();
}
示例4: LoadTask
static OrderedTask *
LoadTask2(const TCHAR *path, const TaskBehaviour &task_behaviour)
{
OrderedTask *task = LoadTask(path, task_behaviour);
if (task == nullptr) {
fprintf(stderr, "Failed to parse XML\n");
return nullptr;
}
task->UpdateGeometry();
if (!task->CheckTask()) {
fprintf(stderr, "Failed to load task from XML\n");
delete task;
return NULL;
}
return task;
}
示例5: ReverseTask
void TaskEditPanel::ReverseTask()
{
if (ordered_task->TaskSize() < 2)
return;
const unsigned start_index = 0;
const unsigned finish_index = ordered_task->TaskSize() - 1;
const Waypoint start_wp = ordered_task->GetTaskPoint(start_index).GetWaypoint();
const Waypoint finish_wp = ordered_task->GetTaskPoint(finish_index).GetWaypoint();
if (start_wp.location != finish_wp.location) {
// swap start/finish TP if at different location but leave OZ type intact
ordered_task->Relocate(start_index, finish_wp);
ordered_task->Relocate(finish_index, start_wp);
// remove optional start points
while (ordered_task->HasOptionalStarts())
ordered_task->RemoveOptionalStart(0);
}
// reverse intermediate TPs order keeping the OZ type with the respective TP
unsigned length = ordered_task->TaskSize()-1;
for (unsigned i = 1; i < length - 1; ++i) {
const OrderedTaskPoint &otp = ordered_task->GetTaskPoint(length - 1);
if (!ordered_task->GetFactory().Insert(otp, i, false))
return;
if (!ordered_task->GetFactory().Remove(length, false))
return;
}
*task_modified = true;
ordered_task->ClearName();
ordered_task->GetFactory().CheckAddFinish();
ordered_task->UpdateStatsGeometry();
ordered_task->UpdateGeometry();
RefreshView();
}