Example #1
0
		//------------------------------------------------------------------------------
		
		private void DisposeIntersectNodes()
		{
			while ( m_IntersectNodes != null )
			{
				IntersectNode iNode = m_IntersectNodes.Next;
				m_IntersectNodes = null;
				m_IntersectNodes = iNode;
			}
		}
Example #2
0
		//------------------------------------------------------------------------------
		
		private void SwapIntersectNodes(IntersectNode int1, IntersectNode int2)
		{
			TEdge e1 = int1.Edge1;
			TEdge e2 = int1.Edge2;
			IntPoint p = new IntPoint(int1.Pt);
			int1.Edge1 = int2.Edge1;
			int1.Edge2 = int2.Edge2;
			int1.Pt = int2.Pt;
			int2.Edge1 = e1;
			int2.Edge2 = e2;
			int2.Pt = p;
		}
Example #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;
			}
		}
Example #4
0
		//------------------------------------------------------------------------------
		
		private void ProcessIntersectList()
		{
			while (m_IntersectNodes != null)
			{
				IntersectNode iNode = m_IntersectNodes.Next;
				{
					IntersectEdges( m_IntersectNodes.Edge1 ,
					               m_IntersectNodes.Edge2 , m_IntersectNodes.Pt, true);
					SwapPositionsInAEL( m_IntersectNodes.Edge1 , m_IntersectNodes.Edge2 );
				}
				m_IntersectNodes = null;
				m_IntersectNodes = iNode;
			}
		}
Example #5
0
		//------------------------------------------------------------------------------
		
		private bool EdgesAdjacent(IntersectNode inode)
		{
			return (inode.Edge1.NextInSEL == inode.Edge2) ||
				(inode.Edge1.PrevInSEL == inode.Edge2);
		}
Example #6
0
		public Clipper(int InitOptions = 0): base() //constructor
		{
			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<Join>();
			m_GhostJoins = new List<Join>();
			ReverseSolution = (ioReverseSolution & InitOptions) != 0;
			StrictlySimple = (ioStrictlySimple & InitOptions) != 0;
			PreserveCollinear = (ioPreserveCollinear & InitOptions) != 0;
			#if use_xyz
			ZFillFunction = null;
			#endif
		}