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,
Edge
s and Node
s) 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
nodeMap
protected NodeMap nodeMap
Field Value
Properties
Edges
Returns the Edges that have been added to this PlanarGraph.
public IList<Edge> Edges { get; protected set; }
Property Value
Nodes
Returns the Nodes in this PlanarGraph.
public ICollection<Node> Nodes { get; }
Property Value
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)
public Node FindNode(Coordinate pt)
Parameters
pt
CoordinateThe location
Returns
- Node
The node found
ornull
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
GetDirEdgeEnumerator()
Returns an Iterator over the DirectedEdges in this PlanarGraph, in the order in which they were added.
public IEnumerator<DirectedEdge> GetDirEdgeEnumerator()
Returns
GetEdgeEnumerator()
Returns an Iterator over the Edges in this PlanarGraph, in the order in which they were added.
public IEnumerator<Edge> GetEdgeEnumerator()
Returns
GetNodeEnumerator()
Returns an IEnumerator over the Nodes in this PlanarGraph.
public IEnumerator<Node> GetNodeEnumerator()
Returns
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