Exemplo n.º 1
0
        private static List <DashLineSegment2D> GroupCloseDashSegment(DashLineSegment2D[] segments)
        {
            var chunks = new List <DashLineSegment2D>();

            foreach (var segment in segments)
            {
                var isMerged = false;
                foreach (var chunk in chunks)
                {
                    if (SegmentHelper.DistanceClose(chunk.AsSolid, segment.AsSolid))
                    {
                        var merged = new DashLineSegment2D {
                            Elements = chunk.Elements.Union(segment.Elements).ToArray()
                        };
                        chunks.Remove(chunk);
                        chunks.Add(merged);
                        isMerged = true;
                        break;
                    }
                }
                if (!isMerged)
                {
                    chunks.Add(segment);
                }
            }
            return(segments.Length == chunks.Count ? chunks : GroupCloseDashSegment(chunks.ToArray()));
        }
Exemplo n.º 2
0
 private static List<DashLineSegment2D> GroupCloseDashSegment(DashLineSegment2D[] segments)
 {
     var chunks = new List<DashLineSegment2D>();
     foreach (var segment in segments)
     {
         var isMerged = false;
         foreach (var chunk in chunks)
         {
             if (SegmentHelper.DistanceClose(chunk.AsSolid, segment.AsSolid))
             {
                 var merged = new DashLineSegment2D {Elements = chunk.Elements.Union(segment.Elements).ToArray()};
                 chunks.Remove(chunk);
                 chunks.Add(merged);
                 isMerged = true;
                 break;
             }
         }
         if (!isMerged)
             chunks.Add(segment);
     }
     return segments.Length == chunks.Count ? chunks : GroupCloseDashSegment(chunks.ToArray());
 }
Exemplo n.º 3
0
 public void AddDashLine(DashLineSegment2D dashSegment)
 {
     AddLine(dashSegment.AsSolid);
 }
Exemplo n.º 4
0
 public void AddDashLine(DashLineSegment2D dashSegment)
 {
     AddLine(dashSegment.AsSolid);
 }