示例#1
0
        /// <summary>
        /// Insert nodes for all intersections on the edges of a Geometry.
        /// Label the created nodes the same as the edge label if they do not already
        /// have a label.
        /// This allows nodes created by either self-intersections or
        /// mutual intersections to be labelled.
        /// Endpoint nodes will already be labelled from when they were inserted.
        /// <para>
        /// Precondition: edge intersections have been computed.
        /// </para>
        /// </summary>
        public void ComputeIntersectionNodes(GeometryGraph geomGraph, int argIndex)
        {
            for (IEdgeEnumerator edgeIt = geomGraph.EdgeIterator; edgeIt.MoveNext();)
            {
                Edge e    = edgeIt.Current;
                int  eLoc = e.Label.GetLocation(argIndex);

                for (IEnumerator eiIt = e.EdgeIntersectionList.Iterator(); eiIt.MoveNext();)
                {
                    EdgeIntersection ei = (EdgeIntersection)eiIt.Current;
                    RelateNode       n  = (RelateNode)nodes.AddNode(ei.coord);
                    if (eLoc == LocationType.Boundary)
                    {
                        n.SetLabelBoundary(argIndex);
                    }
                    else
                    {
                        if (n.Label.IsNull(argIndex))
                        {
                            n.SetLabel(argIndex, LocationType.Interior);
                        }
                    }
                }
            }
        }
示例#2
0
 private void  LabelNodeEdges()
 {
     for (IEnumerator ni = nodes.Iterator(); ni.MoveNext();)
     {
         RelateNode node = (RelateNode)ni.Current;
         node.Edges.ComputeLabelling(arg);
     }
 }
示例#3
0
        /// <summary>
        /// Update the IM with the sum of the IMs for each component.
        /// </summary>
        private void  UpdateIM(IntersectionMatrix im)
        {
            for (IEdgeEnumerator ei = isolatedEdges.GetEnumerator(); ei.MoveNext();)
            {
                Edge e = ei.Current;
                e.UpdateIM(im);
            }

            for (IEnumerator ni = nodes.Iterator(); ni.MoveNext();)
            {
                RelateNode node = (RelateNode)ni.Current;
                node.UpdateIM(im);

                node.updateIMFromEdges(im);
            }
        }