public static IShape CreateMultiPolygon(Vector2D[][] polygons, Scalar gridSpacing, ScalarColor4[][] colors) { if (polygons.Length == 1) { return(CreatePolygon(polygons[0], gridSpacing, colors[0])); } else { MultiPolygonShape shape = new MultiPolygonShape(polygons, gridSpacing); shape.Tag = DrawableFactory.CreateMultiPolygon(polygons, colors); return(shape); } }
public static IShape CreateColoredMultiPolygon(Vector2D[][] polygons, Scalar gridSpacing) { if (polygons.Length == 1) { return(CreateColoredPolygon(polygons[0], gridSpacing)); } else { MultiPolygonShape shape = new MultiPolygonShape(polygons, gridSpacing); ScalarColor3[][] colors = new ScalarColor3[polygons.Length][]; Vector2D[][] reduced = new Vector2D[polygons.Length][]; for (int index = 0; index < polygons.Length; ++index) { reduced[index] = VertexHelper.Reduce(polygons[index]); colors[index] = CreateColor3Array(reduced[index].Length); } shape.Tag = DrawableFactory.CreateMultiPolygon(reduced, colors); return(shape); } }