19 #ifndef GEOS_PLANARGRAPH_PLANARGRAPH_H
20 #define GEOS_PLANARGRAPH_PLANARGRAPH_H
22 #include <geos/export.h>
23 #include <geos/planargraph/NodeMap.h>
29 #pragma warning(disable: 4251)
37 namespace planargraph {
45 namespace planargraph {
64 std::vector<Edge*> edges;
65 std::vector<DirectedEdge*> dirEdges;
103 dirEdges.push_back(dirEdge);
108 typedef std::vector<Edge*> EdgeContainer;
109 typedef EdgeContainer::iterator EdgeIterator;
129 return nodeMap.
find(pt);
136 NodeMap::container::iterator
139 return nodeMap.begin();
142 NodeMap::container::iterator
145 return nodeMap.begin();
148 NodeMap::container::const_iterator
151 return nodeMap.begin();
154 NodeMap::container::iterator
157 return nodeMap.end();
160 NodeMap::container::const_iterator
163 return nodeMap.end();
186 std::vector<DirectedEdge*>::iterator
189 return dirEdges.begin();
193 std::vector<Edge*>::iterator
196 return edges.begin();
204 std::vector<Edge*>::iterator
207 return edges.begin();
215 std::vector<Edge*>::iterator
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
Represents a directed edge in a PlanarGraph.
Definition: planargraph/DirectedEdge.h:46
Represents an undirected edge of a PlanarGraph.
Definition: planargraph/Edge.h:54
A map of Node, indexed by the coordinate of the node.
Definition: planargraph/NodeMap.h:48
Node * add(Node *n)
Adds a node to the std::map, replacing any that is already at that location.
void getNodes(std::vector< Node * > &nodes)
Returns the Nodes in this NodeMap, sorted in ascending order by angle with the positive x-axis.
Node * find(const geom::Coordinate &coord)
Returns the Node at the given location, or null if no Node was there.
A node in a PlanarGraph is a location where 0 or more Edge meet.
Definition: planargraph/Node.h:45
Represents a directed graph which is embeddable in a planar surface.
Definition: planargraph/PlanarGraph.h:60
PlanarGraph()
Constructs a PlanarGraph without any Edges, DirectedEdges, or Nodes.
Definition: planargraph/PlanarGraph.h:116
Node * findNode(const geom::Coordinate &pt)
Returns the Node at the given location, or null if no Node was there.
Definition: planargraph/PlanarGraph.h:127
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:187
std::vector< Node * > * findNodesOfDegree(std::size_t degree)
Returns all Nodes with the given number of Edges around it. The return value is a newly allocated vec...
void remove(DirectedEdge *de)
Removes DirectedEdge from its from-Node and from this PlanarGraph.
std::vector< Edge * > * getEdges()
Definition: planargraph/PlanarGraph.h:226
void add(Edge *edge)
Adds the Edge and its DirectedEdges with this PlanarGraph.
NodeMap::container::iterator nodeIterator()
Returns an Iterator over the Nodes in this PlanarGraph.
Definition: planargraph/PlanarGraph.h:137
std::vector< Edge * >::iterator edgeIterator()
Alias for edgeBegin()
Definition: planargraph/PlanarGraph.h:194
void add(DirectedEdge *dirEdge)
Adds the Edge to this PlanarGraph.
Definition: planargraph/PlanarGraph.h:101
void add(Node *node)
Adds a node to the std::map, replacing any that is already at that location.
Definition: planargraph/PlanarGraph.h:77
void remove(Edge *edge)
Removes an Edge and its associated DirectedEdges from their from-Nodes and from this PlanarGraph.
std::vector< Edge * >::iterator edgeBegin()
Returns an iterator to first Edge in this graph.
Definition: planargraph/PlanarGraph.h:205
void remove(Node *node)
Removes a node from the graph, along with any associated DirectedEdges and Edges.
std::vector< Edge * >::iterator edgeEnd()
Returns an iterator to one-past last Edge in this graph.
Definition: planargraph/PlanarGraph.h:216
void findNodesOfDegree(std::size_t degree, std::vector< Node * > &to)
Get all Nodes with the given number of Edges around it.
void getNodes(std::vector< Node * > &nodes)
Returns the Nodes in this PlanarGraph.
Definition: planargraph/PlanarGraph.h:173
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:26