本文整理汇总了C++中Selection::Number方法的典型用法代码示例。如果您正苦于以下问题:C++ Selection::Number方法的具体用法?C++ Selection::Number怎么用?C++ Selection::Number使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Selection
的用法示例。
在下文中一共展示了Selection::Number方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateManipulator
Manipulator* MoveTool::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->Clear();
s->Append(gv);
s->Update();
}
if (s->Number() > 1) {
m = gv->GraphicView::CreateManipulator(v, e, rel, this);
} else {
m = gv->CreateManipulator(v, e, rel, this);
}
}
delete newSel;
return m;
}
示例2: CreateManipulator
Manipulator* AttributeTool::CreateManipulator (
Viewer* v, Event& e, Transformer* rel
) {
Manipulator* m = nil;
GraphicView* views = v->GetGraphicView();
Selection* s = v->GetSelection(), *newSel;
newSel = views->ViewIntersecting(e.x-SLOP, e.y-SLOP, e.x+SLOP, e.y+SLOP);
if (e.shift) {
Localize(s, v);
} else {
s->Clear();
}
if (newSel->IsEmpty()) { // do nothing
} else { // else user selected object directly
s->Exclusive(newSel);
}
delete newSel;
if (s->Number() == 1) {
Iterator i;
s->First(i);
GraphicView* view = s->GetView(i);
if (view->IsA(OVERLAY_VIEW)) {
((OverlayEditor*)v->GetEditor())->MouseDocObservable()->textvalue("");
((OverlayEditor*)v->GetEditor())->AttrEdit(((OverlayView*)view)->GetOverlayComp());
((OverlayEditor*)v->GetEditor())->MouseDocObservable()->textvalue(OverlayKit::mouse_attr);
}
}
return m;
}
示例3: InterpretManipulator
Command* MoveTool::InterpretManipulator (Manipulator* m) {
Selection* s;
Command* cmd = nil;
Iterator i;
GraphicView* gv;
if (m != nil) {
s = m->GetViewer()->GetSelection();
s->First(i);
gv = s->GetView(i);
if (s->Number() > 1) {
cmd = gv->GraphicView::InterpretManipulator(m);
} else {
cmd = gv->InterpretManipulator(m);
}
}
return cmd;
}
示例4: Execute
void GroupCmd::Execute () {
Clipboard* cb = GetClipboard();
if (cb == nil) {
SetClipboard(cb = new Clipboard);
Editor* ed = GetEditor();
Selection* s = ed->GetSelection();
if (s->Number() > 1) {
Iterator i;
GraphicView* views = ed->GetViewer()->GetGraphicView();
s->Sort(views);
for (s->First(i); !s->Done(i); s->Next(i)) {
s->GetView(i)->Interpret(this);
}
}
} else {
Clipboard* oldcb = cb;
SetClipboard(cb = new Clipboard);
Iterator i;
for (oldcb->First(i); !oldcb->Done(i); oldcb->Next(i)) {
oldcb->GetComp(i)->Interpret(this);
}
delete oldcb;
}
if (!cb->IsEmpty()) {
if (_group == nil) {
SetGroup(new GraphicComps);
}
_group->Interpret(this);
_executed = true;
}
}