Esempio n. 1
0
        /// <summary>
        /// Find the next edge clockwise with the same destination. [dprev(abc) -> cb*]
        /// </summary>
        public void Dprev(ref Otri ot)
        {
            //Lnext(ref ot);
            ot.tri    = tri;
            ot.orient = plus1Mod3[orient];

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

            ot.orient = ot.tri.neighbors[tmp].orient;
            ot.tri    = ot.tri.neighbors[tmp].tri;
        }
Esempio n. 2
0
        /// <summary>
        /// Find the previous edge (clockwise) of the adjacent triangle. [rprev(abc) -> b**]
        /// </summary>
        public void Rprev(ref Otri ot)
        {
            //Sym(ref ot);
            ot.tri    = tri.neighbors[orient].tri;
            ot.orient = tri.neighbors[orient].orient;

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

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

            ot.orient = ot.tri.neighbors[tmp].orient;
            ot.tri    = ot.tri.neighbors[tmp].tri;
        }
Esempio n. 3
0
 /// <summary>
 /// Finds a triangle abutting a subsegment.
 /// </summary>
 internal void Pivot(ref Otri ot)
 {
     ot = seg.triangles[orient];
 }
Esempio n. 4
0
        // The following primitives are all described by Guibas and Stolfi.
        // However, Guibas and Stolfi use an edge-based data structure,
        // whereas I use a triangle-based data structure.
        //
        // lnext: finds the next edge (counterclockwise) of a triangle.
        //
        // onext: spins counterclockwise around a vertex; that is, it finds
        // the next edge with the same origin in the counterclockwise direction. This
        // edge is part of a different triangle.
        //
        // oprev: spins clockwise around a vertex; that is, it finds the
        // next edge with the same origin in the clockwise direction.  This edge is
        // part of a different triangle.
        //
        // dnext: spins counterclockwise around a vertex; that is, it finds
        // the next edge with the same destination in the counterclockwise direction.
        // This edge is part of a different triangle.
        //
        // 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.
        //
        // rnext: moves one edge counterclockwise about the adjacent
        // triangle. (It's best understood by reading Guibas and Stolfi. It
        // involves changing triangles twice.)
        //
        // rprev: moves one edge clockwise about the adjacent triangle.
        // (It's best understood by reading Guibas and Stolfi.  It involves
        // changing triangles twice.)

        /// <summary>
        /// Find the abutting triangle; same edge. [sym(abc) -> ba*]
        /// </summary>
        /// Note that the edge direction is necessarily reversed, because the handle specified
        /// by an oriented triangle is directed counterclockwise around the triangle.
        /// </remarks>
        public void Sym(ref Otri ot)
        {
            ot.tri    = tri.neighbors[orient].tri;
            ot.orient = tri.neighbors[orient].orient;
        }
Esempio n. 5
0
 /// <summary>
 /// Test for equality of oriented triangles.
 /// </summary>
 public bool Equals(Otri ot)
 {
     return((tri == ot.tri) && (orient == ot.orient));
 }
Esempio n. 6
0
 /// <summary>
 /// Copy an oriented triangle.
 /// </summary>
 public void Copy(ref Otri ot)
 {
     ot.tri    = tri;
     ot.orient = orient;
 }
Esempio n. 7
0
 /// <summary>
 /// Find the previous edge (clockwise) of a triangle. [lprev(abc) -> cab]
 /// </summary>
 public void Lprev(ref Otri ot)
 {
     ot.tri    = tri;
     ot.orient = minus1Mod3[orient];
 }
Esempio n. 8
0
 /// <summary>
 /// Find the next edge (counterclockwise) of a triangle. [lnext(abc) -> bca]
 /// </summary>
 public void Lnext(ref Otri ot)
 {
     ot.tri    = tri;
     ot.orient = plus1Mod3[orient];
 }