예제 #1
0
        }             // private ArrayList BuildMaximalEdgeRings( ArrayList dirEdges )

        private ArrayList BuildMinimalEdgeRings(ArrayList maxEdgeRings, ref ArrayList freeHoleList)
        {
            ArrayList edgeRings = new ArrayList();

            foreach (object obj in maxEdgeRings)
            {
                MaximalEdgeRing er = (MaximalEdgeRing)obj;
                if (er.GetMaxNodeDegree() > 2)
                {
                    er.LinkDirectedEdgesForMinimalEdgeRings();
                    ArrayList minEdgeRings = er.BuildMinimalRings();
                    // at this point we can go ahead and attempt to place holes, if this EdgeRing is a polygon
                    //computePoints(minEdgeRings);
                    EdgeRing shell = FindShell(minEdgeRings);
                    if (shell != null)
                    {
                        PlacePolygonHoles(shell, minEdgeRings);
                        _shellList.Add(shell);
                    }
                    else
                    {
                        freeHoleList.AddRange(minEdgeRings);
                    }
                }
                else
                {
                    edgeRings.Add(er);
                }
            }     // foreach ( object obj in maxEdgeRings )
            return(edgeRings);
        }         // private ArrayList BuildMinimalEdgeRings( ArrayList maxEdgeRings, ArrayList shellList, ArrayList freeHoleList )
예제 #2
0
        }         // public ArrayList GetPolygons()

        /// <summary>
        /// For all DirectedEdges in result, form them into MaximalEdgeRings
        /// </summary>
        /// <param name="dirEdges"></param>
        /// <returns></returns>
        private ArrayList BuildMaximalEdgeRings(ArrayList dirEdges)
        {
            ArrayList maxEdgeRings = new ArrayList();

            foreach (object obj in dirEdges)
            {
                DirectedEdge de = (DirectedEdge)obj;
                if (de.InResult && de.Label.IsArea())
                {
                    // if this edge has not yet been processed
                    if (de.EdgeRing == null)
                    {
                        MaximalEdgeRing er = new MaximalEdgeRing(de, _geometryFactory, _cga);
                        maxEdgeRings.Add(er);
                        //Trace.WriteLine("max node degree = " + er.getMaxDegree() );
                    } // if ( de.EdgeRing == null )
                }     // if ( de.InResult && de.Label.IsArea() )
            }         // foreach ( object obj in dirEdges )
            return(maxEdgeRings);
        }             // private ArrayList BuildMaximalEdgeRings( ArrayList dirEdges )
예제 #3
0
		} // public ArrayList GetPolygons()

   	    /// <summary>
		/// For all DirectedEdges in result, form them into MaximalEdgeRings
		/// </summary>
		/// <param name="dirEdges"></param>
		/// <returns></returns>
		private ArrayList BuildMaximalEdgeRings( ArrayList dirEdges )
		{
			ArrayList maxEdgeRings  = new ArrayList();
			foreach ( object obj in dirEdges ) 
			{
				DirectedEdge de = (DirectedEdge) obj;
				if ( de.InResult && de.Label.IsArea() ) 
				{
					// if this edge has not yet been processed
					if ( de.EdgeRing == null ) 
					{
						MaximalEdgeRing er = new MaximalEdgeRing( de, _geometryFactory, _cga );
						maxEdgeRings.Add( er );
						//Trace.WriteLine("max node degree = " + er.getMaxDegree() );
					} // if ( de.EdgeRing == null )
				} // if ( de.InResult && de.Label.IsArea() )
			} // foreach ( object obj in dirEdges )
			return maxEdgeRings;
		} // private ArrayList BuildMaximalEdgeRings( ArrayList dirEdges )
		/// <summary>
		/// for all DirectedEdges in result, form them into EdgeRings
		/// </summary>
		/// <param name="dirEdges"></param>
		/// <returns></returns>
		private ArrayList buildEdgeRings(ArrayList dirEdges)
		{
			ArrayList edgeRings = new ArrayList();
			foreach(object obj in dirEdges)
			{
				DirectedEdge de = (DirectedEdge) obj;
				// if this edge has not yet been processed
				if (de.EdgeRing == null) 
				{
					EdgeRing er = new MaximalEdgeRing(de, _geometryFactory, _cga);
					edgeRings.Add(er);
				}
			}
			return edgeRings;
		}