public DepthSegment(SubgraphDepthLocater depthLocater,
                                LineSegment segment, int depth)
            {
                this.m_objDepthLocater = depthLocater;

                // input seg is assumed to be normalized
                upwardSeg = new LineSegment(segment, segment.Factory);
                //upwardSeg.Normalize();
                this.leftDepth = depth;
            }
示例#2
0
		/// <summary> 
		/// Completes the building of the input subgraphs by depth-labelling them,
		/// and adds them to the 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 void BuildSubgraphs(IList subgraphList, PolygonBuilder polyBuilder)
		{
			ArrayList processedGraphs = new ArrayList();

            int nCount = subgraphList.Count;

            for (int i = 0; i < nCount; i++)
			{
				BufferSubgraph subgraph = (BufferSubgraph)subgraphList[i];
				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);
			}
		}