1 
2 
3 /*
4  * Copyright (c) 2016 Vivid Solutions.
5  *
6  * All rights reserved. This program and the accompanying materials
7  * are made available under the terms of the Eclipse Public License 2.0
8  * and Eclipse Distribution License v. 1.0 which accompanies this distribution.
9  * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v20.html
10  * and the Eclipse Distribution License is available at
11  *
12  * http://www.eclipse.org/org/documents/edl-v10.php.
13  */
14 package org.locationtech.jts.index.chain;
15 
16 import org.locationtech.jts.geom.LineSegment;
17 
18 /**
19  * The action for the internal iterator for performing
20  * overlap queries on a MonotoneChain
21  *
22  * @version 1.7
23  */
24 public class MonotoneChainOverlapAction
25 {
26   protected LineSegment overlapSeg1 = new LineSegment();
27   protected LineSegment overlapSeg2 = new LineSegment();
28 
29   /**
30    * This function can be overridden if the original chains are needed
31    *
32    * @param start1 the index of the start of the overlapping segment from mc1
33    * @param start2 the index of the start of the overlapping segment from mc2
34    */
overlap(MonotoneChain mc1, int start1, MonotoneChain mc2, int start2)35   public void overlap(MonotoneChain mc1, int start1, MonotoneChain mc2, int start2)
36   {
37     mc1.getLineSegment(start1, overlapSeg1);
38     mc2.getLineSegment(start2, overlapSeg2);
39     overlap(overlapSeg1, overlapSeg2);
40   }
41 
42   /**
43    * This is a convenience function which can be overridden to obtain the actual
44    * line segments which overlap
45    * @param seg1
46    * @param seg2
47    */
overlap(LineSegment seg1, LineSegment seg2)48   public void overlap(LineSegment seg1, LineSegment seg2)
49   {
50   }
51 }
52