01:
02: /*
03: * The JTS Topology Suite is a collection of Java classes that
04: * implement the fundamental operations required to validate a given
05: * geo-spatial data set to a known topological specification.
06: *
07: * Copyright (C) 2001 Vivid Solutions
08: *
09: * This library is free software; you can redistribute it and/or
10: * modify it under the terms of the GNU Lesser General Public
11: * License as published by the Free Software Foundation; either
12: * version 2.1 of the License, or (at your option) any later version.
13: *
14: * This library is distributed in the hope that it will be useful,
15: * but WITHOUT ANY WARRANTY; without even the implied warranty of
16: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17: * Lesser General Public License for more details.
18: *
19: * You should have received a copy of the GNU Lesser General Public
20: * License along with this library; if not, write to the Free Software
21: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22: *
23: * For more information, contact:
24: *
25: * Vivid Solutions
26: * Suite #1A
27: * 2328 Government Street
28: * Victoria BC V8T 5G5
29: * Canada
30: *
31: * (250)385-6040
32: * www.vividsolutions.com
33: */
34: package com.vividsolutions.jts.operation.relate;
35:
36: import java.io.PrintStream;
37: import java.util.*;
38: import com.vividsolutions.jts.geom.*;
39: import com.vividsolutions.jts.util.*;
40: import com.vividsolutions.jts.geomgraph.*;
41: import com.vividsolutions.jts.util.Assert;
42:
43: /**
44: * An ordered list of {@link EdgeEndBundle}s around a {@link RelateNode}.
45: * They are maintained in CCW order (starting with the positive x-axis) around the node
46: * for efficient lookup and topology building.
47: *
48: * @version 1.7
49: */
50: public class EdgeEndBundleStar extends EdgeEndStar {
51: /**
52: * Creates a new empty EdgeEndBundleStar
53: */
54: public EdgeEndBundleStar() {
55: }
56:
57: /**
58: * Insert a EdgeEnd in order in the list.
59: * If there is an existing EdgeStubBundle which is parallel, the EdgeEnd is
60: * added to the bundle. Otherwise, a new EdgeEndBundle is created
61: * to contain the EdgeEnd.
62: * <br>
63: */
64: public void insert(EdgeEnd e) {
65: EdgeEndBundle eb = (EdgeEndBundle) edgeMap.get(e);
66: if (eb == null) {
67: eb = new EdgeEndBundle(e);
68: insertEdgeEnd(e, eb);
69: } else {
70: eb.insert(e);
71: }
72: }
73:
74: /**
75: * Update the IM with the contribution for the EdgeStubs around the node.
76: */
77: void updateIM(IntersectionMatrix im) {
78: for (Iterator it = iterator(); it.hasNext();) {
79: EdgeEndBundle esb = (EdgeEndBundle) it.next();
80: esb.updateIM(im);
81: }
82: }
83:
84: }
|