Пример #1
0
        /// <summary>
        /// Find the next edge clockwise with the same destination. [dprev(abc) -> cb*]
        /// </summary>
        /// <remarks>dprev() spins clockwise around a vertex; that is, it finds the
        /// next edge with the same destination in the clockwise direction. This edge
        /// is part of a different triangle.
        /// </remarks>
        public void Dprev(ref Otri o2)
        {
            //Lnext(ref o2);
            o2.triangle = triangle;
            o2.orient   = plus1Mod3[orient];

            //o2.SymSelf();
            int tmp = o2.orient;

            o2.orient   = o2.triangle.neighbors[tmp].orient;
            o2.triangle = o2.triangle.neighbors[tmp].triangle;
        }
Пример #2
0
        /// <summary>
        /// Find the previous edge (clockwise) of the adjacent triangle. [rprev(abc) -> b**]
        /// </summary>
        /// <remarks>rprev() moves one edge clockwise about the adjacent triangle.
        /// (It's best understood by reading Guibas and Stolfi.  It involves
        /// changing triangles twice.)
        /// </remarks>
        public void Rprev(ref Otri o2)
        {
            //Sym(ref o2);
            o2.triangle = triangle.neighbors[orient].triangle;
            o2.orient   = triangle.neighbors[orient].orient;

            //o2.LprevSelf();
            o2.orient = minus1Mod3[o2.orient];

            //o2.SymSelf();
            int tmp = o2.orient;

            o2.orient   = o2.triangle.neighbors[tmp].orient;
            o2.triangle = o2.triangle.neighbors[tmp].triangle;
        }
Пример #3
0
 /// <summary>
 /// Finds a triangle abutting a subsegment.
 /// </summary>
 public void TriPivot(ref Otri ot)
 {
     ot = seg.triangles[orient];
     //decode(ptr, otri)
 }
Пример #4
0
 /// <summary>
 /// Find the previous edge (clockwise) of a triangle. [lprev(abc) -> cab]
 /// </summary>
 public void Lprev(ref Otri o2)
 {
     o2.triangle = triangle;
     o2.orient   = minus1Mod3[orient];
 }
Пример #5
0
        // lnext() finds the next edge (counterclockwise) of a triangle.

        /// <summary>
        /// Find the next edge (counterclockwise) of a triangle. [lnext(abc) -> bca]
        /// </summary>
        public void Lnext(ref Otri o2)
        {
            o2.triangle = triangle;
            o2.orient   = plus1Mod3[orient];
        }
Пример #6
0
 /// <summary>
 /// Test for equality of oriented triangles.
 /// </summary>
 public bool Equal(Otri o2)
 {
     return((triangle == o2.triangle) && (orient == o2.orient));
 }
Пример #7
0
 /// <summary>
 /// Copy an oriented triangle.
 /// </summary>
 public void Copy(ref Otri o2)
 {
     o2.triangle = triangle;
     o2.orient   = orient;
 }