Example #1
0
bool
Subcurve::IsPointIn(const ON_3dPoint &pt, double tolerance /* = 0.0 */)
{
    ON_3dVector vtol(tolerance, tolerance, tolerance);
    ON_BoundingBox new_bbox(m_node.m_min - vtol, m_node.m_max + vtol);
    return new_bbox.IsPointIn(pt);
}
Example #2
0
bool
Subcurve::Intersect(const Subcurve &other,
                    double tolerance /* = 0.0 */,
                    ON_BoundingBox *intersection /* = NULL */) const
{
    ON_3dVector vtol(tolerance, tolerance, tolerance);
    ON_BoundingBox new_bbox(m_node.m_min - vtol, m_node.m_max + vtol);
    ON_BoundingBox box;
    bool ret = box.Intersection(new_bbox, other.m_node);
    if (intersection != NULL) {
        *intersection = box;
    }
    return ret;
}
Example #3
0
/*
 * Find real vfs given loopback vfs
 */
struct vfs *
lo_realvfs(struct vfs *vfsp, struct vnode **realrootvpp)
{
    struct loinfo *li = vtoli(vfsp);
    struct lfsnode *lfs;

    ASSERT(li->li_refct > 0);
    if (vfsp == li->li_mountvfs) {
        if (realrootvpp != NULL)
            *realrootvpp = vtol(li->li_rootvp)->lo_vp;
        return (li->li_realvfs);
    }
    mutex_enter(&li->li_lfslock);
    for (lfs = li->li_lfs; lfs != NULL; lfs = lfs->lfs_next) {
        if (vfsp == &lfs->lfs_vfs) {
            if (realrootvpp != NULL)
                *realrootvpp = lfs->lfs_realrootvp;
            mutex_exit(&li->li_lfslock);
            return (lfs->lfs_realvfs);
        }
    }
    panic("lo_realvfs");
    /*NOTREACHED*/
}