Beispiel #1
0
        public XElement ConvertPolygon(PolygonFromPointsExpression polygon)
        {
            var points = polygon.Points.Cast <CoordinatesPointExpression>().ToArray();
            var pointsAttributeValue = String.Join(" ",
                                                   points.Select(p => String.Format(CultureInfo.InvariantCulture, "{0},{1}", p.X, p.Y)));

            return(new XElement("polygon",
                                new XAttribute("fill", "green"),
                                new XAttribute("points", pointsAttributeValue)));
        }
Beispiel #2
0
        protected virtual SLExpression VisitPolygonFromPoints(PolygonFromPointsExpression polygonFromPointsExpression)
        {
            var points = polygonFromPointsExpression.Points.Select(Visit).ToArray();

            if (HasChanged(points, polygonFromPointsExpression.Points))
            {
                return(new PolygonFromPointsExpression
                {
                    Points = points.Cast <PointExpression>().ToArray(),
                });
            }
            return(polygonFromPointsExpression);
        }
Beispiel #3
0
 protected override SLExpression VisitPolygonFromPoints(PolygonFromPointsExpression polygonFromPointsExpression)
 {
     PolygonsFromPoints.Add(polygonFromPointsExpression);
     return(polygonFromPointsExpression);
 }