Class GraphComponent
- Namespace
- NetTopologySuite.Planargraph
- Assembly
- NetTopologySuite.dll
The base class for all graph component classes. Maintains flags of use in generic graph algorithms. Provides two flags: marked - typically this is used to indicate a state that persists for the course of the graph's lifetime. For instance, it can be used to indicate that a component has been logically deleted from the graph. visited - this is used to indicate that a component has been processed or visited by an single graph algorithm. For instance, a breadth-first traversal of the graph might use this to indicate that a node has already been traversed. The visited flag may be set and cleared many times during the lifetime of a graph.
public abstract class GraphComponent
- Inheritance
-
GraphComponent
- Derived
- Inherited Members
Constructors
GraphComponent()
protected GraphComponent()
Properties
Data
Gets or sets user defined data for this component
public object Data { get; set; }
Property Value
IsMarked
Tests if a component has been marked at some point during the processing involving this graph.
public bool IsMarked { get; }
Property Value
IsRemoved
Tests whether this component has been removed from its containing graph.
public abstract bool IsRemoved { get; }
Property Value
IsVisited
Tests if a component has been visited during the course of a graph algorithm.
public bool IsVisited { get; }
Property Value
Marked
Gets/Sets the marked flag for this component.
public bool Marked { get; set; }
Property Value
Visited
Gets/Sets the visited flag for this component.
public bool Visited { get; set; }
Property Value
Methods
GetComponentWithVisitedState(IEnumerator, bool)
Finds the first GraphComponent in a IEnumerator set which has the specified Visited state.
public static GraphComponent GetComponentWithVisitedState(IEnumerator i, bool visitedState)
Parameters
i
IEnumeratorA IEnumerator to scan.
visitedState
boolThe Visited state to test.
Returns
- GraphComponent
The first GraphComponent found, or
null
if none found.
SetMarked(IEnumerator, bool)
Sets the Marked state for all GraphComponents in an IEnumerator.
public static void SetMarked(IEnumerator i, bool marked)
Parameters
i
IEnumeratorA IEnumerator to scan.
marked
boolThe state to set the Marked flag to.
SetVisited(IEnumerator, bool)
Sets the Visited state for all GraphComponents in an IEnumerator.
public static void SetVisited(IEnumerator i, bool visited)
Parameters
i
IEnumeratorA IEnumerator to scan.
visited
boolThe state to set the Visited flag to.