Complete Note#1 in the http://wiki.osgeo.org/wiki/GEOS_Provenance_Review to get out...
[geos.git] / src / operation / relate / EdgeEndBundleStar.cpp
blobc83d56c293275144a8b815daed700b65e07539b7
1 /**********************************************************************
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
6 * Copyright (C) 2001-2002 Vivid Solutions Inc.
7 * Copyright (C) 2005 Refractions Research Inc.
9 * This is free software; you can redistribute and/or modify it under
10 * the terms of the GNU Lesser General Public Licence as published
11 * by the Free Software Foundation.
12 * See the COPYING file for more information.
14 **********************************************************************
16 * Last port: operation/relate/EdgeEndBundleStar.java rev. 1.13 (JTS-1.10)
18 **********************************************************************/
20 #include <geos/operation/relate/EdgeEndBundleStar.h>
21 #include <geos/operation/relate/EdgeEndBundle.h>
23 using namespace std;
24 using namespace geos::geomgraph;
25 using namespace geos::geom;
27 namespace geos {
28 namespace operation { // geos.operation
29 namespace relate { // geos.operation.relate
31 EdgeEndBundleStar::~EdgeEndBundleStar()
33 EdgeEndStar::iterator it=begin();
34 EdgeEndStar::iterator endIt=end();
35 for (; it!=endIt; ++it)
37 EdgeEndBundle *eeb=static_cast<EdgeEndBundle*>(*it);
38 delete eeb;
42 /**
43 * Insert a EdgeEnd in order in the list.
44 * If there is an existing EdgeStubBundle which is parallel, the EdgeEnd is
45 * added to the bundle. Otherwise, a new EdgeEndBundle is created
46 * to contain the EdgeEnd.
48 void
49 EdgeEndBundleStar::insert(EdgeEnd *e)
51 EdgeEndBundle *eb;
52 //set<EdgeEnd*,EdgeEndLT>::iterator i=edgeMap->find(e);
53 EdgeEndStar::iterator it=find(e);
54 if (it==end())
56 eb=new EdgeEndBundle(e);
57 insertEdgeEnd(eb);
59 else
61 eb=static_cast<EdgeEndBundle*>(*it);
62 eb->insert(e);
66 void
67 EdgeEndBundleStar::updateIM(IntersectionMatrix& im)
69 //vector<EdgeEnd*> *edges=getEdges();
70 EdgeEndStar::iterator it=begin();
71 EdgeEndStar::iterator endIt=end();
72 for (; it!=endIt; ++it)
74 EdgeEndBundle *esb=static_cast<EdgeEndBundle*>(*it);
75 esb->updateIM(im);
79 } // namespace geos.operation.relate
80 } // namespace geos.operation
81 } // namespace geos
83 /**********************************************************************
84 * $Log$
85 * Revision 1.13 2006/03/21 13:11:29 strk
86 * opRelate.h header split
88 * Revision 1.12 2006/03/20 16:57:44 strk
89 * spatialindex.h and opValid.h headers split
91 * Revision 1.11 2006/02/19 19:46:50 strk
92 * Packages <-> namespaces mapping for most GEOS internal code (uncomplete, but working). Dir-level libs for index/ subdirs.
94 **********************************************************************/