GEOS
3.6.2
|
00001 /********************************************************************** 00002 * 00003 * GEOS - Geometry Engine Open Source 00004 * http://geos.osgeo.org 00005 * 00006 * Copyright (C) 2001-2002 Vivid Solutions Inc. 00007 * Copyright (C) 2005-2006 Refractions Research Inc. 00008 * 00009 * This is free software; you can redistribute and/or modify it under 00010 * the terms of the GNU Lesser General Public Licence as published 00011 * by the Free Software Foundation. 00012 * See the COPYING file for more information. 00013 * 00014 **********************************************************************/ 00015 00016 #ifndef GEOS_PLANARGRAPH_NODEMAP_H 00017 #define GEOS_PLANARGRAPH_NODEMAP_H 00018 00019 #include <geos/export.h> 00020 #include <geos/geom/Coordinate.h> // for use in container 00021 00022 #include <map> 00023 #include <vector> 00024 00025 #ifdef _MSC_VER 00026 #pragma warning(push) 00027 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class 00028 #endif 00029 00030 // Forward declarations 00031 namespace geos { 00032 namespace planargraph { 00033 class DirectedEdgeStar; 00034 class DirectedEdge; 00035 class Edge; 00036 class Node; 00037 } 00038 } 00039 00040 namespace geos { 00041 namespace planargraph { // geos.planargraph 00042 00048 class GEOS_DLL NodeMap { 00049 public: 00050 typedef std::map<geom::Coordinate, Node*, geom::CoordinateLessThen> container; 00051 private: 00052 container nodeMap; 00053 public: 00057 NodeMap(); 00058 00059 container& getNodeMap(); 00060 00061 virtual ~NodeMap(); 00062 00069 Node* add(Node *n); 00070 00076 Node* remove(geom::Coordinate& pt); 00077 00083 Node* find(const geom::Coordinate& coord); 00084 00091 container::iterator iterator() { 00092 return nodeMap.begin(); 00093 } 00094 00095 container::iterator begin() { 00096 return nodeMap.begin(); 00097 } 00098 container::const_iterator begin() const { 00099 return nodeMap.begin(); 00100 } 00101 00102 container::iterator end() { 00103 return nodeMap.end(); 00104 } 00105 container::const_iterator end() const { 00106 return nodeMap.end(); 00107 } 00108 00116 void getNodes(std::vector<Node*>& nodes); 00117 }; 00118 00119 00120 } // namespace geos::planargraph 00121 } // namespace geos 00122 00123 #ifdef _MSC_VER 00124 #pragma warning(pop) 00125 #endif 00126 00127 #endif // GEOS_PLANARGRAPH_NODEMAP_H