本文整理汇总了C++中Selection::Remove方法的典型用法代码示例。如果您正苦于以下问题:C++ Selection::Remove方法的具体用法?C++ Selection::Remove怎么用?C++ Selection::Remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Selection
的用法示例。
在下文中一共展示了Selection::Remove方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateManipulator
Manipulator* ScaleTool::CreateManipulator (
Viewer* v, Event& e, Transformer* rel
) {
GraphicView* views = v->GetGraphicView();
Selection* s = v->GetSelection(), *newSel;
GraphicView* gv;
Manipulator* m = nil;
Iterator i;
newSel = views->ViewIntersecting(e.x-SLOP, e.y-SLOP, e.x+SLOP, e.y+SLOP);
if (newSel->IsEmpty()) {
s->Clear();
} else {
newSel->First(i);
gv = newSel->GetView(i);
if (s->Includes(gv)) {
s->Remove(gv);
s->Prepend(gv);
} else {
s->Clear();
s->Append(gv);
s->Update();
}
m = gv->CreateManipulator(v, e, rel, this);
}
delete newSel;
return m;
}
示例2: Reserve
void LinkSelection::Reserve() {
#if 0
fprintf(stderr, "LinkSelection::Reserve\n");
#endif
CompIdTable* table = ((DrawServ*)unidraw)->compidtable();
/* clear anything that was in the previous selection, but not in this one */
Selection* lastsel = _editor->last_selection();
if (!lastsel) return;
Iterator lt;
lastsel->First(lt);
Iterator it;
while (!lastsel->Done(lt)) {
First(it);
boolean match = false;
while (!Done(it) && !match) {
if(GetView(it)==lastsel->GetView(lt))
match = true;
else
Next(it);
}
if (!match) {
OverlayComp* comp = ((OverlayView*)lastsel->GetView(lt))->GetOverlayComp();
void* ptr = nil;
table->find(ptr, (void*)comp);
if (ptr) {
GraphicId* grid = (GraphicId*)ptr;
grid->selected(NotSelected);
((DrawServ*)unidraw)->grid_message(grid);
}
}
lastsel->Remove(lt);
}
/* remove anything from selection that has a remote selector */
First(it);
while (!Done(it)) {
int removed = false;
OverlayView* view = GetView(it);
OverlayComp* comp = view ? view->GetOverlayComp() : nil;
void* ptr = nil;
table->find(ptr, (void*)comp);
if (ptr) {
GraphicId* grid = (GraphicId*)ptr;
if (grid->selector() &&
((DrawServ*)unidraw)->sessionid()!=grid->selector()) {
Remove(it);
removed = true;
if (grid->selected()==NotSelected) {
/* make a request to select this in the future */
grid->selected(WaitingToBeSelected);
((DrawServ*)unidraw)->grid_message(grid);
}
} else {
if (grid->selected()!=LocallySelected) {
grid->selected(LocallySelected);
((DrawServ*)unidraw)->grid_message(grid);
}
}
}
if (!removed)
Next(it);
}
/* store copy of selection */
First(it);
while (!Done(it)) {
lastsel->Append(GetView(it));
Next(it);
}
}