00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef GEOS_GEOMGRAPH_EDGELIST_H
00022 #define GEOS_GEOMGRAPH_EDGELIST_H
00023
00024 #include <geos/export.h>
00025 #include <vector>
00026 #include <map>
00027 #include <string>
00028 #include <iostream>
00029
00030 #include <geos/noding/OrientedCoordinateArray.h>
00031
00032 #include <geos/inline.h>
00033
00034 #ifdef _MSC_VER
00035 #pragma warning(push)
00036 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
00037 #endif
00038
00039
00040 namespace geos {
00041 namespace index {
00042 class SpatialIndex;
00043 }
00044 namespace geomgraph {
00045 class Edge;
00046 }
00047 }
00048
00049 namespace geos {
00050 namespace geomgraph {
00051
00058 class GEOS_DLL EdgeList {
00059
00060 private:
00061
00062 std::vector<Edge*> edges;
00063
00064 struct OcaCmp {
00065 bool operator()(
00066 const noding::OrientedCoordinateArray *oca1,
00067 const noding::OrientedCoordinateArray *oca2) const
00068 {
00069 return *oca1 < *oca2;
00070 }
00071 };
00072
00081 typedef std::map<noding::OrientedCoordinateArray*, Edge*, OcaCmp> EdgeMap;
00082 EdgeMap ocaMap;
00083
00084 public:
00085 friend std::ostream& operator<< (std::ostream& os, const EdgeList& el);
00086
00087 EdgeList()
00088 :
00089 edges(),
00090 ocaMap()
00091 {}
00092
00093 virtual ~EdgeList();
00094
00098 void add(Edge *e);
00099
00100 void addAll(const std::vector<Edge*> &edgeColl);
00101
00102 std::vector<Edge*> &getEdges() { return edges; }
00103
00104 Edge* findEqualEdge(Edge* e);
00105
00106 Edge* get(int i);
00107
00108 int findEdgeIndex(Edge *e);
00109
00110 std::string print();
00111
00112 void clearList();
00113
00114 };
00115
00116 std::ostream& operator<< (std::ostream& os, const EdgeList& el);
00117
00118
00119 }
00120 }
00121
00122
00123
00124
00125
00126 #ifdef _MSC_VER
00127 #pragma warning(pop)
00128 #endif
00129
00130 #endif // ifndef GEOS_GEOMGRAPH_EDGELIST_H