22 #ifndef GEOS_GEOMGRAPH_NODEMAP_H
23 #define GEOS_GEOMGRAPH_NODEMAP_H
25 #include <geos/export.h>
30 #include <geos/geom/Coordinate.h>
31 #include <geos/geomgraph/Node.h>
33 #include <geos/inline.h>
37 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
52 class GEOS_DLL NodeMap{
55 typedef std::map<geom::Coordinate*,Node*,geom::CoordinateLessThen> container;
57 typedef container::iterator iterator;
59 typedef container::const_iterator const_iterator;
61 typedef std::pair<geom::Coordinate*,Node*> pair;
65 const NodeFactory &nodeFact;
70 NodeMap(
const NodeFactory &newNodeFact);
74 Node* addNode(
const geom::Coordinate& coord);
76 Node* addNode(Node *n);
80 Node *find(
const geom::Coordinate& coord)
const;
82 const_iterator begin()
const {
return nodeMap.begin(); }
84 const_iterator end()
const {
return nodeMap.end(); }
86 iterator begin() {
return nodeMap.begin(); }
88 iterator end() {
return nodeMap.end(); }
90 void getBoundaryNodes(
int geomIndex,
91 std::vector<Node*>&bdyNodes)
const;
93 std::string print()
const;
99 for (iterator it=begin(), itEnd=end(); it != itEnd; ++it)
102 geomgraph::Node* n = p.second;
103 geom::Coordinate* c =
const_cast<geom::Coordinate*
>(
104 &(n->getCoordinate())
106 assert(p.first == c);
114 NodeMap(
const NodeMap& other);
115 NodeMap& operator=(
const NodeMap& rhs);
129 #endif // ifndef GEOS_GEOMGRAPH_NODEMAP_H