Ejemplo n.º 1
0
        ///<summary>
        /// Turns an edge counterclockwise inside its enclosing quadrilateral.
        ///</summary>
        ///<param name="e">the quadedge to turn</param>
        public static void Swap(QuadEdge e)
        {
            QuadEdge a = e.OriginPrev;
            QuadEdge b = e.Sym().OriginPrev;

            Splice(e, a);
            Splice(e.Sym(), b);
            Splice(e, a.LeftNext);
            Splice(e.Sym(), b.LeftNext);
            e.Origin      = a.Destination;
            e.Destination = b.Destination;
        }
Ejemplo n.º 2
0
        ///<summary>
        /// Creates a new QuadEdge connecting the destination of a to the origin of
        /// b, in such a way that all three have the same left face after the
        /// connection is complete. Additionally, the data pointers of the new edge
        /// are set.
        ///</summary>
        ///<param name="a"></param>
        ///<param name="b"></param>
        ///<returns>the connected edge</returns>
        public static QuadEdge Connect(QuadEdge a, QuadEdge b)
        {
            QuadEdge e = MakeEdge(a.Destination, b.Origin);

            Splice(e, a.LeftNext);
            Splice(e.Sym(), b);
            return(e);
        }
Ejemplo n.º 3
0
 ///<summary>
 /// Tests if this quadedge and another have the same line segment geometry,
 ///</summary>
 ///<param name="qe">a quadege</param>
 ///<returns>true if the quadedges are based on the same line segment regardless of orientation regardless of orientation.</returns>
 public Boolean EqualsNonOriented(QuadEdge qe)
 {
     if (EqualsOriented(qe))
     {
         return(true);
     }
     if (EqualsOriented(qe.Sym()))
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 4
0
 ///<summary>
 /// Gets the dual of this edge, directed from its left to its right.
 ///</summary>
 ///<returns>the inverse rotated edge.</returns>
 public QuadEdge InverseRot()
 {
     return(_rot.Sym());
 }