GEOS: NodeMap.h Source File

- Main Page
- Namespaces
- Classes
- Files
- Related Pages

# NodeMap.h

    00001 /**********************************************************************
    00002  * $Id: NodeMap.h 1820 2006-09-06 16:54:23Z 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/geom/Coordinate.h> // for use in container
    00021
    00022 #include <map>
    00023 #include <vector>
    00024
    00025 // Forward declarations
    00026 namespace geos {
    00027         namespace planargraph {
    00028                 class DirectedEdgeStar;
    00029                 class DirectedEdge;
    00030                 class Edge;
    00031                 class Node;
    00032         }
    00033 }
    00034
    00035 namespace geos {
    00036 namespace planargraph { // geos.planargraph
    00037
    00043 class NodeMap {
    00044 public:
    00045         typedef std::map<geom::Coordinate, Node*, geom::CoordinateLessThen> container;
    00046 private:
    00047         container nodeMap;
    00048 public:
    00052         NodeMap();
    00053
    00054         container& getNodeMap();
    00055
    00056         virtual ~NodeMap();
    00057
    00064         Node* add(Node *n);
    00065
    00071         Node* remove(geom::Coordinate& pt);
    00072
    00078         Node* find(const geom::Coordinate& coord);
    00079
    00086         container::iterator iterator() {
    00087                 return nodeMap.begin();
    00088         }
    00089
    00090         container::iterator begin() {
    00091                 return nodeMap.begin();
    00092         }
    00093         container::const_iterator begin() const {
    00094                 return nodeMap.begin();
    00095         }
    00096
    00097         container::iterator end() {
    00098                 return nodeMap.end();
    00099         }
    00100         container::const_iterator end() const {
    00101                 return nodeMap.end();
    00102         }
    00103
    00109         std::vector<Node*>* getNodes();
    00110 };
    00111
    00112
    00113 } // namespace geos::planargraph
    00114 } // namespace geos
    00115
    00116 #endif // GEOS_PLANARGRAPH_NODEMAP_H
    00117
    00118 /**********************************************************************
    00119  * $Log$
    00120  * Revision 1.1  2006/03/21 21:42:54  strk
    00121  * planargraph.h header split, planargraph:: classes renamed to match JTS symbols
    00122  *
    00123  **********************************************************************/
    00124