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 #ifdef _MSC_VER
00036 #pragma warning(push)
00037 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
00038 #endif
00039
00040
00041 namespace geos {
00042 namespace index {
00043 class SpatialIndex;
00044 }
00045 namespace geomgraph {
00046 class Edge;
00047 }
00048 }
00049
00050 namespace geos {
00051 namespace geomgraph {
00052
00059 class GEOS_DLL EdgeList {
00060
00061 private:
00062
00063 std::vector<Edge*> edges;
00064
00065 struct OcaCmp {
00066 bool operator()(
00067 const noding::OrientedCoordinateArray *oca1,
00068 const noding::OrientedCoordinateArray *oca2) const
00069 {
00070 return oca1->compareTo(*oca2)<0;
00071 }
00072 };
00073
00082 typedef std::map<noding::OrientedCoordinateArray*, Edge*, OcaCmp> EdgeMap;
00083 EdgeMap ocaMap;
00084
00085 public:
00086 friend std::ostream& operator<< (std::ostream& os, const EdgeList& el);
00087
00088 EdgeList()
00089 :
00090 edges(),
00091 ocaMap()
00092 {}
00093
00094 virtual ~EdgeList();
00095
00099 void add(Edge *e);
00100
00101 void addAll(const std::vector<Edge*> &edgeColl);
00102
00103 std::vector<Edge*> &getEdges() { return edges; }
00104
00105 Edge* findEqualEdge(Edge* e);
00106
00107 Edge* get(int i);
00108
00109 int findEdgeIndex(Edge *e);
00110
00111 std::string print();
00112
00113 void clearList();
00114
00115 };
00116
00117 std::ostream& operator<< (std::ostream& os, const EdgeList& el);
00118
00119
00120 }
00121 }
00122
00123
00124
00125
00126
00127 #ifdef _MSC_VER
00128 #pragma warning(pop)
00129 #endif
00130
00131 #endif // ifndef GEOS_GEOMGRAPH_EDGELIST_H
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145