Exemplo n.º 1
0
 /// <summary>
 /// For all edges, check if there are any intersections which are NOT at an endpoint.
 /// The Geometry is not simple if there are intersections not at endpoints.
 /// </summary>
 /// <param name="graph"></param>
 private bool HasNonEndpointIntersection(GeometryGraph graph)
 {
     for (IEnumerator i = graph.GetEdgeEnumerator(); i.MoveNext();)
     {
         Edge e = (Edge)i.Current;
         int  maxSegmentIndex = e.MaximumSegmentIndex;
         for (IEnumerator eiIt = e.EdgeIntersectionList.GetEnumerator(); eiIt.MoveNext();)
         {
             EdgeIntersection ei = (EdgeIntersection)eiIt.Current;
             if (!ei.IsEndPoint(maxSegmentIndex))
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Exemplo n.º 2
0
        }         // private bool IsSimpleLinearGeometry( Geometry geom )

        /// <summary>
        /// For all edges, check if there are any intersections which are NOT at an endpoint.
        /// The Geometry is not simple if there are intersections not at endpoints.
        /// </summary>
        /// <param name="graph"></param>
        /// <returns></returns>
        private bool HasNonEndpointIntersection(GeometryGraph graph)
        {
            foreach (object obj in graph.Edges)
            {
                Edge e = (Edge)obj;
                int  maxSegmentIndex = e.MaximumSegmentIndex;
                foreach (object eiObj in e.EdgeIntersectionList)
                {
                    EdgeIntersection ei = (EdgeIntersection)eiObj;
                    if (!ei.IsEndPoint(maxSegmentIndex))
                    {
                        return(true);
                    }
                }
            }     // foreach ( object obj in graph.Edges )
            return(false);
        }         // private bool HasNonEndpointIntersection(GeometryGraph graph)