本文整理汇总了C++中BoxObj::Within方法的典型用法代码示例。如果您正苦于以下问题:C++ BoxObj::Within方法的具体用法?C++ BoxObj::Within怎么用?C++ BoxObj::Within使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BoxObj
的用法示例。
在下文中一共展示了BoxObj::Within方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Intersects
boolean FillPolygonObj::Intersects (BoxObj& ub) {
BoxObj b;
GetBox(b);
if (!b.Intersects(ub)) {
return false;
}
if (b.Within(ub)) {
return true;
}
LineObj bottom(ub._left, ub._bottom, ub._right, ub._bottom);
if (Intersects(bottom)) {
return true;
}
LineObj right(ub._right, ub._bottom, ub._right, ub._top);
if (Intersects(right)) {
return true;
}
LineObj top(ub._right, ub._top, ub._left, ub._top);
if (Intersects(top)) {
return true;
}
LineObj left(ub._left, ub._top, ub._left, ub._bottom);
return Intersects(left);
}
示例2: LastGraphicWithin
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;
}
示例3: Incur
void Damage::Incur (BoxObj& newb) {
BoxObj* b;
Iterator i;
if (_areas->IsEmpty()) {
_areas->Prepend(new UList(new BoxObj(&newb)));
} else if (_areas->First() == _areas->Last()) {
FirstArea(i);
b = GetArea(i);
if (newb.Intersects(*b)) {
if (!newb.Within(*b)) {
*b = *b + newb;
}
} else {
_areas->Prepend(new UList(new BoxObj(&newb)));
}
} else {
Merge(newb);
}
}
示例4: Within
boolean MultiLineObj::Within (BoxObj& userb) {
BoxObj b;
GetBox(b);
return b.Within(userb);
}