• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List

NodeMap.h

00001 /**********************************************************************
00002  * $Id: NodeMap.h 2733 2009-11-20 19:58:33Z strk $
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 // Forward declarations
00027 namespace geos {
00028         namespace planargraph { 
00029                 class DirectedEdgeStar;
00030                 class DirectedEdge;
00031                 class Edge;
00032                 class Node;
00033         }
00034 }
00035 
00036 namespace geos {
00037 namespace planargraph { // geos.planargraph
00038 
00044 class GEOS_DLL NodeMap {
00045 public:
00046         typedef std::map<geom::Coordinate, Node*, geom::CoordinateLessThen> container;
00047 private:
00048         container nodeMap;
00049 public:  
00053         NodeMap();
00054 
00055         container& getNodeMap();
00056 
00057         virtual ~NodeMap();
00058 
00065         Node* add(Node *n);
00066 
00072         Node* remove(geom::Coordinate& pt);
00073 
00079         Node* find(const geom::Coordinate& coord);
00080 
00087         container::iterator iterator() {
00088                 return nodeMap.begin();
00089         }
00090 
00091         container::iterator begin() {
00092                 return nodeMap.begin();
00093         }
00094         container::const_iterator begin() const {
00095                 return nodeMap.begin();
00096         }
00097 
00098         container::iterator end() {
00099                 return nodeMap.end();
00100         }
00101         container::const_iterator end() const {
00102                 return nodeMap.end();
00103         }
00104 
00112         void getNodes(std::vector<Node*>& nodes);
00113 };
00114 
00115 
00116 } // namespace geos::planargraph
00117 } // namespace geos
00118 
00119 #endif // GEOS_PLANARGRAPH_NODEMAP_H
00120 
00121 /**********************************************************************
00122  * $Log$
00123  * Revision 1.1  2006/03/21 21:42:54  strk
00124  * planargraph.h header split, planargraph:: classes renamed to match JTS symbols
00125  *
00126  **********************************************************************/
00127 

Generated on Thu Jul 22 2010 for GEOS by  doxygen 1.7.1