Table of Contents

Class PlanarGraph

Namespace
NetTopologySuite.Planargraph
Assembly
NetTopologySuite.dll

Represents a directed graph which is embeddable in a planar surface. This class and the other classes in this package serve as a framework for building planar graphs for specific algorithms. This class must be subclassed to expose appropriate methods to construct the graph. This allows controlling the types of graph components ({DirectedEdge}s, Edges and Nodes) which can be added to the graph. An application which uses the graph framework will almost always provide subclasses for one or more graph components, which hold application-specific data and graph algorithms.

public abstract class PlanarGraph
Inheritance
PlanarGraph
Derived
Inherited Members

Constructors

PlanarGraph()

protected PlanarGraph()

Fields

dirEdges

protected IList<DirectedEdge> dirEdges

Field Value

IList<DirectedEdge>

nodeMap

protected NodeMap nodeMap

Field Value

NodeMap

Properties

Edges

Returns the Edges that have been added to this PlanarGraph.

public IList<Edge> Edges { get; protected set; }

Property Value

IList<Edge>

Nodes

Returns the Nodes in this PlanarGraph.

public ICollection<Node> Nodes { get; }

Property Value

ICollection<Node>

Methods

Add(DirectedEdge)

Adds the Edge to this PlanarGraph; only subclasses can add DirectedEdges, to ensure the edges added are of the right class.

protected void Add(DirectedEdge dirEdge)

Parameters

dirEdge DirectedEdge

Add(Edge)

Adds the Edge and its DirectedEdges with this PlanarGraph. Assumes that the Edge has already been created with its associated DirectEdges. Only subclasses can add Edges, to ensure the edges added are of the right class.

protected void Add(Edge edge)

Parameters

edge Edge

Add(Node)

Adds a node to the map, replacing any that is already at that location. Only subclasses can add Nodes, to ensure Nodes are of the right type.

protected void Add(Node node)

Parameters

node Node

FindNode(Coordinate)

Returns the Node at the given pt, or null if no Node was there.

public Node FindNode(Coordinate pt)

Parameters

pt Coordinate

The location

Returns

Node

The node found
or null if this graph contains no node at the location

FindNodesOfDegree(int)

Returns all Nodes with the given number of Edges around it.

public IList<Node> FindNodesOfDegree(int degree)

Parameters

degree int

Returns

IList<Node>

GetDirEdgeEnumerator()

Returns an Iterator over the DirectedEdges in this PlanarGraph, in the order in which they were added.

public IEnumerator<DirectedEdge> GetDirEdgeEnumerator()

Returns

IEnumerator<DirectedEdge>

GetEdgeEnumerator()

Returns an Iterator over the Edges in this PlanarGraph, in the order in which they were added.

public IEnumerator<Edge> GetEdgeEnumerator()

Returns

IEnumerator<Edge>

GetNodeEnumerator()

Returns an IEnumerator over the Nodes in this PlanarGraph.

public IEnumerator<Node> GetNodeEnumerator()

Returns

IEnumerator<Node>

Remove(DirectedEdge)

Removes a DirectedEdge from its from-Node and from this PlanarGraph.

public void Remove(DirectedEdge de)

Parameters

de DirectedEdge

Remarks

This method does not remove the Nodes associated with the DirectedEdge, even if the removal of the DirectedEdge reduces the degree of a Node to zero.

Remove(Edge)

Removes an Edge and its associated DirectedEdges from their from-Nodes and from this PlanarGraph. Note: This method does not remove the Nodes associated with the Edge, even if the removal of the Edge reduces the degree of a Node to zero.

public void Remove(Edge edge)

Parameters

edge Edge

Remove(Node)

Removes a node from the graph, along with any associated DirectedEdges and Edges.

public void Remove(Node node)

Parameters

node Node