GEOS  3.13.0dev
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
geos::edgegraph::EdgeGraph Class Reference

#include <EdgeGraph.h>

Public Member Functions

 EdgeGraph ()
 
HalfEdgeaddEdge (const geom::CoordinateXYZM &orig, const geom::CoordinateXYZM &dest)
 
void getVertexEdges (std::vector< const HalfEdge * > &edgesOut)
 
HalfEdgefindEdge (const geom::CoordinateXY &orig, const geom::CoordinateXY &dest)
 

Static Public Member Functions

static bool isValidEdge (const geom::CoordinateXY &orig, const geom::CoordinateXY &dest)
 

Protected Member Functions

HalfEdgecreateEdge (const geom::CoordinateXYZM &orig)
 
HalfEdgeinsert (const geom::CoordinateXYZM &orig, const geom::CoordinateXYZM &dest, HalfEdge *eAdj)
 

Detailed Description

A graph comprised of HalfEdges. It supports tracking the vertices in the graph via edges incident on them, to allow efficient lookup of edges and vertices.

This class may be subclassed to use a different subclass of HalfEdge, by overriding createEdge. If additional logic is required to initialize edges then addEdge can be overridden as well.

Author
Martin Davis

Constructor & Destructor Documentation

◆ EdgeGraph()

geos::edgegraph::EdgeGraph::EdgeGraph ( )
inline

Initialized

Member Function Documentation

◆ addEdge()

HalfEdge* geos::edgegraph::EdgeGraph::addEdge ( const geom::CoordinateXYZM &  orig,
const geom::CoordinateXYZM &  dest 
)

Adds an edge between the coordinates orig and dest to this graph. Only valid edges can be added (in particular, zero-length segments cannot be added)

Parameters
origthe edge origin location
destthe edge destination location.
Returns
the created edge
null if the edge was invalid and not added
See also
isValidEdge(Coordinate, Coordinate)

◆ createEdge()

HalfEdge* geos::edgegraph::EdgeGraph::createEdge ( const geom::CoordinateXYZM &  orig)
protected

Creates a single HalfEdge. Override to use a different HalfEdge subclass.

Parameters
origthe origin location
Returns
a new HalfEdge with the given origin

◆ findEdge()

HalfEdge* geos::edgegraph::EdgeGraph::findEdge ( const geom::CoordinateXY &  orig,
const geom::CoordinateXY &  dest 
)

Finds an edge in this graph with the given origin and destination, if one exists.

Parameters
origthe origin location
destthe destination location.
Returns
an edge with the given orig and dest, or null if none exists

◆ insert()

HalfEdge* geos::edgegraph::EdgeGraph::insert ( const geom::CoordinateXYZM &  orig,
const geom::CoordinateXYZM &  dest,
HalfEdge eAdj 
)
protected

Inserts an edge not already present into the graph.

Parameters
origthe edge origin location
destthe edge destination location
eAdjan existing edge with same orig (if any)
Returns
the created edge

◆ isValidEdge()

static bool geos::edgegraph::EdgeGraph::isValidEdge ( const geom::CoordinateXY &  orig,
const geom::CoordinateXY &  dest 
)
static

Tests if the given coordinates form a valid edge (with non-zero length).

Parameters
origthe start coordinate
destthe end coordinate
Returns
true if the edge formed is valid

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