public static bool AreInIntersectionExtentVsExtent(IPolygonExtent a, IExtent b) { ICompositeExtent composite = b as ICompositeExtent; if (null != composite) { return(a.Intersects(composite)); } composite = a as ICompositeExtent; if (null != composite) { return(b.Intersects(composite)); } ICircularExtent circle = b as ICircularExtent; if (null != circle) { _tempCircleB.Reset(b); return(circle.Intersects(_tempCircleB)); } IPolygonExtent polygon = b as IPolygonExtent; if (null != polygon) { return(a.Intersects(polygon)); } throw new InvalidOperationException("Extent must be a circle or polygon"); }
public static void DrawExtent(this SpriteBatch spriteBatch, IExtent extent, Color color, Matrix transformFromWorldToCamera) { ICompositeExtent composite = extent as ICompositeExtent; if (null != composite) { DrawCompositeExtent(spriteBatch, composite, color, transformFromWorldToCamera); return; } IPolygonExtent poly = extent as IPolygonExtent; if (null != poly) { DrawPolygon(spriteBatch, poly, color, transformFromWorldToCamera); return; } ICircularExtent circle = extent as ICircularExtent; if (null != circle) { DrawCircle(spriteBatch, circle, color, transformFromWorldToCamera); return; } throw new NotImplementedException("can only draw extents that are either polygons or circles"); }
public bool Intersects(IExtent other) { if (null == other) { return(false); } ICompositeExtent composite = other as ICompositeExtent; if (null != composite) { return(Intersects(composite)); } IPolygonExtent polygon = other as IPolygonExtent; if (null != polygon) { return(Intersects(polygon)); } ICircularExtent circle = other as ICircularExtent; if (null != circle) { return(Intersects(circle)); } throw new NotImplementedException("otherExtent must be either circle or polygon"); }
public override bool Intersects(ICircularExtent other) { foreach (var child in Items) { if (child.Intersects(other)) { return(true); } } return(false); }
public static bool AreInIntersectionCircleVsExtent(ICircularExtent a, IExtent b) { ICircularExtent circle = b as ICircularExtent; if (null != circle) { return(a.Intersects(circle)); } IPolygonExtent polygon = b as IPolygonExtent; if (null != polygon) { return(a.Intersects(polygon)); } throw new InvalidOperationException("Extent must be a circle or polygon"); }
public static bool AreInIntersectionCircleVsCircle(IPolygonExtent a, IExtent b) { ICircularExtent circle = b as ICircularExtent; if (null != circle) { _tempCircleA.Reset(a); return(circle.Intersects(_tempCircleA)); } IPolygonExtent polygon = b as IPolygonExtent; if (null != polygon) { _tempCircleB.Reset(polygon); return(a.Intersects(_tempCircleB)); } throw new InvalidOperationException("Extent must be a circle or polygon"); }
public override bool Intersects(ICircularExtent other) { return(ShapeUtility.Intersects(other, this)); }
public abstract bool Intersects(ICircularExtent other);