geos::edgegraph::EdgeGraph Class Reference

`#include <EdgeGraph.h>`

## Public Member Functions

| EdgeGraph ()
HalfEdge * | addEdge (const geom::CoordinateXYZM &orig, const geom::CoordinateXYZM &dest)
void | getVertexEdges (std::vector< const HalfEdge * > &edgesOut)
HalfEdge * | findEdge (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

virtual HalfEdge * | createEdge (const geom::CoordinateXYZM &orig)
HalfEdge * | insert (const geom::CoordinateXYZM &orig, const geom::CoordinateXYZM &dest, HalfEdge *eAdj)

## Detailed Description

A graph comprised of `HalfEdge`s. 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

  orig | the edge origin location
  dest | the edge destination location.

Returns
  the created edge
  null if the edge was invalid and not added

See also
  isValidEdge(Coordinate, Coordinate)

## createEdge()

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

protected virtual

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

Parameters

  orig | the 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

  orig | the origin location
  dest | the 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

  orig | the edge origin location
  dest | the edge destination location
  eAdj | an existing edge with same orig (if any)

Returns
  the created edge

## isValidEdge()

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

  orig | the start coordinate
  dest | the end coordinate

Returns
  true if the edge formed is valid

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

- EdgeGraph.h