Interface SegmentSetMutualIntersector

 1 /*
 2  * Copyright (c) 2016 Vivid Solutions.
 3  *
 4  * All rights reserved. This program and the accompanying materials
 5  * are made available under the terms of the Eclipse Public License 2.0
 6  * and Eclipse Distribution License v. 1.0 which accompanies this distribution.
 7  * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v20.html
 8  * and the Eclipse Distribution License is available at
 9  *
10  * http://www.eclipse.org/org/documents/edl-v10.php.
11  */
12 package org.locationtech.jts.noding;
13  
14 import java.util.Collection;
15  
16 /**
17  * An intersector for the red-blue intersection problem.
18  * In this class of line arrangement problem,
19  * two disjoint sets of linestrings are intersected.
20  * <p>
21  * Implementing classes must provide a way
22  * of supplying the base set of segment strings to 
23  * test against (e.g. in the constructor, 
24  * for straightforward thread-safety).
25  * <p>
26  * In order to allow optimizing processing, 
27  * the following condition is assumed to hold for each set:
28  * <ul>
29  * <li>the only intersection between any two linestrings occurs at their endpoints.
30  * </ul>
31  * Implementations can take advantage of this fact to optimize processing
32  * (i.e. by avoiding testing for intersections between linestrings
33  * belonging to the same set).
34  *
35  * @author Martin Davis
36  * @version 1.10
37  */
38 public interface SegmentSetMutualIntersector
39 {  
40   /**
41    * Computes the intersections with a given set of {@link SegmentString}s,
42    * using the supplied {@link SegmentIntersector}.
43    *
44    * @param segStrings a collection of {@link SegmentString}s to node
45    * @param segInt the intersection detector to either record intersection occurrences
46    *              or add intersection nodes to the input segment strings.
47    */
48   void process(Collection segStrings, SegmentIntersector segInt);
49 }
50