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