GEOS  3.9.1dev
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
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:
[legend]
Collaboration diagram for geos::geomgraph::PlanarGraph:
[legend]

Public Member Functions

 PlanarGraph (const NodeFactory &nodeFact)
 
 PlanarGraph ()
 
virtual ~PlanarGraph ()
 
virtual std::vector< Edge * >::iterator getEdgeIterator ()
 
virtual std::vector< EdgeEnd * > * getEdgeEnds ()
 
virtual bool isBoundaryNode (int geomIndex, const geom::Coordinate &coord)
 
virtual void add (EdgeEnd *e)
 
virtual NodeMap::iterator getNodeIterator ()
 
virtual void getNodes (std::vector< Node * > &)
 
virtual NodeaddNode (Node *node)
 
virtual NodeaddNode (const geom::Coordinate &coord)
 
virtual Nodefind (geom::Coordinate &coord)
 
virtual 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. More...
 
virtual void linkResultDirectedEdges ()
 
virtual void linkAllDirectedEdges ()
 
virtual 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) More...
 
virtual EdgefindEdge (const geom::Coordinate &p0, const geom::Coordinate &p1)
 Returns the edge whose first two coordinates are p0 and p1. More...
 
virtual EdgefindEdgeInSameDirection (const geom::Coordinate &p0, const geom::Coordinate &p1)
 Returns the edge which starts at p0 and whose first segment is parallel to p1. More...
 
virtual std::string printEdges ()
 
virtual NodeMapgetNodeMap ()
 

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. More...
 

Protected Member Functions

virtual void insertEdge (Edge *e)
 

Protected Attributes

std::vector< Edge * > * edges
 
NodeMapnodes
 
std::vector< EdgeEnd * > * edgeEndList
 

Private Member Functions

bool matchInSameDirection (const geom::Coordinate &p0, const geom::Coordinate &p1, const geom::Coordinate &ep0, const geom::Coordinate &ep1)
 The coordinate pairs match if they define line segments lying in the same direction. More...
 
 PlanarGraph (const PlanarGraph &)=delete
 
PlanarGraphoperator= (const PlanarGraph &)=delete
 

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:

Definition at line 75 of file geomgraph/PlanarGraph.h.

Constructor & Destructor Documentation

geos::geomgraph::PlanarGraph::PlanarGraph ( const NodeFactory nodeFact)
geos::geomgraph::PlanarGraph::PlanarGraph ( )
virtual geos::geomgraph::PlanarGraph::~PlanarGraph ( )
virtual
geos::geomgraph::PlanarGraph::PlanarGraph ( const PlanarGraph )
privatedelete

Member Function Documentation

virtual void geos::geomgraph::PlanarGraph::add ( EdgeEnd e)
virtual
virtual void geos::geomgraph::PlanarGraph::addEdges ( const std::vector< Edge * > &  edgesToAdd)
virtual

Add a set of edges to the graph. For each edge two DirectedEdges will be created. DirectedEdges are NOT linked by this method.

virtual Node* geos::geomgraph::PlanarGraph::addNode ( Node node)
virtual
virtual Node* geos::geomgraph::PlanarGraph::addNode ( const geom::Coordinate coord)
virtual
virtual Node* geos::geomgraph::PlanarGraph::find ( geom::Coordinate coord)
virtual
Returns
the node if found; null otherwise
virtual Edge* geos::geomgraph::PlanarGraph::findEdge ( const geom::Coordinate p0,
const geom::Coordinate p1 
)
virtual

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

Returns
the edge, if found null if the edge was not found
virtual EdgeEnd* geos::geomgraph::PlanarGraph::findEdgeEnd ( Edge e)
virtual

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
virtual Edge* geos::geomgraph::PlanarGraph::findEdgeInSameDirection ( const geom::Coordinate p0,
const geom::Coordinate p1 
)
virtual

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
virtual std::vector<EdgeEnd*>* geos::geomgraph::PlanarGraph::getEdgeEnds ( )
virtual
virtual std::vector<Edge*>::iterator geos::geomgraph::PlanarGraph::getEdgeIterator ( )
virtual
virtual NodeMap::iterator geos::geomgraph::PlanarGraph::getNodeIterator ( )
virtual
virtual NodeMap* geos::geomgraph::PlanarGraph::getNodeMap ( )
virtual
virtual void geos::geomgraph::PlanarGraph::getNodes ( std::vector< Node * > &  )
virtual
virtual void geos::geomgraph::PlanarGraph::insertEdge ( Edge e)
protectedvirtual
virtual bool geos::geomgraph::PlanarGraph::isBoundaryNode ( int  geomIndex,
const geom::Coordinate coord 
)
virtual
virtual void geos::geomgraph::PlanarGraph::linkAllDirectedEdges ( )
virtual
template<typename It >
static 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).

Definition at line 88 of file geomgraph/PlanarGraph.h.

References geos::geomgraph::Node::getEdges(), and geos::geomgraph::DirectedEdgeStar::linkResultDirectedEdges().

Here is the call graph for this function:

virtual void geos::geomgraph::PlanarGraph::linkResultDirectedEdges ( )
virtual
bool geos::geomgraph::PlanarGraph::matchInSameDirection ( const geom::Coordinate p0,
const geom::Coordinate p1,
const geom::Coordinate ep0,
const geom::Coordinate ep1 
)
private

The coordinate pairs match if they define line segments lying in the same direction.

E.g. the segments are parallel and in the same quadrant (as opposed to parallel and opposite!).

PlanarGraph& geos::geomgraph::PlanarGraph::operator= ( const PlanarGraph )
privatedelete
virtual std::string geos::geomgraph::PlanarGraph::printEdges ( )
virtual

Member Data Documentation

std::vector<EdgeEnd*>* geos::geomgraph::PlanarGraph::edgeEndList
protected

Definition at line 180 of file geomgraph/PlanarGraph.h.

std::vector<Edge*>* geos::geomgraph::PlanarGraph::edges
protected

Definition at line 176 of file geomgraph/PlanarGraph.h.

NodeMap* geos::geomgraph::PlanarGraph::nodes
protected

Definition at line 178 of file geomgraph/PlanarGraph.h.


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