コード例 #1
0
 // Initializes an S2LaxLoopShape from the given S2Loop, by copying its data.
 //
 // REQUIRES: !loop.IsFull
 //           [Use S2LaxPolygonShape if you need to represent a full loop.]
 public void Init(S2Loop loop)
 {
     System.Diagnostics.Debug.Assert(!loop.IsFull()); // Full loops not supported; use S2LaxPolygonShape
     if (loop.IsEmpty())
     {
         NumVertices = 0;
         vertices_   = null;
     }
     else
     {
         NumVertices = loop.NumVertices;
         vertices_   = loop.CloneVertices();
     }
 }
コード例 #2
0
ファイル: S2TextFormat.cs プロジェクト: alas/s2geometry
    public static string ToDebugString(this S2Loop loop)
    {
        if (loop.IsEmpty())
        {
            return("empty");
        }
        else if (loop.IsFull())
        {
            return("full");
        }

        if (loop.NumVertices > 0)
        {
            return(AppendVertices(loop.CloneVertices(), loop.NumVertices));
        }
        return("");
    }