Class SimpleEdgeSetIntersector


  • public class SimpleEdgeSetIntersector
    extends EdgeSetIntersector
    Finds all intersections in one or two sets of edges, using the straightforward method of comparing all segments. This algorithm is too slow for production use, but is useful for testing purposes.
    Version:
    1.7
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) int nOverlaps  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void computeIntersections​(java.util.List edges0, java.util.List edges1, SegmentIntersector si)
      Computes all mutual intersections between two sets of edges.
      void computeIntersections​(java.util.List edges, SegmentIntersector si, boolean testAllSegments)
      Computes all self-intersections between edges in a set of edges, allowing client to choose whether self-intersections are computed.
      private void computeIntersects​(Edge e0, Edge e1, SegmentIntersector si)
      Performs a brute-force comparison of every segment in each Edge.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • nOverlaps

        int nOverlaps
    • Constructor Detail

      • SimpleEdgeSetIntersector

        public SimpleEdgeSetIntersector()
    • Method Detail

      • computeIntersections

        public void computeIntersections​(java.util.List edges,
                                         SegmentIntersector si,
                                         boolean testAllSegments)
        Description copied from class: EdgeSetIntersector
        Computes all self-intersections between edges in a set of edges, allowing client to choose whether self-intersections are computed.
        Specified by:
        computeIntersections in class EdgeSetIntersector
        Parameters:
        edges - a list of edges to test for intersections
        si - the SegmentIntersector to use
        testAllSegments - true if self-intersections are to be tested as well
      • computeIntersects

        private void computeIntersects​(Edge e0,
                                       Edge e1,
                                       SegmentIntersector si)
        Performs a brute-force comparison of every segment in each Edge. This has n^2 performance, and is about 100 times slower than using monotone chains.