public InterseptResult RectangleContains(CoordinateRectangle rectangle) { var iLeftTop = PointContains(rectangle.LeftTop) != InterseptResult.None; var iRightBottom = PointContains(rectangle.RightBottom) != InterseptResult.None; if (iLeftTop && iRightBottom) { return(InterseptResult.Contains); } if (iLeftTop || iRightBottom) { return(InterseptResult.Intersepts); } if (PointContains(rectangle.LeftBottom) != InterseptResult.None) { return(InterseptResult.Intersepts); } if (PointContains(rectangle.RightTop) != InterseptResult.None) { return(InterseptResult.Intersepts); } iLeftTop = rectangle.PointContains(LeftTop) != InterseptResult.None; iRightBottom = rectangle.PointContains(RightBottom) != InterseptResult.None; if (iLeftTop && iRightBottom) { return(InterseptResult.Supersets); } if (iLeftTop || iRightBottom) { return(InterseptResult.Intersepts); } if (rectangle.PointContains(LeftBottom) != InterseptResult.None) { return(InterseptResult.Intersepts); } if (rectangle.PointContains(RightTop) != InterseptResult.None) { return(InterseptResult.Intersepts); } if (GoogleMapUtilities.CheckLinesInterseption(new CoordinateRectangle(Left, Top, Left, Bottom), new CoordinateRectangle(rectangle.Left, rectangle.Top, rectangle.Right, rectangle.Top))) { return(InterseptResult.Intersepts); } if (GoogleMapUtilities.CheckLinesInterseption(new CoordinateRectangle(Left, Top, Right, Top), new CoordinateRectangle(rectangle.Left, rectangle.Top, rectangle.Left, rectangle.Bottom))) { return(InterseptResult.Intersepts); } return(InterseptResult.None); }
public bool IncludeTo(CoordinateRectangle rect) { for (var i = 0; i < Coordinates.Count; i++) { if (rect.PointContains(Coordinates[i]) != InterseptResult.Contains) return false; } return true; }
public bool IncludeTo(CoordinateRectangle rect) { for (var i = 0; i < Coordinates.Count; i++) { if (rect.PointContains(Coordinates[i]) != InterseptResult.Contains) { return(false); } } return(true); }
public InterseptResult RectangleContains(CoordinateRectangle rectangle) { var iLeftTop = PointContains(rectangle.LeftTop) != InterseptResult.None; var iRightBottom = PointContains(rectangle.RightBottom) != InterseptResult.None; if (iLeftTop && iRightBottom) return InterseptResult.Contains; if (iLeftTop || iRightBottom) return InterseptResult.Intersepts; if (PointContains(rectangle.LeftBottom) != InterseptResult.None) return InterseptResult.Intersepts; if (PointContains(rectangle.RightTop) != InterseptResult.None) return InterseptResult.Intersepts; iLeftTop = rectangle.PointContains(LeftTop) != InterseptResult.None; iRightBottom = rectangle.PointContains(RightBottom) != InterseptResult.None; if (iLeftTop && iRightBottom) return InterseptResult.Supersets; if (iLeftTop || iRightBottom) return InterseptResult.Intersepts; if (rectangle.PointContains(LeftBottom) != InterseptResult.None) return InterseptResult.Intersepts; if (rectangle.PointContains(RightTop) != InterseptResult.None) return InterseptResult.Intersepts; if (GoogleMapUtilities.CheckLinesInterseption(new CoordinateRectangle(Left, Top, Left, Bottom), new CoordinateRectangle(rectangle.Left, rectangle.Top, rectangle.Right, rectangle.Top))) return InterseptResult.Intersepts; if (GoogleMapUtilities.CheckLinesInterseption(new CoordinateRectangle(Left, Top, Right, Top), new CoordinateRectangle(rectangle.Left, rectangle.Top, rectangle.Left, rectangle.Bottom))) return InterseptResult.Intersepts; return InterseptResult.None; }