示例#1
0
Manipulator* ExamineTool::CreateManipulator (
    Viewer* v, Event& e, Transformer* t
){
    GraphicView* views = v->GetGraphicView();
    Selection* s = v->GetSelection();
    _selPath = new Selection;
    Manipulator* m = nil;

    s->Clear();
    ComputeViewPath(e, views, _selPath);
    _shift = e.shift_is_down();

    if (!_selPath->IsEmpty()) {
        Iterator i;
        _selPath->First(i);
	GraphicView* gv = _selPath->GetView(i);
        s->Append(gv);
        s->Update();
        _selPath->Last(i);
	gv = _selPath->GetView(i);
        
        m = gv->CreateManipulator(v, e, t, this);
    }
    delete _selPath;
    return m;
}
示例#2
0
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;
}
示例#3
0
Manipulator* TabTool::CreateManipulator (
    Viewer* v, Event& e, Transformer* rel
) {
    Iterator i;
    Selection* s = v->GetSelection();
    s->First(i);
    GraphicView* gv = s->GetView(i);
    return gv->CreateManipulator(v, e, rel, this);
}