GEOS 3.4.2

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

EdgeList.h
1 /**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2005-2006 Refractions Research Inc.
7 * Copyright (C) 2001-2002 Vivid Solutions Inc.
8 *
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.
13 *
14 **********************************************************************
15 *
16 * Last port: geomgraph/EdgeList.java rev. 1.4 (JTS-1.10)
17 *
18 **********************************************************************/
19
20
21 #ifndef GEOS_GEOMGRAPH_EDGELIST_H
22 #define GEOS_GEOMGRAPH_EDGELIST_H
23
24 #include <geos/export.h>
25 #include <vector>
26 #include <map>
27 #include <string>
28 #include <iostream>
29
30 #include <geos/noding/OrientedCoordinateArray.h> // for map comparator
31
32 #include <geos/inline.h>
33
34 #ifdef _MSC_VER
35 #pragma warning(push)
36 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
37 #endif
38
39 // Forward declarations
40 namespace geos {
41 namespace index {
42 class SpatialIndex;
43 }
44 namespace geomgraph {
45 class Edge;
46 }
47 }
48
49 namespace geos {
50 namespace geomgraph { // geos.geomgraph
51
58 class GEOS_DLL EdgeList {
59
60 private:
61
62 std::vector<Edge*> edges;
63
64 struct OcaCmp {
65 bool operator()(
66 const noding::OrientedCoordinateArray *oca1,
67 const noding::OrientedCoordinateArray *oca2) const
68 {
69 return *oca1 < *oca2;
70 }
71 };
72
81 typedef std::map<noding::OrientedCoordinateArray*, Edge*, OcaCmp> EdgeMap;
82 EdgeMap ocaMap;
83
84 public:
85 friend std::ostream& operator<< (std::ostream& os, const EdgeList& el);
86
87 EdgeList()
88 :
89 edges(),
90 ocaMap()
91 {}
92
93 virtual ~EdgeList();
94
98 void add(Edge *e);
99
100 void addAll(const std::vector<Edge*> &edgeColl);
101
102 std::vector<Edge*> &getEdges() { return edges; }
103
104 Edge* findEqualEdge(Edge* e);
105
106 Edge* get(int i);
107
108 int findEdgeIndex(Edge *e);
109
110 std::string print();
111
112 void clearList();
113
114 };
115
116 std::ostream& operator<< (std::ostream& os, const EdgeList& el);
117
118
119 } // namespace geos.geomgraph
120 } // namespace geos
121
122 //#ifdef GEOS_INLINE
123 //# include "geos/geomgraph/EdgeList.inl"
124 //#endif
125
126 #ifdef _MSC_VER
127 #pragma warning(pop)
128 #endif
129
130 #endif // ifndef GEOS_GEOMGRAPH_EDGELIST_H