20 #ifndef GEOS_PLANARGRAPH_PLANARGRAPH_H
21 #define GEOS_PLANARGRAPH_PLANARGRAPH_H
23 #include <geos/export.h>
24 #include <geos/planargraph/NodeMap.h>
30 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
38 namespace planargraph {
46 namespace planargraph {
65 std::vector<Edge*> edges;
66 std::vector<DirectedEdge*> dirEdges;
101 dirEdges.push_back(dirEdge);
106 typedef std::vector<Edge *> EdgeContainer;
107 typedef EdgeContainer::iterator EdgeIterator;
124 return nodeMap.find(pt);
132 return nodeMap.begin();
135 NodeMap::container::iterator nodeBegin() {
136 return nodeMap.begin();
139 NodeMap::container::const_iterator nodeBegin()
const {
140 return nodeMap.begin();
143 NodeMap::container::iterator nodeEnd() {
144 return nodeMap.end();
147 NodeMap::container::const_iterator nodeEnd()
const {
148 return nodeMap.end();
157 void getNodes(std::vector<Node*>& nodes) { nodeMap.getNodes(nodes); }
168 return dirEdges.begin();
173 return edges.begin();
182 return edges.begin();
212 void remove(
Edge *edge);
230 void remove(
Node *node);
237 std::vector<Node*>* findNodesOfDegree(std::size_t degree);
245 void findNodesOfDegree(std::size_t degree, std::vector<Node*>& to);
255 #endif // GEOS_PLANARGRAPH_PLANARGRAPH_H
void getNodes(std::vector< Node * > &nodes)
Returns the Nodes in this PlanarGraph.
Definition: planargraph/PlanarGraph.h:157
std::vector< DirectedEdge * >::iterator dirEdgeIterator()
Returns an Iterator over the DirectedEdges in this PlanarGraph, in the order in which they were added...
Definition: planargraph/PlanarGraph.h:167
std::vector< Edge * >::iterator edgeEnd()
Returns an iterator to one-past last Edge in this graph.
Definition: planargraph/PlanarGraph.h:190
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:61
Represents a directed edge in a PlanarGraph.
Definition: planargraph/DirectedEdge.h:47
void add(Node *node)
Adds a node to the std::map, replacing any that is already at that location.
Definition: planargraph/PlanarGraph.h:78
std::vector< Edge * > * getEdges()
Returns the Edges that have been added to this PlanarGraph.
Definition: planargraph/PlanarGraph.h:199
void add(DirectedEdge *dirEdge)
Adds the Edge to this PlanarGraph.
Definition: planargraph/PlanarGraph.h:100
Represents an undirected edge of a PlanarGraph.
Definition: planargraph/Edge.h:55
std::vector< Edge * >::iterator edgeIterator()
Alias for edgeBegin()
Definition: planargraph/PlanarGraph.h:172
std::vector< Edge * >::iterator edgeBegin()
Returns an iterator to first Edge in this graph.
Definition: planargraph/PlanarGraph.h:181
A node in a PlanarGraph is a location where 0 or more Edge meet.
Definition: planargraph/Node.h:46
NodeMap::container::iterator nodeIterator()
Returns an Iterator over the Nodes in this PlanarGraph.
Definition: planargraph/PlanarGraph.h:131
Node * findNode(const geom::Coordinate &pt)
Returns the Node at the given location, or null if no Node was there.
Definition: planargraph/PlanarGraph.h:123
A map of Node, indexed by the coordinate of the node.
Definition: planargraph/NodeMap.h:49
PlanarGraph()
Constructs a PlanarGraph without any Edges, DirectedEdges, or Nodes.
Definition: planargraph/PlanarGraph.h:114
Represents a directed graph which is embeddable in a planar surface.
Definition: planargraph/PlanarGraph.h:61