Ejemplo n.º 1
0
 public static string ToDebugString(this S2LaxPolylineShape polyline)
 {
     if (polyline.NumVertices() > 0)
     {
         return(AppendVertices(polyline !.Vertices(), polyline.NumVertices()));
     }
     return("");
 }
Ejemplo n.º 2
0
    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());
    }
Ejemplo n.º 3
0
    // 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);
    }
Ejemplo n.º 4
0
    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);
    }