00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef GEOS_GEOMGRAPH_EDGELIST_H
00023 #define GEOS_GEOMGRAPH_EDGELIST_H
00024
00025 #include <geos/export.h>
00026 #include <vector>
00027 #include <map>
00028 #include <string>
00029 #include <iostream>
00030
00031 #include <geos/noding/OrientedCoordinateArray.h>
00032
00033 #include <geos/inline.h>
00034
00035
00036 namespace geos {
00037 namespace index {
00038 class SpatialIndex;
00039 }
00040 namespace geomgraph {
00041 class Edge;
00042 }
00043 }
00044
00045 namespace geos {
00046 namespace geomgraph {
00047
00054 class GEOS_DLL EdgeList {
00055
00056 private:
00057
00058 std::vector<Edge*> edges;
00059
00060 struct OcaCmp {
00061 bool operator()(
00062 const noding::OrientedCoordinateArray *oca1,
00063 const noding::OrientedCoordinateArray *oca2) const
00064 {
00065 return oca1->compareTo(*oca2)<0;
00066 }
00067 };
00068
00077 typedef std::map<noding::OrientedCoordinateArray*, Edge*, OcaCmp> EdgeMap;
00078 EdgeMap ocaMap;
00079
00080 public:
00081 friend std::ostream& operator<< (std::ostream& os, const EdgeList& el);
00082
00083 EdgeList()
00084 :
00085 edges(),
00086 ocaMap()
00087 {}
00088
00089 virtual ~EdgeList();
00090
00094 void add(Edge *e);
00095
00096 void addAll(const std::vector<Edge*> &edgeColl);
00097
00098 std::vector<Edge*> &getEdges() { return edges; }
00099
00100 Edge* findEqualEdge(Edge* e);
00101
00102 Edge* get(int i);
00103
00104 int findEdgeIndex(Edge *e);
00105
00106 std::string print();
00107
00108 void clearList();
00109
00110 };
00111
00112 std::ostream& operator<< (std::ostream& os, const EdgeList& el);
00113
00114
00115 }
00116 }
00117
00118
00119
00120
00121
00122 #endif // ifndef GEOS_GEOMGRAPH_EDGELIST_H
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136