Exemple #1
0
        //------------------------------------------------------------------------------

        private void DisposeIntersectNodes()
        {
            while (m_IntersectNodes != null)
            {
                IntersectNode iNode = m_IntersectNodes.next;
                m_IntersectNodes = null;
                m_IntersectNodes = iNode;
            }
        }
Exemple #2
0
        //------------------------------------------------------------------------------

        private void SwapIntersectNodes(IntersectNode int1, IntersectNode int2)
        {
            TEdge e1 = int1.edge1;
            TEdge e2 = int1.edge2;
            IntPoint p = int1.pt;
            int1.edge1 = int2.edge1;
            int1.edge2 = int2.edge2;
            int1.pt = int2.pt;
            int2.edge1 = e1;
            int2.edge2 = e2;
            int2.pt = p;
        }
Exemple #3
0
        //------------------------------------------------------------------------------

        private void InsertIntersectNode(TEdge e1, TEdge e2, IntPoint pt)
        {
            IntersectNode newNode = new IntersectNode();
            newNode.edge1 = e1;
            newNode.edge2 = e2;
            newNode.pt = pt;
            newNode.next = null;
            if (m_IntersectNodes == null) m_IntersectNodes = newNode;
            else if (newNode.pt.Y > m_IntersectNodes.pt.Y)
            {
                newNode.next = m_IntersectNodes;
                m_IntersectNodes = newNode;
            }
            else
            {
                IntersectNode iNode = m_IntersectNodes;
                while (iNode.next != null && newNode.pt.Y < iNode.next.pt.Y)
                    iNode = iNode.next;
                newNode.next = iNode.next;
                iNode.next = newNode;
            }
        }
Exemple #4
0
        //------------------------------------------------------------------------------

        private void ProcessIntersectList()
        {
            while (m_IntersectNodes != null)
            {
                IntersectNode iNode = m_IntersectNodes.next;
                {
                    IntersectEdges(m_IntersectNodes.edge1,
                      m_IntersectNodes.edge2, m_IntersectNodes.pt, Protects.ipBoth);
                    SwapPositionsInAEL(m_IntersectNodes.edge1, m_IntersectNodes.edge2);
                }
                m_IntersectNodes = null;
                m_IntersectNodes = iNode;
            }
        }
Exemple #5
0
        //------------------------------------------------------------------------------

        private bool EdgesAdjacent(IntersectNode inode)
        {
            return (inode.edge1.nextInSEL == inode.edge2) ||
              (inode.edge1.prevInSEL == inode.edge2);
        }
Exemple #6
0
 public Clipper()
 {
     m_Scanbeam = null;
     m_ActiveEdges = null;
     m_SortedEdges = null;
     m_IntersectNodes = null;
     m_ExecuteLocked = false;
     m_UsingPolyTree = false;
     m_PolyOuts = new List<OutRec>();
     m_Joins = new List<JoinRec>();
     m_HorizJoins = new List<HorzJoinRec>();
     m_ReverseOutput = false;
     m_ForceSimple = false;
 }