コード例 #1
0
        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");
        }
コード例 #2
0
ファイル: SpriteBatchEx.cs プロジェクト: raphaelmun/MonoXen
        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");
        }
コード例 #3
0
ファイル: ExtentBase.cs プロジェクト: raphaelmun/MonoXen
        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");
        }
コード例 #4
0
ファイル: CompositeExtent.cs プロジェクト: raphaelmun/MonoXen
 public override bool Intersects(ICircularExtent other)
 {
     foreach (var child in Items)
     {
         if (child.Intersects(other))
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #5
0
        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");
        }
コード例 #6
0
        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");
        }
コード例 #7
0
ファイル: CircularExtent.cs プロジェクト: raphaelmun/MonoXen
 public override bool Intersects(ICircularExtent other)
 {
     return(ShapeUtility.Intersects(other, this));
 }
コード例 #8
0
ファイル: ExtentBase.cs プロジェクト: raphaelmun/MonoXen
 public abstract bool Intersects(ICircularExtent other);