Exemple #1
0
        /// <summary>
        /// Teste si la droite courante croise la forme donnée
        /// </summary>
        /// <param name="shape">Forme testée</param>
        /// <returns>Vrai si droite croise la forme testée</returns>
        public virtual bool Cross(IShape shape)
        {
            bool output = false;

            if (shape is RealPoint)
            {
                output = LineWithRealPoint.Cross(this, shape as RealPoint);
            }
            else if (shape is Segment)
            {
                output = LineWithSegment.Cross(this, shape as Segment);
            }
            else if (shape is Polygon)
            {
                output = LineWithPolygon.Cross(this, shape as Polygon);
            }
            else if (shape is Circle)
            {
                output = LineWithCircle.Cross(this, shape as Circle);
            }
            else if (shape is Line)
            {
                output = LineWithLine.Cross(this, shape as Line);
            }

            return(output);
        }