public bool HasThisExtendedSegment(UndirectedPlanarGraph.PlanarGraph graph, Segment segment) { if (!points.Contains(segment.Point1)) return false; if (!points.Contains(segment.Point2)) return false; return graph.GetEdgeType(segment.Point1, segment.Point2) == UndirectedPlanarGraph.EdgeType.EXTENDED_SEGMENT; }
public Segment GetExtendedSegment(UndirectedPlanarGraph.PlanarGraph graph) { for (int p = 0; p < points.Count; p++) { if (graph.GetEdgeType(points[p], points[(p + 1) % points.Count]) == UndirectedPlanarGraph.EdgeType.EXTENDED_SEGMENT) { return new Segment(points[p], points[p + 1 < points.Count ? p + 1 : 0]); } } return null; }