Table of Contents

Class Subgraph

Namespace
NetTopologySuite.Planargraph
Assembly
NetTopologySuite.dll

A subgraph of a PlanarGraph. A subgraph may contain any subset of Edges from the parent graph. It will also automatically contain all DirectedEdges and Nodes associated with those edges. No new objects are created when edges are added - all associated components must already exist in the parent graph.

public class Subgraph
Inheritance
Subgraph
Inherited Members

Constructors

Subgraph(PlanarGraph)

Creates a new subgraph of the given PlanarGraph.

public Subgraph(PlanarGraph parentGraph)

Parameters

parentGraph PlanarGraph

Fields

dirEdges

protected IList<DirectedEdge> dirEdges

Field Value

IList<DirectedEdge>

edges

protected HashSet<Edge> edges

Field Value

HashSet<Edge>

nodeMap

protected NodeMap nodeMap

Field Value

NodeMap

parentGraph

protected PlanarGraph parentGraph

Field Value

PlanarGraph

Methods

Add(Edge)

Adds an Edge to the subgraph. The associated DirectedEdges and Nodes are also added.

public void Add(Edge e)

Parameters

e Edge

The Edge to add.

Contains(Edge)

Tests whether an Edge is contained in this subgraph.

public bool Contains(Edge e)

Parameters

e Edge

The Edge to test.

Returns

bool

true if the Edge is contained in this subgraph.

GetDirEdgeEnumerator()

Returns an IEnumerator<T> over the DirectedEdges in this graph, in the order in which they were added.

public IEnumerator<DirectedEdge> GetDirEdgeEnumerator()

Returns

IEnumerator<DirectedEdge>

GetEdgeEnumerator()

Returns an IEnumerator<T> over the Edges in this graph, in the order in which they were added.

public IEnumerator<Edge> GetEdgeEnumerator()

Returns

IEnumerator<Edge>

GetNodeEnumerator()

Returns an IEnumerator<T> over the Nodes in this graph.

public IEnumerator<Node> GetNodeEnumerator()

Returns

IEnumerator<Node>

GetParent()

Gets the PlanarGraph which this subgraph is part of.

public PlanarGraph GetParent()

Returns

PlanarGraph