private void EraseLoop(S2Loop v, int n)
 {
     for (int i = n - 1, j = 0; j < n; i = j++)
     {
         EraseEdge(v.Vertex(i), v.Vertex(j));
     }
 }
        /** Erases all edges of the given loop and marks them as unused. */

        private void RejectLoop(S2Loop v, int n, System.Collections.Generic.IList <S2Edge> unusedEdges)
        {
            for (int i = n - 1, j = 0; j < n; i = j++)
            {
                unusedEdges.Add(new S2Edge(v.Vertex(i), v.Vertex(j)));
            }
        }
        /**
         * Add all edges in the given loop. If the sign() of the loop is negative
         * (i.e. this loop represents a hole), the reverse edges are added instead.
         * This implies that "shells" are CCW and "holes" are CW, as required for the
         * directed edges convention described above.
         *
         * This method does not take ownership of the loop.
         */

        public void AddLoop(S2Loop loop)
        {
            var sign = loop.Sign;

            for (var i = loop.NumVertices; i > 0; --i)
            {
                // Vertex indices need to be in the range [0, 2*num_vertices()-1].
                AddEdge(loop.Vertex(i), loop.Vertex(i + sign));
            }
        }
Exemple #4
0
 protected override S2Point EdgeFrom(int index)
 {
     return(_this.Vertex(index));
 }