예제 #1
0
Point PolylineCollection::leftmost_point(const Polylines &polylines)
{
    if (polylines.empty()) CONFESS("leftmost_point() called on empty PolylineCollection");
    Polylines::const_iterator it = polylines.begin();
    Point p = it->leftmost_point();
    for (++ it; it != polylines.end(); ++it) {
        Point p2 = it->leftmost_point();
        if (p2.x < p.x) 
            p = p2;
    }
    return p;
}
예제 #2
0
Point
PolylineCollection::leftmost_point() const
{
    if (this->polylines.empty()) qDebug("leftmost_point() called on empty PolylineCollection");
    Point p = this->polylines.front().leftmost_point();
    for (Polylines::const_iterator it = this->polylines.begin() + 1; it != this->polylines.end(); ++it) {
        Point p2 = it->leftmost_point();
        if (p2.x < p.x) p = p2;
    }
    return p;
}