bool GoRegion::Has2IPs(const SgVector<SgPoint>& interiorEmpty,
                       SgMiaiPair* ips) const
{
    SgVector<SgPoint> jointLibs;
    JointLibs(&jointLibs);
    if (jointLibs.MinLength(2))
    {
        // check if libs are intersection pts
        int nuIPs = 0;
        SgPoint ip1 = SG_NULLPOINT;
        for (SgVectorIterator<SgPoint> it(jointLibs); it; ++it)
        {
            if (AdjacentToAll(*it, interiorEmpty) && IsSplitPt(*it, Points()))
            {
                ++nuIPs;
                if (ip1 == SG_NULLPOINT)
                    ip1 = *it;
                else
                {
                    ips->first = ip1;
                    ips->second = *it;
                    return true;
                }
            }
        }
    }
    return false;
}
bool GoRegion::Has2IntersectionPoints(const SgVector<SgPoint>& usedLibs) const
{
    SgVector<SgPoint> jointLibs;
    JointLibs(&jointLibs);
    if (jointLibs.MinLength(2))
    {
        // check if libs are intersection pts
        int nuIPs = 0;
        // doesn't have to adjacent to all interior points! 2005/08
        for (SgVectorIterator<SgPoint> it(jointLibs); it; ++it)
        {
            if (IsSplitPt(*it, Points()) && ! usedLibs.Contains(*it))
            {
                if (++nuIPs >= 2)
                    return true;
            }
        }
    }
    return false;
}