コード例 #1
0
ファイル: selection.c プロジェクト: barak/ivtools-cvs
void Selection::GetBox (Coord& l, Coord& b, Coord& r, Coord& t) {
    Iterator i;
    Graphic* gr;
    BoxObj btotal, bgraphic;

    First(i);
    gr = GetView(i)->GetGraphic();
    gr->GetBox(btotal);
    
    for (Next(i); !Done(i); Next(i)) {
	gr = GetView(i)->GetGraphic();
	gr->GetBox(bgraphic);
	btotal = btotal + bgraphic;
    }
    l = btotal._left;
    b = btotal._bottom;
    r = btotal._right;
    t = btotal._top;
}
コード例 #2
0
ファイル: picture.cpp プロジェクト: PNCG/neuron
Graphic* Picture::LastGraphicWithin (BoxObj& userb) {
    Iterator i;
    BoxObj b;

    for (Last(i); !Done(i); Prev(i)) {
	Graphic* subgr = GetGraphic(i);
	subgr->GetBox(b);

	if (b.Within(userb)) {
	    return subgr;
	}
    }
    return nil;
}