示例#1
0
        }         // public void Build(GeometryGraph geomGraph)

        /// <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.
        /// Precondition: edge intersections have been computed.
        /// </summary>
        /// <param name="geomGraph"></param>
        /// <param name="argIndex"></param>
        public void ComputeIntersectionNodes(GeometryGraph geomGraph, int argIndex)
        {
            foreach (object obj in geomGraph.Edges)
            {
                Edge e    = (Edge)obj;
                int  eLoc = e.Label.GetLocation(argIndex);
                foreach (object objEdgeIntersection in e.EdgeIntersectionList)
                {
                    EdgeIntersection ei = (EdgeIntersection)objEdgeIntersection;
                    RelateNode       n  = (RelateNode)_nodes.AddNode(ei.Coordinate);
                    if (eLoc == Location.Boundary)
                    {
                        n.SetLabelBoundary(argIndex);
                    }
                    else
                    {
                        if (n.Label.IsNull(argIndex))
                        {
                            n.SetLabel(argIndex, Location.Interior);
                        }                         // if ( n.Label.IsNull( argIndex ) )
                    }
                    //Trace.WriteLine( n.ToString() );
                }
            }     // foreach ( object obj in geomGraph.Edges )
        }         // public void ComputeIntersectionNodes( GeometryGraph geomGraph, int argIndex )
示例#2
0
        }         // private void ComputeIntersectionNodes( int argIndex )

        /// <summary>
        /// For all intersections on the edges of a Geometry,
        /// label the corresponding node IF it doesn't 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.
        /// </summary>
        /// <param name="argIndex"></param>
        private void LabelIntersectionNodes(int argIndex)
        {
            foreach (object obj in _arg[argIndex].Edges)
            {
                Edge e    = (Edge)obj;
                int  eLoc = e.Label.GetLocation(argIndex);
                foreach (object objEdgeIntersection in e.EdgeIntersectionList)
                {
                    EdgeIntersection ei = (EdgeIntersection)objEdgeIntersection;
                    RelateNode       n  = (RelateNode)_nodes.Find(ei.Coordinate);
                    if (n.Label.IsNull(argIndex))
                    {
                        if (eLoc == Location.Boundary)
                        {
                            n.SetLabelBoundary(argIndex);
                        }
                        else
                        {
                            n.SetLabel(argIndex, Location.Interior);
                        }
                    }
                    //Trace.WriteLine( n.ToString() );
                } // foreach ( object objEdgeIntersection in e.EdgeIntersectionList )
            }     // foreach ( object obj in _arg[argIndex].Edges )
        }         // private void LabelIntersectionNodes( int argIndex )