Example #1
0
 /// <summary>
 /// 与矩形的关系
 /// </summary>
 /// <param name="dbd1"></param>
 /// <returns>true 相交: false 不相交</returns>
 public override bool CheckIntersect(Rect2D ab)
 {
     if (ab == null)
     {
         return(false);
     }
     for (int i = 0; i < ab.GetEdgeNum(); i++)
     {
         if (this.CheckIn(ab.GetPoint(i)) == true)
         {
             return(true);
         }
         if (this.CheckLineRelation(ab.GetEdge(i)) == LineRelation.Intersect)
         {
             return(true);
         }
     }
     return(false);
 }
Example #2
0
        /// <summary>
        /// 与矩形的关系
        /// </summary>
        /// <param name="dbd1"></param>
        /// <returns>true 相交: false 不相交</returns>
        public override bool CheckIntersect(Rect2D ab)
        {
            if (ab == null)
            {
                return(false);
            }
            if (ab.CheckIn(this.circleCenter) == true)
            {
                return(true);
            }

            for (int i = 0; i < ab.GetEdgeNum(); i++)
            {
                LineSegment2D ls = ab.GetEdge(i);
                if (this.CheckLineRelation(ls) != LineRelation.Detach)
                {
                    return(true);
                }
            }
            return(false);
        }