예제 #1
0
        /// <summary>
        /// Returns whether or not this rectangle contains the passed in rectangle.
        /// </summary>
        /// <param name="lr">
        /// The location rectangle to compare against the current instance.
        /// </param>
        /// <returns>
        /// A boolean indicating if this rectangle contains the passed in rectangle.
        /// </returns>
        public bool Contains(ILocationRect lr)
        {
            if (lr.West >= West &&
                lr.East <= East &&
                lr.South >= South &&
                lr.North <= North)
            {
                return(true);
            }

            return(false);
        }
예제 #2
0
        /// <summary>
        /// Returns whether or not two rectangles intersect one another.
        /// </summary>
        /// <param name="lr">
        /// The location rectangle to compare against the current instance.
        /// </param>
        /// <returns>
        /// A boolean indicating if the two rectangles intersect.
        /// </returns>
        public bool Intersects(ILocationRect lr)
        {
            if (lr.East < West || lr.West > East)
            {
                return(false);
            }
            if (lr.North < South || lr.South > North)
            {
                return(false);
            }

            return(true);
        }
예제 #3
0
        /// <summary>
        /// Grow the ILocationRect by the new ILocationRect. This is a poor man's -
        /// it is stupid around international dateline but we're not really using it yet.
        /// </summary>
        /// <param name="lr">
        /// The ILocationRect by which to expand.
        /// </param>
        public void Expand(ILocationRect lr)
        {
            if (this.XMax < lr.East)
            {
                this.XMax = lr.East;
            }

            if (this.YMax < lr.North)
            {
                this.YMax = lr.North;
            }

            if (this.XMin > lr.West)
            {
                this.XMin = lr.West;
            }

            if (this.YMin > lr.South)
            {
                this.YMin = lr.South;
            }
        }
예제 #4
0
 /// <summary>
 /// Returns whether the passed in ILocationRect intersects this ILocationRect.
 /// </summary>
 /// <param name="lr">
 /// The ILocationRect to check.
 /// </param>
 /// <returns>
 /// A boolean indicating whether the rectangles intersect.
 /// </returns>
 public bool Intersects(ILocationRect lr)
 {
     return(this.Intersects(lr as Envelope));
 }
예제 #5
0
 /// <summary>
 /// Returns whether or not two rectangles intersect one another.
 /// </summary>
 /// <param name="lr">
 /// The location rectangle to compare against the current instance.
 /// </param>
 /// <returns>
 /// A boolean indicating if the two rectangles intersect.
 /// </returns>
 public bool Intersects(ILocationRect lr)
 {
     return(this.Intersects(lr as LocationRect));
 }