Ejemplo n.º 1
0
        ///<summary>
        /// Creates an intersection finder which finds all interior intersections.
        /// The intersections are recorded for later inspection.
        ///</summary>
        /// <param name="li">A line intersector.</param>
        /// <returns>a intersection finder which finds all interior intersections.</returns>
        public static InteriorIntersectionFinder CreateAllIntersectionsFinder(LineIntersector li)
        {
            var finder = new InteriorIntersectionFinder(li);

            finder.FindAllIntersections = true;
            return(finder);
        }
        ///<summary>
        /// Creates an intersection finder which counts all interior intersections.
        /// The intersections are note recorded to reduce memory usage.
        ///</summary>
        /// <param name="li">A line intersector.</param>
        /// <returns>a intersection finder which counts all interior intersections.</returns>
        public static InteriorIntersectionFinder CreateIntersectionCounter(LineIntersector li)
        {
            InteriorIntersectionFinder finder = new InteriorIntersectionFinder(li);

            finder.FindAllIntersections = true;
            finder.KeepIntersections    = false;
            return(finder);
        }
        private void CheckInteriorIntersections()
        {
            /*
             * MD - It may even be reliable to simply check whether
             * end segments (of SegmentStrings) have an interior intersection,
             * since noding should have split any true interior intersections already.
             */
            _isValid = true;
            _segInt  = new InteriorIntersectionFinder(_li);
            _segInt.FindAllIntersections = FindAllIntersections;
            MCIndexNoder noder = new MCIndexNoder(_segInt);

            noder.ComputeNodes(_segStrings); //.ComputeNodes(segStrings);
            if (_segInt.HasIntersection)
            {
                _isValid = false;
                return;
            }
        }
 ///<summary>
 /// Creates an intersection finder which counts all interior intersections.
 /// The intersections are note recorded to reduce memory usage.
 ///</summary>
 /// <param name="li">A line intersector.</param>
 /// <returns>a intersection finder which counts all interior intersections.</returns>
 public static InteriorIntersectionFinder CreateIntersectionCounter(LineIntersector li)
 {
     InteriorIntersectionFinder finder = new InteriorIntersectionFinder(li);
     finder.FindAllIntersections = true;
     finder.KeepIntersections = false;
     return finder;
 }
 private void CheckInteriorIntersections()
 {
     /*
      * MD - It may even be reliable to simply check whether
      * end segments (of SegmentStrings) have an interior intersection,
      * since noding should have split any true interior intersections already.
      */
     _isValid = true;
     _segInt = new InteriorIntersectionFinder(_li);
     _segInt.FindAllIntersections = FindAllIntersections;
     MCIndexNoder noder = new MCIndexNoder(_segInt);
     noder.ComputeNodes(_segStrings); //.ComputeNodes(segStrings);
     if (_segInt.HasIntersection)
     {
         _isValid = false;
         return;
     }
 }