Class MonotoneChainSelectAction

 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.Envelope;
17 import org.locationtech.jts.geom.LineSegment;
18 /**
19  * The action for the internal iterator for performing
20  * envelope select queries on a MonotoneChain
21  *
22  * @version 1.7
23  */
24 public class MonotoneChainSelectAction
25 {
26   // these envelopes are used during the MonotoneChain search process
27   //Envelope tempEnv1 = new Envelope();
28  
29   LineSegment selectedSegment = new LineSegment();
30  
31   /**
32    * This method is overridden 
33    * to process a segment 
34    * in the context of the parent chain.
35    * 
36    * @param mc the parent chain
37    * @param startIndex the index of the start vertex of the segment being processed
38    */
39   public void select(MonotoneChain mc, int startIndex)
40   {
41     mc.getLineSegment(startIndex, selectedSegment);
42     // call this routine in case select(segmenet) was overridden
43     select(selectedSegment);
44   }
45  
46   /**
47    * This is a convenience method which can be overridden to obtain the actual
48    * line segment which is selected.
49    * 
50    * @param seg
51    */
52   public void select(LineSegment seg)
53   {
54   }
55 }
56