예제 #1
0
파일: Line.cs 프로젝트: Omybot/GoBot
        /// <summary>
        /// Retourne la liste des points de croisement avec la forme donnée
        /// </summary>
        /// <param name="shape">Forme à tester</param>
        /// <returns>Liste des points de croisement</returns>
        public virtual List <RealPoint> GetCrossingPoints(IShape shape)
        {
            List <RealPoint> output = new List <RealPoint>();

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

            return(output);
        }
예제 #2
0
파일: Line.cs 프로젝트: Omybot/GoBot
        /// <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);
        }
예제 #3
0
파일: Line.cs 프로젝트: Omybot/GoBot
        /// <summary>
        /// Retourne la distance minimale entre la Droite et la forme donnée
        /// </summary>
        /// <param name="shape">IForme testée</param>
        /// <returns>Distance minimale</returns>
        public virtual double Distance(IShape shape)
        {
            double output = 0;

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

            return(output);
        }