GEOS 3.13.1
geos::geomgraph::PlanarGraph Class Reference

Represents a directed graph which is embeddable in a planar surface. More...

#include <PlanarGraph.h>

Inheritance diagram for geos::geomgraph::PlanarGraph:
geos::geomgraph::GeometryGraph

Public Member Functions

 PlanarGraph (const NodeFactory &nodeFact)
std::vector< Edge * >::iterator getEdgeIterator ()
std::vector< EdgeEnd * > * getEdgeEnds ()
bool isBoundaryNode (uint8_t geomIndex, const geom::Coordinate &coord)
void add (EdgeEnd *e)
NodeMap::iterator getNodeIterator ()
void getNodes (std::vector< Node * > &)
NodeaddNode (Node *node)
NodeaddNode (const geom::Coordinate &coord)
Nodefind (geom::Coordinate &coord)
void addEdges (const std::vector< Edge * > &edgesToAdd)
 Add a set of edges to the graph. For each edge two DirectedEdges will be created. DirectedEdges are NOT linked by this method.
void linkResultDirectedEdges ()
void linkAllDirectedEdges ()
EdgeEndfindEdgeEnd (Edge *e)
 Returns the EdgeEnd which has edge e as its base edge (MD 18 Feb 2002 - this should return a pair of edges)
EdgefindEdge (const geom::Coordinate &p0, const geom::Coordinate &p1)
 Returns the edge whose first two coordinates are p0 and p1.
EdgefindEdgeInSameDirection (const geom::Coordinate &p0, const geom::Coordinate &p1)
 Returns the edge which starts at p0 and whose first segment is parallel to p1.
std::string printEdges ()
NodeMap * getNodeMap ()

Static Public Member Functions

template<typename It>
static void linkResultDirectedEdges (It first, It last)
 For nodes in the collection (first..last), link the DirectedEdges at the node that are in the result.

Protected Member Functions

void insertEdge (Edge *e)

Protected Attributes

std::vector< Edge * > * edges
NodeMap * nodes
std::vector< EdgeEnd * > * edgeEndList

Detailed Description

Represents a directed graph which is embeddable in a planar surface.

The computation of the IntersectionMatrix relies on the use of a structure called a "topology graph". The topology graph contains nodes and edges corresponding to the nodes and line segments of a Geometry. Each node and edge in the graph is labeled with its topological location relative to the source geometry.

Note that there is no requirement that points of self-intersection be a vertex. Thus to obtain a correct topology graph, Geometry objects must be self-noded before constructing their graphs.

Two fundamental operations are supported by topology graphs:

  • Computing the intersections between all the edges and nodes of a single graph
  • Computing the intersections between the edges and nodes of two different graphs

Member Function Documentation

◆ find()

Node * geos::geomgraph::PlanarGraph::find ( geom::Coordinate & coord)
Returns
the node if found; null otherwise

◆ findEdge()

Edge * geos::geomgraph::PlanarGraph::findEdge ( const geom::Coordinate & p0,
const geom::Coordinate & p1 )

Returns the edge whose first two coordinates are p0 and p1.

Returns
the edge, if found null if the edge was not found

◆ findEdgeEnd()

EdgeEnd * geos::geomgraph::PlanarGraph::findEdgeEnd ( Edge * e)

Returns the EdgeEnd which has edge e as its base edge (MD 18 Feb 2002 - this should return a pair of edges)

Returns
the edge, if found null if the edge was not found

◆ findEdgeInSameDirection()

Edge * geos::geomgraph::PlanarGraph::findEdgeInSameDirection ( const geom::Coordinate & p0,
const geom::Coordinate & p1 )

Returns the edge which starts at p0 and whose first segment is parallel to p1.

Returns
the edge, if found null if the edge was not found

◆ linkResultDirectedEdges()

template<typename It>
void geos::geomgraph::PlanarGraph::linkResultDirectedEdges ( It first,
It last )
inlinestatic

For nodes in the collection (first..last), link the DirectedEdges at the node that are in the result.

This allows clients to link only a subset of nodes in the graph, for efficiency (because they know that only a subset is of interest).

References geos::geomgraph::DirectedEdgeStar::linkResultDirectedEdges().

Referenced by addEdges().


The documentation for this class was generated from the following file: