当前位置: 首页>>代码示例>>C++>>正文


C++ Selection::Number方法代码示例

本文整理汇总了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;
}
开发者ID:neurodebian,项目名称:iv-hines,代码行数:30,代码来源:move.cpp

示例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;
}
开发者ID:barak,项目名称:ivtools-cvs,代码行数:31,代码来源:attrtool.c

示例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;
}
开发者ID:neurodebian,项目名称:iv-hines,代码行数:19,代码来源:move.cpp

示例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;
    }
}
开发者ID:neurodebian,项目名称:iv-hines,代码行数:37,代码来源:struct.cpp


注:本文中的Selection::Number方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。