Search Results for

    Show / Hide Table of Contents

    Class DirectedEdge

    Represents a directed edge in a PlanarGraph. A DirectedEdge may or may not have a reference to a parent Edge (some applications of planar graphs may not require explicit Edge objects to be created). Usually a client using a PlanarGraph will subclass DirectedEdge to add its own application-specific data and methods.

    Inheritance
    object
    GraphComponent
    DirectedEdge
    LineMergeDirectedEdge
    PolygonizeDirectedEdge
    Implements
    IComparable
    Inherited Members
    GraphComponent.SetVisited(IEnumerator, bool)
    GraphComponent.SetMarked(IEnumerator, bool)
    GraphComponent.GetComponentWithVisitedState(IEnumerator, bool)
    GraphComponent.IsVisited
    GraphComponent.Visited
    GraphComponent.IsMarked
    GraphComponent.Marked
    GraphComponent.Data
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: NetTopologySuite.Planargraph
    Assembly: NetTopologySuite.dll
    Syntax
    public class DirectedEdge : GraphComponent, IComparable

    Constructors

    | Edit this page View Source

    DirectedEdge(Node, Node, Coordinate, bool)

    Constructs a DirectedEdge connecting the from node to the to node.

    Declaration
    public DirectedEdge(Node from, Node to, Coordinate directionPt, bool edgeDirection)
    Parameters
    Type Name Description
    Node from
    Node to
    Coordinate directionPt

    Specifies this DirectedEdge's direction (given by an imaginary line from the from node to directionPt).

    bool edgeDirection

    Whether this DirectedEdge's direction is the same as or opposite to that of the parent Edge (if any).

    Fields

    | Edit this page View Source

    from

    Declaration
    protected Node from
    Field Value
    Type Description
    Node
    | Edit this page View Source

    p0

    Declaration
    protected Coordinate p0
    Field Value
    Type Description
    Coordinate
    | Edit this page View Source

    p1

    Declaration
    protected Coordinate p1
    Field Value
    Type Description
    Coordinate
    | Edit this page View Source

    parentEdge

    Declaration
    protected Edge parentEdge
    Field Value
    Type Description
    Edge
    | Edit this page View Source

    to

    Declaration
    protected Node to
    Field Value
    Type Description
    Node

    Properties

    | Edit this page View Source

    Angle

    Returns the angle that the start of this DirectedEdge makes with the positive x-axis, in radians.

    Declaration
    public double Angle { get; }
    Property Value
    Type Description
    double
    | Edit this page View Source

    Coordinate

    Returns the coordinate of the from-node.

    Declaration
    public Coordinate Coordinate { get; }
    Property Value
    Type Description
    Coordinate
    | Edit this page View Source

    DirectionPt

    Returns a point to which an imaginary line is drawn from the from-node to specify this DirectedEdge's orientation.

    Declaration
    public Coordinate DirectionPt { get; }
    Property Value
    Type Description
    Coordinate
    | Edit this page View Source

    Edge

    Returns this DirectedEdge's parent Edge, or null if it has none. Associates this DirectedEdge with an Edge (possibly null, indicating no associated Edge).

    Declaration
    public Edge Edge { get; set; }
    Property Value
    Type Description
    Edge
    | Edit this page View Source

    EdgeDirection

    Returns whether the direction of the parent Edge (if any) is the same as that of this Directed Edge.

    Declaration
    public bool EdgeDirection { get; protected set; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    FromNode

    Returns the node from which this DirectedEdge leaves.

    Declaration
    public Node FromNode { get; }
    Property Value
    Type Description
    Node
    | Edit this page View Source

    IsRemoved

    Tests whether this component has been removed from its containing graph.

    Declaration
    public override bool IsRemoved { get; }
    Property Value
    Type Description
    bool
    Overrides
    GraphComponent.IsRemoved
    | Edit this page View Source

    Quadrant

    Returns 0, 1, 2, or 3, indicating the quadrant in which this DirectedEdge's orientation lies.

    Declaration
    [Obsolete("Use QuadrantValue")]
    public int Quadrant { get; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    QuadrantEx

    Returns 0, 1, 2, or 3, indicating the quadrant in which this DirectedEdge's orientation lies.

    Declaration
    public Quadrant QuadrantEx { get; }
    Property Value
    Type Description
    Quadrant
    | Edit this page View Source

    Sym

    Returns the symmetric DirectedEdge -- the other DirectedEdge associated with this DirectedEdge's parent Edge. Sets this DirectedEdge's symmetric DirectedEdge, which runs in the opposite direction.

    Declaration
    public DirectedEdge Sym { get; set; }
    Property Value
    Type Description
    DirectedEdge
    | Edit this page View Source

    ToNode

    Returns the node to which this DirectedEdge goes.

    Declaration
    public Node ToNode { get; }
    Property Value
    Type Description
    Node

    Methods

    | Edit this page View Source

    CompareDirection(DirectedEdge)

    Returns 1 if this DirectedEdge has a greater angle with the positive x-axis than b", 0 if the DirectedEdges are collinear, and -1 otherwise. Using the obvious algorithm of simply computing the angle is not robust, since the angle calculation is susceptible to round off. A robust algorithm is: first compare the quadrants. If the quadrants are different, it it trivial to determine which vector is "greater". if the vectors lie in the same quadrant, the robust RobustCGAlgorithms.ComputeOrientation(Coordinate, Coordinate, Coordinate) function can be used to decide the relative orientation of the vectors.

    Declaration
    public int CompareDirection(DirectedEdge e)
    Parameters
    Type Name Description
    DirectedEdge e
    Returns
    Type Description
    int
    | Edit this page View Source

    CompareTo(object)

    Returns 1 if this DirectedEdge has a greater angle with the positive x-axis than b", 0 if the DirectedEdges are collinear, and -1 otherwise. Using the obvious algorithm of simply computing the angle is not robust, since the angle calculation is susceptible to round off. A robust algorithm is: first compare the quadrants. If the quadrants are different, it it trivial to determine which vector is "greater". if the vectors lie in the same quadrant, the robust RobustCGAlgorithms.ComputeOrientation(Coordinate, Coordinate, Coordinate) function can be used to decide the relative orientation of the vectors.

    Declaration
    public int CompareTo(object obj)
    Parameters
    Type Name Description
    object obj
    Returns
    Type Description
    int
    | Edit this page View Source

    ToEdges(IList<DirectedEdge>)

    Returns a List containing the parent Edge (possibly null) for each of the given DirectedEdges.

    Declaration
    public static IList<Edge> ToEdges(IList<DirectedEdge> dirEdges)
    Parameters
    Type Name Description
    IList<DirectedEdge> dirEdges
    Returns
    Type Description
    IList<Edge>
    | Edit this page View Source

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    object.ToString()
    | Edit this page View Source

    Write(StreamWriter)

    Writes a detailed string representation of this DirectedEdge to the given PrintStream.

    Declaration
    public void Write(StreamWriter outstream)
    Parameters
    Type Name Description
    StreamWriter outstream

    Implements

    IComparable
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX