public static string ToDebugString(this S2LaxPolylineShape polyline) { if (polyline.NumVertices() > 0) { return(AppendVertices(polyline !.Vertices(), polyline.NumVertices())); } return(""); }
public void Test_S2LaxPolylineShape_OneVertex() { S2Point[] vertices = { new S2Point(1, 0, 0) }; var shape = new S2LaxPolylineShape(vertices); Assert.Equal(0, shape.NumEdges()); Assert.Equal(0, shape.NumChains()); Assert.Equal(1, shape.Dimension()); Assert.True(shape.IsEmpty()); Assert.False(shape.IsFull()); }
// As above, but does not Debug.Assert-fail on invalid input. Returns true if // conversion is successful. public static bool MakeLaxPolyline(string str, out S2LaxPolylineShape lax_polyline) { lax_polyline = null; var vertices = new List <S2Point>(); if (!ParsePoints(str, vertices)) { return(false); } lax_polyline = new S2LaxPolylineShape(vertices); return(true); }
public void Test_S2LaxPolylineShape_NoVertices() { var vertices = Array.Empty <S2Point>(); var shape = new S2LaxPolylineShape(vertices); Assert.Equal(0, shape.NumEdges()); Assert.Equal(0, shape.NumChains()); Assert.Equal(1, shape.Dimension()); Assert.True(shape.IsEmpty()); Assert.False(shape.IsFull()); Assert.False(shape.GetReferencePoint().Contained); }