本文整理汇总了C++中BoxObj类的典型用法代码示例。如果您正苦于以下问题:C++ BoxObj类的具体用法?C++ BoxObj怎么用?C++ BoxObj使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BoxObj类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: contains
bool Picture::contains (PointObj& po, Graphic* gs) {
if (!IsEmpty()) {
Iterator i;
FullGraphic gstemp;
Transformer ttemp;
BoxObj b;
getBox(b, gs);
if (b.Contains(po)) {
gstemp.SetTransformer(&ttemp);
for (First(i); !Done(i); Next(i)) {
Graphic* gr = GetGraphic(i);
concatGraphic(gr, gr, gs, &gstemp);
if (containsGraphic(gr, po, &gstemp)) {
gstemp.SetTransformer(nil);
return true;
}
}
gstemp.SetTransformer(nil); /* to avoid deleting ttemp explicitly*/
}
}
return false;
}
示例3: intersects
bool Picture::intersects (BoxObj& userb, Graphic* gs) {
if (!IsEmpty()) {
Iterator i;
FullGraphic gstemp;
Transformer ttemp;
BoxObj b;
getBox(b, gs);
if (b.Intersects(userb)) {
gstemp.SetTransformer(&ttemp);
for (First(i); !Done(i); Next(i)) {
Graphic* gr = GetGraphic(i);
concatGraphic(gr, gr, gs, &gstemp);
if (intersectsGraphic(gr, userb, &gstemp)) {
gstemp.SetTransformer(nil);
return true;
}
}
gstemp.SetTransformer(nil); /* to avoid deleting ttemp explicitly*/
}
}
return false;
}
示例4: pt
boolean ULabel::contains (PointObj& po, Graphic* gs) {
PointObj pt (&po);
PSFont* f = gs->GetFont();
invTransform(pt._x, pt._y, gs);
BoxObj b (0, 0, f->Width(_string), f->Height());
return b.Contains(pt);
}
示例5: pt
boolean UStencil::contains (PointObj& po, Graphic* gs) {
Bitmap* bitmap = (_mask == nil) ? _image : _mask;
PointObj pt (&po);
invTransform(pt._x, pt._y, gs);
BoxObj b (0, 0, bitmap->Width(), bitmap->Height());
return b.Contains(pt);
}
示例6: f_contains
boolean MultiLine::f_contains (PointObj& po, Graphic* gs) {
BoxObj b;
PointObj pt (&po);
getBox(b, gs);
if (b.Contains(pt)) {
FillPolygonObj fp (x(), y(), count());
invTransform(pt._x, pt._y, gs);
return fp.Contains(pt);
}
return false;
}
示例7: pt
boolean MultiLine::s_contains (PointObj& po, Graphic* gs) {
MultiLineObj &ml = *_pts;
PointObj pt (&po);
BoxObj b;
getBox(b, gs);
if (b.Contains(po)) {
invTransform(pt._x, pt._y, gs);
return ml.Contains(pt);
}
return false;
}
示例8: pt
bool OpenBSpline::f_contains (PointObj& po, Graphic* gs) {
PointObj pt (&po);
BoxObj b;
getBox(b, gs);
if (b.Contains(pt)) {
invTransform(pt._x, pt._y, gs);
FillPolygonObj fp;
fp.ClosedSplineToPolygon(_x, _y, _count);
return fp.Contains(pt);
}
return false;
}
示例9: 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;
}
示例10: Contains
boolean MultiLineObj::Contains (PointObj& p) {
register int i;
BoxObj b;
GetBox(b);
if (b.Contains(p)) {
for (i = 1; i < _count; ++i) {
LineObj l (_x[i-1], _y[i-1], _x[i], _y[i]);
if (l.Contains(p)) {
return true;
}
}
}
return false;
}
示例11: contains
boolean BSplineSelection::contains (PointObj& po, Graphic* gs) {
BoxObj b;
getBox(b, gs);
if (b.Contains(po)) {
if (containsGraphic(ifillbspline, po, gs)) {
return true;
} else if (containsGraphic(bspline, po, gs)) {
return true;
} else if (LeftAcont(lx0, ly0, lx1, ly1, po, gs)) {
return true;
} else if (RightAcont(rx0, ry0, rx1, ry1, po, gs)) {
return true;
}
}
return false;
}
示例12: intersects
boolean BSplineSelection::intersects (BoxObj& userb, Graphic* gs) {
BoxObj b;
getBox(b, gs);
if (b.Intersects(userb)) {
if (intersectsGraphic(ifillbspline, userb, gs)) {
return true;
} else if (intersectsGraphic(bspline, userb, gs)) {
return true;
} else if (LeftAints(lx0, ly0, lx1, ly1, userb, gs)) {
return true;
} else if (RightAints(rx0, ry0, rx1, ry1, userb, gs)) {
return true;
}
}
return false;
}
示例13: f_intersects
boolean MultiLine::f_intersects (BoxObj& userb, Graphic* gs) {
Coord* convx, *convy;
BoxObj b;
boolean result = false;
getBox(b, gs);
if (b.Intersects(userb)) {
convx = new Coord[count()+1];
convy = new Coord[count()+1];
transformList(x(), y(), count(), convx, convy, gs);
FillPolygonObj fp (convx, convy, count());
result = fp.Intersects(userb);
delete convx;
delete convy;
}
return result;
}
示例14: f_intersects
bool ClosedBSpline::f_intersects (BoxObj& userb, Graphic* gs) {
Coord* convx, *convy;
BoxObj b;
bool result = false;
getBox(b, gs);
if (b.Intersects(userb)) {
convx = new Coord[_count];
convy = new Coord[_count];
transformList(_x, _y, _count, convx, convy, gs);
FillPolygonObj fp;
fp.ClosedSplineToPolygon(convx, convy, _count);
result = fp.Intersects(userb);
delete convx;
delete convy;
}
return result;
}
示例15: s_intersects
bool OpenBSpline::s_intersects (BoxObj& userb, Graphic* gs) {
Coord* convx, *convy;
BoxObj b;
bool result = false;
getBox(b, gs);
if (b.Intersects(userb)) {
convx = new Coord[_count];
convy = new Coord[_count];
transformList(_x, _y, _count, convx, convy, gs);
MultiLineObj ml;
ml.SplineToMultiLine(convx, convy, _count);
result = ml.Intersects(userb);
delete convx;
delete convy;
}
return result;
}