public void RenderPolygons(ICollection <RegionVO> regionsInput, RegionManipulator regMan) { RegionVO [] regions = regMan.GetOrderedForRendering(regionsInput.ToArray()); RegionToPolygonBO regionToPolygon = new RegionToPolygonBO(regMan); HashSet <Point> lp = new HashSet <Point>(); int maxY = 0; List <Point> kkkk = new List <Point>(); foreach (var i in regions.OrderBy(x => x.Pixels.Length)) { Trace.WriteLine($"{i.Pixels.Length},"); } foreach (RegionVO region in regions) { Point[] points = regionToPolygon.ToPolygon(region); kkkk.AddRange(points); int kk = (int)points.Max(x => x.Y); if (maxY < kk) { maxY = kk; } Color color = Color.FromArgb(region.Color.CA, region.Color.CR, region.Color.CG, region.Color.CB); CanvasContainer.Children.Add(Create_Polyline(points, Colors.Black, color)); } kkkk = kkkk.OrderByDescending(x => x.Y).ThenByDescending(x => x.X).ToList(); }
public List <int> EdgeCrawler(RegionVO region, RegionManipulator rm, int startPoint) { RegionEdgeCrawler edgeCrawler = new RegionEdgeCrawler(region, rm); return(edgeCrawler.GetInOrderEdgePixels(startPoint)); }