Class Edge
Represents an undirected edge of a {PlanarGraph}. An undirected edge
in fact simply acts as a central point of reference for two opposite
DirectedEdge
s.
Usually a client using a PlanarGraph
will subclass Edge
to add its own application-specific data and methods.
Inherited Members
Namespace: NetTopologySuite.Planargraph
Assembly: NetTopologySuite.dll
Syntax
public class Edge : GraphComponent
Constructors
| Improve this Doc View SourceEdge()
Constructs an Edge whose DirectedEdges are not yet set. Be sure to call
SetDirectedEdges(DirectedEdge, DirectedEdge)
.
Declaration
public Edge()
Edge(DirectedEdge, DirectedEdge)
Constructs an Edge initialized with the given DirectedEdges, and for each DirectedEdge: sets the Edge, sets the symmetric DirectedEdge, and adds this Edge to its from-Node.
Declaration
public Edge(DirectedEdge de0, DirectedEdge de1)
Parameters
Type | Name | Description |
---|---|---|
DirectedEdge | de0 | |
DirectedEdge | de1 |
Fields
| Improve this Doc View SourcedirEdge
The two DirectedEdges associated with this Edge.
Declaration
protected DirectedEdge[] dirEdge
Field Value
Type | Description |
---|---|
DirectedEdge[] |
Properties
| Improve this Doc View SourceIsRemoved
Tests whether this component has been removed from its containing graph.
Declaration
public override bool IsRemoved { get; }
Property Value
Type | Description |
---|---|
Boolean |
Overrides
Methods
| Improve this Doc View SourceGetDirEdge(Node)
Returns the DirectedEdge that starts from the given node, or null if the node is not one of the two nodes associated with this Edge.
Declaration
public DirectedEdge GetDirEdge(Node fromNode)
Parameters
Type | Name | Description |
---|---|---|
Node | fromNode |
Returns
Type | Description |
---|---|
DirectedEdge |
GetDirEdge(Int32)
Returns one of the DirectedEdges associated with this Edge.
Declaration
public DirectedEdge GetDirEdge(int i)
Parameters
Type | Name | Description |
---|---|---|
Int32 | i | 0 or 1. |
Returns
Type | Description |
---|---|
DirectedEdge |
GetOppositeNode(Node)
If node
is one of the two nodes associated with this Edge,
returns the other node; otherwise returns null.
Declaration
public Node GetOppositeNode(Node node)
Parameters
Type | Name | Description |
---|---|---|
Node | node |
Returns
Type | Description |
---|---|
Node |
SetDirectedEdges(DirectedEdge, DirectedEdge)
Initializes this Edge's two DirectedEdges, and for each DirectedEdge: sets the Edge, sets the symmetric DirectedEdge, and adds this Edge to its from-Node.
Declaration
public void SetDirectedEdges(DirectedEdge de0, DirectedEdge de1)
Parameters
Type | Name | Description |
---|---|---|
DirectedEdge | de0 | |
DirectedEdge | de1 |