NetTopologySuite
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
NetTopologySuite.Planargraph.PlanarGraph Class Reference

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

Inheritance diagram for NetTopologySuite.Planargraph.PlanarGraph:
NetTopologySuite.Operation.Linemerge.LineMergeGraph NetTopologySuite.Operation.Polygonize.PolygonizeGraph

Public Member Functions

Node FindNode (Coordinate pt)
 Returns the Node at the given pt location, or nullif no Node was there. More...
 
IEnumerator< NodeGetNodeEnumerator ()
 Returns an IEnumerator over the Nodes in this PlanarGraph. More...
 
IEnumerator< DirectedEdgeGetDirEdgeEnumerator ()
 Returns an Iterator over the DirectedEdges in this PlanarGraph, in the order in which they were added. More...
 
IEnumerator< EdgeGetEdgeEnumerator ()
 Returns an Iterator over the Edges in this PlanarGraph, in the order in which they were added. More...
 
void Remove (Edge 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. More...
 
void Remove (DirectedEdge de)
 Removes a DirectedEdge from its from-Node and from this PlanarGraph. More...
 
void Remove (Node node)
 Removes a node from the graph, along with any associated DirectedEdges and Edges. More...
 
IList< NodeFindNodesOfDegree (int degree)
 Returns all Nodes with the given number of Edges around it. More...
 

Protected Member Functions

void Add (Node 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. More...
 
void Add (Edge 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. More...
 
void Add (DirectedEdge dirEdge)
 Adds the Edge to this PlanarGraph; only subclasses can add DirectedEdges, to ensure the edges added are of the right class. More...
 

Protected Attributes

IList< DirectedEdgedirEdges = new List<DirectedEdge>()
 
NodeMap nodeMap = new NodeMap()
 

Properties

ICollection< NodeNodes [get]
 Returns the Nodes in this PlanarGraph. More...
 
IList< EdgeEdges [get, protected set]
 Returns the Edges that have been added to this PlanarGraph. More...
 

Detailed Description

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.

Member Function Documentation

void NetTopologySuite.Planargraph.PlanarGraph.Add ( Node  node)
protected

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.

Parameters
node
Returns
The added node.
void NetTopologySuite.Planargraph.PlanarGraph.Add ( Edge  edge)
protected

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.

Parameters
edge
void NetTopologySuite.Planargraph.PlanarGraph.Add ( DirectedEdge  dirEdge)
protected

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

Parameters
dirEdge
Node NetTopologySuite.Planargraph.PlanarGraph.FindNode ( Coordinate  pt)

Returns the Node at the given pt location, or nullif no Node was there.

Parameters
ptThe location
Returns
The node found
or null if this graph contains no node at the location
IList<Node> NetTopologySuite.Planargraph.PlanarGraph.FindNodesOfDegree ( int  degree)

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

Parameters
degree
Returns
IEnumerator<DirectedEdge> NetTopologySuite.Planargraph.PlanarGraph.GetDirEdgeEnumerator ( )

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

Returns
IEnumerator<Edge> NetTopologySuite.Planargraph.PlanarGraph.GetEdgeEnumerator ( )

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

Returns
IEnumerator<Node> NetTopologySuite.Planargraph.PlanarGraph.GetNodeEnumerator ( )

Returns an IEnumerator over the Nodes in this PlanarGraph.

Returns
void NetTopologySuite.Planargraph.PlanarGraph.Remove ( Edge  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.

Parameters
edge
void NetTopologySuite.Planargraph.PlanarGraph.Remove ( DirectedEdge  de)

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

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.

Parameters
de
void NetTopologySuite.Planargraph.PlanarGraph.Remove ( Node  node)

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

Parameters
node

Member Data Documentation

IList<DirectedEdge> NetTopologySuite.Planargraph.PlanarGraph.dirEdges = new List<DirectedEdge>()
protected

NodeMap NetTopologySuite.Planargraph.PlanarGraph.nodeMap = new NodeMap()
protected

Property Documentation

IList<Edge> NetTopologySuite.Planargraph.PlanarGraph.Edges
getprotected set

Returns the Edges that have been added to this PlanarGraph.

ICollection<Node> NetTopologySuite.Planargraph.PlanarGraph.Nodes
get

Returns the Nodes in this PlanarGraph.


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