public void AddLine(LineSegment2D segment) { var parent = FindParent(segment); var cacheLine = new LineHistory(segment, parent); levels_[0].Add(cacheLine); }
public LineHistory(LineHistory parent) { Parent = parent; if (parent != null) { Parent.Child = this; } }
public HoughResult GetCachedResult() { var result = new HoughResult(); var realLines = new List <LineSegment2D>(); foreach (var level in levels_) { var last = level.Value.Where(_ => !_.HasChild); foreach (var line in last) { var history = line.GetAllLineHistory(); if (LineHistory.IsReal(history.Count)) { //realLines.Add(history.First().Segment); realLines.Add(SegmentHelper.MergeSegments(history.Select(c => c.Segment).ToArray())); } } } result.SolidLines = realLines.ToArray(); result.DashLines = new DashLineSegment2D[0]; return(result); }
public LineHistory(LineSegment2D segment, LineHistory parent) : this(parent) { Segment = segment; }
public LineHistory(LineHistory parent) { Parent = parent; if (parent != null) Parent.Child = this; }