private IEnumerable<IFillerVertex> GetOtherEnterPoint(MarkupFiller filler) { var otherEnterPoint = Point.IsFirst ? Enter.Next.LastPoint : Enter.Prev.FirstPoint; var vertex = new EnterFillerVertex(otherEnterPoint); if (vertex.Equals(filler.First) || !filler.Vertices.Any(v => vertex.Equals(v))) yield return vertex; }
private void FixEnterVertex(EnterFillerVertex enter, ref int i) { var prevI = i.PrevIndex(SupportPoints.Count); var nextI = i.NextIndex(SupportPoints.Count); if ((SupportPoints[prevI] is LineEndFillerVertex prevEnd && enter.Some(prevEnd)) || (SupportPoints[nextI] is LineEndFillerVertex nextEnd && enter.Some(nextEnd))) { SupportPoints.RemoveAt(i); i -= 1; }
private IEnumerable <IFillerVertex> GetOtherEnterPoint(FillerContour contour) { var otherEnterPoint = Point.IsFirst ? Enter.Prev.LastPoint : Enter.Next.FirstPoint; var vertex = new EnterFillerVertex(otherEnterPoint); var isCanEnd = vertex.Equals(contour.First) && contour.VertexCount >= 3; var isUsed = contour.Vertices.Any(v => vertex.Equals(v)); var isEdgeLine = Point.Lines.Any(l => l.ContainsPoint(otherEnterPoint)); if ((isCanEnd || !isUsed) && !isEdgeLine) { yield return(vertex); } }
public static bool FromXml(XElement config, Markup markup, Dictionary<ObjectId, ObjectId> map, out EnterFillerVertex enterPoint) { var pointId = config.GetAttrValue<int>(MarkupPoint.XmlName); if (MarkupPoint.FromId(pointId, markup, map, out MarkupPoint point)) { enterPoint = new EnterFillerVertex(point); return true; } else { enterPoint = null; return false; } }
public static bool FromXml(XElement config, Markup markup, ObjectsMap map, out EnterFillerVertexBase enterPoint) { var pointId = config.GetAttrValue <int>(MarkupPoint.XmlName); if (MarkupPoint.FromId(pointId, markup, map, out MarkupPoint point)) { var lineId = config.GetAttrValue <ulong>(MarkupLine.XmlName); if (markup.TryGetLine(lineId, map, out MarkupRegularLine line)) { enterPoint = new LineEndFillerVertex(point, line); } else { enterPoint = new EnterFillerVertex(point); } return(true); } else { enterPoint = null; return(false); } }