本文整理汇总了C++中Intersections::removeOne方法的典型用法代码示例。如果您正苦于以下问题:C++ Intersections::removeOne方法的具体用法?C++ Intersections::removeOne怎么用?C++ Intersections::removeOne使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Intersections
的用法示例。
在下文中一共展示了Intersections::removeOne方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: intersect3
bool intersect3(const Cubic& c1, const Cubic& c2, Intersections& i) {
bool result = intersect3(c1, 0, 1, c2, 0, 1, 1, i);
// FIXME: pass in cached bounds from caller
_Rect c1Bounds, c2Bounds;
c1Bounds.setBounds(c1); // OPTIMIZE use setRawBounds ?
c2Bounds.setBounds(c2);
result |= intersectEnd(c1, false, c2, c2Bounds, i);
result |= intersectEnd(c1, true, c2, c2Bounds, i);
bool selfIntersect = c1 == c2;
if (!selfIntersect) {
i.swap();
result |= intersectEnd(c2, false, c1, c1Bounds, i);
result |= intersectEnd(c2, true, c1, c1Bounds, i);
i.swap();
}
// If an end point and a second point very close to the end is returned, the second
// point may have been detected because the approximate quads
// intersected at the end and close to it. Verify that the second point is valid.
if (i.used() <= 1 || i.coincidentUsed()) {
return result;
}
_Point pt[2];
if (closeStart(c1, 0, i, pt[0]) && closeStart(c2, 1, i, pt[1])
&& pt[0].approximatelyEqual(pt[1])) {
i.removeOne(1);
}
if (closeEnd(c1, 0, i, pt[0]) && closeEnd(c2, 1, i, pt[1])
&& pt[0].approximatelyEqual(pt[1])) {
i.removeOne(i.used() - 2);
}
return result;
}