Class RelateNode

 1  
 2  
 3  
 4 /*
 5  * Copyright (c) 2016 Vivid Solutions.
 6  *
 7  * All rights reserved. This program and the accompanying materials
 8  * are made available under the terms of the Eclipse Public License 2.0
 9  * and Eclipse Distribution License v. 1.0 which accompanies this distribution.
10  * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v20.html
11  * and the Eclipse Distribution License is available at
12  *
13  * http://www.eclipse.org/org/documents/edl-v10.php.
14  */
15 package org.locationtech.jts.operation.relate;
16  
17 import org.locationtech.jts.geom.Coordinate;
18 import org.locationtech.jts.geom.IntersectionMatrix;
19 import org.locationtech.jts.geomgraph.EdgeEndStar;
20 import org.locationtech.jts.geomgraph.Node;
21  
22 /**
23  * Represents a node in the topological graph used to compute spatial relationships.
24  *
25  * @version 1.7
26  */
27 public class RelateNode
28   extends Node
29 {
30  
31   public RelateNode(Coordinate coord, EdgeEndStar edges)
32   {
33     super(coord, edges);
34   }
35  
36   /**
37    * Update the IM with the contribution for this component.
38    * A component only contributes if it has a labelling for both parent geometries
39    */
40   protected void computeIM(IntersectionMatrix im)
41   {
42     im.setAtLeastIfValid(label.getLocation(0), label.getLocation(1), 0);
43   }
44   /**
45    * Update the IM with the contribution for the EdgeEnds incident on this node.
46    */
47   void updateIMFromEdges(IntersectionMatrix im)
48   {
49     ((EdgeEndBundleStar) edges).updateIM(im);
50   }
51  
52 }
53