Example #1
0
        public static UrbanChallenge.Common.Shapes.Polygon PolygonIntersection(UrbanChallenge.Common.Shapes.Polygon polygon, UrbanChallenge.Common.Shapes.Polygon eePolygon)
        {
            GpcWrapper.Polygon one   = ToGpcPolygon(polygon);
            GpcWrapper.Polygon two   = ToGpcPolygon(eePolygon);
            GpcWrapper.Polygon final = GpcWrapper.GpcWrapper.Clip(GpcWrapper.GpcOperation.Intersection, one, two);

            return(ToShapePolygon(final));
        }
Example #2
0
        public static GpcWrapper.Polygon ToGpcPolygon(UrbanChallenge.Common.Shapes.Polygon input)
        {
            GraphicsPath gp = new GraphicsPath();

            PointF[] polyPoints = new PointF[input.Count];

            for (int i = 0; i < input.Count; i++)
            {
                polyPoints[i] = DrawingUtility.ToPointF(input[i]);
            }

            gp.AddPolygon(polyPoints);
            return(new GpcWrapper.Polygon(gp));
        }