Пример #1
0
Bface*
Bedge::lookup_face(CBedge *e) const
{
    // Reject null pointers.
    // Also, it's not helpful if the edge is this one.
    if (!e || this == e)
        return 0;

    // Return an adjacent Bface containing the edge

    if (_f1 && _f1->contains(e))
        return _f1;
    if (_f2 && _f2->contains(e))
        return _f2;
    if (_adj) {
        for (int i=0; i<_adj->num(); i++) {
            Bface* f = (*_adj)[i];
            if (f->contains(e))
                return f;
        }
    }
    return 0;
}
Пример #2
0
Bface*
Bedge::lookup_face(CBvert *v) const
{
    // Reject null pointers.
    // Also, it's not helpful if the vertex belongs
    // to this edge.
    if (!v || this->contains(v))
        return 0;
    // Return an adjacent Bface containing the vertex

    if (_f1 && _f1->contains(v))
        return _f1;
    if (_f2 && _f2->contains(v))
        return _f2;
    if (_adj) {
        for (int i=0; i<_adj->num(); i++) {
            Bface* f = (*_adj)[i];
            if (f->contains(v))
                return f;
        }
    }
    return 0;
}