Example #1
0
        /// <summary>
        /// Checks whether this closed shape intersects (overlaps) a line.
        /// This assumes that a window-window overlap has already been checked for.
        /// </summary>
        /// <param name="line">The line to compare with the shape</param>
        /// <returns>True if intersection found.</returns>
        bool IsIntersect(LineGeometry line)
        {
            //IntersectionResult xres = new IntersectionResult(line);
            //return (xres.IntersectMultiSegment(this) > 0);

            IntersectionResult xres = new IntersectionResult(line);

            // Intersect each segment of this shape with the line.
            IPointGeometry[] data = this.Data;
            for (int i = 1; i < data.Length; i++)
            {
                LineSegmentGeometry thisSeg = new LineSegmentGeometry(data[i - 1], data[i]);
                if (xres.IntersectSegment(thisSeg) > 0)
                {
                    return(true);
                }
            }

            return(false);
        }
 internal override uint Intersect(IntersectionResult results)
 {
     return results.IntersectSegment(this);
 }
Example #3
0
        /// <summary>
        /// Checks whether this closed shape intersects (overlaps) a line.
        /// This assumes that a window-window overlap has already been checked for.
        /// </summary>
        /// <param name="line">The line to compare with the shape</param>
        /// <returns>True if intersection found.</returns>
        bool IsIntersect(LineGeometry line)
        {
            //IntersectionResult xres = new IntersectionResult(line);
            //return (xres.IntersectMultiSegment(this) > 0);

            IntersectionResult xres = new IntersectionResult(line);

            // Intersect each segment of this shape with the line.
            IPointGeometry[] data = this.Data;
            for (int i=1; i<data.Length; i++)
            {
                LineSegmentGeometry thisSeg = new LineSegmentGeometry(data[i-1], data[i]);
                if (xres.IntersectSegment(thisSeg) > 0)
                    return true;
            }

            return false;
        }
Example #4
0
 internal override uint Intersect(IntersectionResult results)
 {
     return(results.IntersectSegment(this));
 }