本文整理汇总了C++中Group::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ Group::Clear方法的具体用法?C++ Group::Clear怎么用?C++ Group::Clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Group
的用法示例。
在下文中一共展示了Group::Clear方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PopOntoCurrentFrom
void SolveSpaceUI::PopOntoCurrentFrom(UndoStack *uk) {
int i;
ssassert(uk->cnt > 0, "Cannot pop from empty undo stack");
(uk->cnt)--;
uk->write = WRAP(uk->write - 1, MAX_UNDO);
UndoState *ut = &(uk->d[uk->write]);
// Free everything in the main copy of the program before replacing it
for(i = 0; i < SK.groupOrder.n; i++) {
Group *g = SK.GetGroup(SK.groupOrder.elem[i]);
g->Clear();
}
SK.group.Clear();
SK.groupOrder.Clear();
SK.request.Clear();
SK.constraint.Clear();
SK.param.Clear();
SK.style.Clear();
// And then do a shallow copy of the state from the undo list
ut->group.MoveSelfInto(&(SK.group));
for(i = 0; i < ut->groupOrder.n; i++)
SK.groupOrder.Add(&ut->groupOrder.elem[i]);
ut->request.MoveSelfInto(&(SK.request));
ut->constraint.MoveSelfInto(&(SK.constraint));
ut->param.MoveSelfInto(&(SK.param));
ut->style.MoveSelfInto(&(SK.style));
SS.GW.activeGroup = ut->activeGroup;
// No need to free it, since a shallow copy was made above
*ut = {};
// And reset the state everywhere else in the program, since the
// sketch just changed a lot.
SS.GW.ClearSuper();
SS.TW.ClearSuper();
SS.ReloadAllImported();
SS.GenerateAll(SolveSpaceUI::Generate::ALL);
SS.ScheduleShowTW();
// Activate the group that was active before.
Group *activeGroup = SK.GetGroup(SS.GW.activeGroup);
activeGroup->Activate();
}
示例2: ClearExisting
//-----------------------------------------------------------------------------
// Clear and free all the dynamic memory associated with our currently-loaded
// sketch. This does not leave the program in an acceptable state (with the
// references created, and so on), so anyone calling this must fix that later.
//-----------------------------------------------------------------------------
void SolveSpace::ClearExisting(void) {
UndoClearStack(&redo);
UndoClearStack(&undo);
Group *g;
for(g = SK.group.First(); g; g = SK.group.NextAfter(g)) {
g->Clear();
}
SK.constraint.Clear();
SK.request.Clear();
SK.group.Clear();
SK.style.Clear();
SK.entity.Clear();
SK.param.Clear();
}
示例3: ClearExisting
//-----------------------------------------------------------------------------
// Clear and free all the dynamic memory associated with our currently-loaded
// sketch. This does not leave the program in an acceptable state (with the
// references created, and so on), so anyone calling this must fix that later.
//-----------------------------------------------------------------------------
void SolveSpaceUI::ClearExisting(void) {
UndoClearStack(&redo);
UndoClearStack(&undo);
for(int i = 0; i < SK.groupOrder.n; i++) {
Group *g = SK.GetGroup(SK.groupOrder.elem[i]);
g->Clear();
}
SK.constraint.Clear();
SK.request.Clear();
SK.group.Clear();
SK.groupOrder.Clear();
SK.style.Clear();
SK.entity.Clear();
SK.param.Clear();
}