Class GraphComponent
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.
Inherited Members
Namespace: NetTopologySuite.Planargraph
Assembly: NetTopologySuite.dll
Syntax
public abstract class GraphComponent
Properties
| Improve this Doc View SourceData
Gets or sets user defined data for this component
Declaration
public object Data { get; set; }
Property Value
Type | Description |
---|---|
Object |
IsMarked
Tests if a component has been marked at some point during the processing involving this graph.
Declaration
public bool IsMarked { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsRemoved
Tests whether this component has been removed from its containing graph.
Declaration
public abstract bool IsRemoved { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsVisited
Tests if a component has been visited during the course of a graph algorithm.
Declaration
public bool IsVisited { get; }
Property Value
Type | Description |
---|---|
Boolean |
Marked
Gets/Sets the marked flag for this component.
Declaration
public bool Marked { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Visited
Gets/Sets the visited flag for this component.
Declaration
public bool Visited { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
| Improve this Doc View SourceGetComponentWithVisitedState(IEnumerator, Boolean)
Finds the first GraphComponent in a IEnumerator set which has the specified Visited state.
Declaration
public static GraphComponent GetComponentWithVisitedState(IEnumerator i, bool visitedState)
Parameters
Type | Name | Description |
---|---|---|
IEnumerator | i | A IEnumerator to scan. |
Boolean | visitedState | The Visited state to test. |
Returns
Type | Description |
---|---|
GraphComponent | The first GraphComponent found, or |
SetMarked(IEnumerator, Boolean)
Sets the Marked state for all GraphComponents in an IEnumerator.
Declaration
public static void SetMarked(IEnumerator i, bool marked)
Parameters
Type | Name | Description |
---|---|---|
IEnumerator | i | A IEnumerator to scan. |
Boolean | marked | The state to set the Marked flag to. |
SetVisited(IEnumerator, Boolean)
Sets the Visited state for all GraphComponents in an IEnumerator.
Declaration
public static void SetVisited(IEnumerator i, bool visited)
Parameters
Type | Name | Description |
---|---|---|
IEnumerator | i | A IEnumerator to scan. |
Boolean | visited | The state to set the Visited flag to. |