예제 #1
0
        /// <summary>
        /// Completes the building of the input subgraphs by depth-labelling them,
        /// and adds them to the <see cref="PolygonBuilder" />.
        /// The subgraph list must be sorted in rightmost-coordinate order.
        /// </summary>
        /// <param name="subgraphList">The subgraphs to build.</param>
        /// <param name="polyBuilder">The PolygonBuilder which will build the final polygons.</param>
        private static void BuildSubgraphs(IList subgraphList, PolygonBuilder polyBuilder)
        {
            IList processedGraphs = new ArrayList();

            foreach (object obj in subgraphList)
            {
                BufferSubgraph       subgraph = (BufferSubgraph)obj;
                Coordinate           p        = subgraph.RightMostCoordinate;
                SubgraphDepthLocater locater  = new SubgraphDepthLocater(processedGraphs);
                int outsideDepth = locater.GetDepth(p);
                subgraph.ComputeDepth(outsideDepth);
                subgraph.FindResultEdges();
                processedGraphs.Add(subgraph);
                polyBuilder.Add(subgraph.DirectedEdges, subgraph.Nodes);
            }
        }
예제 #2
0
 /// <summary>
 /// Completes the building of the input subgraphs by depth-labelling them,
 /// and adds them to the <see cref="PolygonBuilder" />.
 /// The subgraph list must be sorted in rightmost-coordinate order.
 /// </summary>
 /// <param name="subgraphList">The subgraphs to build.</param>
 /// <param name="polyBuilder">The PolygonBuilder which will build the final polygons.</param>
 private static void BuildSubgraphs(IList subgraphList, PolygonBuilder polyBuilder)
 {
     IList processedGraphs = new ArrayList();
     foreach (object obj in subgraphList)
     {
         BufferSubgraph subgraph = (BufferSubgraph)obj;
         Coordinate p = subgraph.RightMostCoordinate;
         SubgraphDepthLocater locater = new SubgraphDepthLocater(processedGraphs);
         int outsideDepth = locater.GetDepth(p);
         subgraph.ComputeDepth(outsideDepth);
         subgraph.FindResultEdges();
         processedGraphs.Add(subgraph);
         polyBuilder.Add(subgraph.DirectedEdges, subgraph.Nodes);
     }
 }