Ejemplo n.º 1
0
        /// <summary>
        /// Teste si le segment courant croise la forme donnée
        /// </summary>
        /// <param name="shape">Forme testée</param>
        /// <returns>Vrai si le segment croise la forme donnée</returns>
        public override bool Cross(IShape shape)
        {
            bool output = false;

            if (shape is RealPoint)
            {
                output = SegmentWithRealPoint.Cross(this, shape as RealPoint);
            }
            else if (shape is Segment)
            {
                output = SegmentWithSegment.Cross(this, shape as Segment);
            }
            else if (shape is Polygon)
            {
                output = SegmentWithPolygon.Cross(this, shape as Polygon);
            }
            else if (shape is Circle)
            {
                output = SegmentWithCircle.Cross(this, shape as Circle);
            }
            else if (shape is Line)
            {
                output = SegmentWithLine.Cross(this, shape as Line);
            }

            return(output);
        }