コード例 #1
0
        public InterseptResult PoligonContains(CoordinatePoligon poligon)
        {
            if (poligon.IncludeTo(this))
            {
                return(InterseptResult.Contains);
            }

            for (var i = 0; i < poligon.Count; i++)
            {
                if (LineContains(poligon[i]) != InterseptResult.None)
                {
                    return(InterseptResult.Intersepts);
                }
            }

            if (poligon.PointContains(LeftTop) != InterseptResult.None &&
                poligon.PointContains(RightTop) != InterseptResult.None &&
                poligon.PointContains(RightBottom) != InterseptResult.None &&
                poligon.PointContains(LeftBottom) != InterseptResult.None)
            {
                return(InterseptResult.Supersets);
            }

            return(InterseptResult.None);
        }
コード例 #2
0
        public InterseptResult PoligonContains(CoordinatePoligon poligon)
        {
            if (poligon.IncludeTo(this))
                return InterseptResult.Contains;

            for (var i = 0; i < poligon.Count; i++)
            {
                if (LineContains(poligon[i]) != InterseptResult.None)
                    return InterseptResult.Intersepts;
            }

            if (poligon.PointContains(LeftTop) != InterseptResult.None
                && poligon.PointContains(RightTop) != InterseptResult.None
                && poligon.PointContains(RightBottom) != InterseptResult.None
                && poligon.PointContains(LeftBottom) != InterseptResult.None)
                return InterseptResult.Supersets;

            return InterseptResult.None;
        }