NetTopologySuite
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
NetTopologySuite.Planargraph.DirectedEdge Class Reference

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. More...

Inheritance diagram for NetTopologySuite.Planargraph.DirectedEdge:
NetTopologySuite.Planargraph.GraphComponent NetTopologySuite.Operation.Linemerge.LineMergeDirectedEdge NetTopologySuite.Operation.Polygonize.PolygonizeDirectedEdge

Public Member Functions

 DirectedEdge (Node from, Node to, Coordinate directionPt, bool edgeDirection)
 Constructs a DirectedEdge connecting the from node to the to node. More...
 
int CompareTo (Object obj)
 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 roundoff. 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. More...
 
int CompareDirection (DirectedEdge e)
 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 roundoff. 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. More...
 
void Write (StreamWriter outstream)
 Writes a detailed string representation of this DirectedEdge to the given PrintStream. More...
 
override string ToString ()
 

Static Public Member Functions

static IList< EdgeToEdges (IList< DirectedEdge > dirEdges)
 Returns a List containing the parent Edge (possibly null) for each of the given DirectedEdges. More...
 
- Static Public Member Functions inherited from NetTopologySuite.Planargraph.GraphComponent
static void SetVisited (IEnumerator i, bool visited)
 Sets the GraphComponent.Visited state for all GraphComponents in an IEnumerator. More...
 
static void SetMarked (IEnumerator i, bool marked)
 Sets the GraphComponent.Marked state for all GraphComponents in an IEnumerator. More...
 
static GraphComponent GetComponentWithVisitedState (IEnumerator i, bool visitedState)
 Finds the first GraphComponent in a IEnumerator set which has the specified GraphComponent.Visited state. More...
 

Protected Attributes

Edge parentEdge
 
Node from
 
Node to
 
Coordinate p0
 
Coordinate p1
 

Properties

Edge Edge [get, set]
 Returns this DirectedEdge's parent Edge, or null if it has none. Associates this DirectedEdge with an Edge (possibly null, indicating no associated Edge). More...
 
int Quadrant [get]
 Returns 0, 1, 2, or 3, indicating the quadrant in which this DirectedEdge's orientation lies. More...
 
Coordinate DirectionPt [get]
 Returns a point to which an imaginary line is drawn from the from-node to specify this DirectedEdge's orientation. More...
 
bool EdgeDirection [get, protected set]
 Returns whether the direction of the parent Edge (if any) is the same as that of this Directed Edge. More...
 
Node FromNode [get]
 Returns the node from which this DirectedEdge leaves. More...
 
Node ToNode [get]
 Returns the node to which this DirectedEdge goes. More...
 
Coordinate Coordinate [get]
 Returns the coordinate of the from-node. More...
 
double Angle [get]
 Returns the angle that the start of this DirectedEdge makes with the positive x-axis, in radians. More...
 
DirectedEdge Sym [get, set]
 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. More...
 
override bool IsRemoved [get]
 Tests whether this component has been removed from its containing graph. More...
 
- Properties inherited from NetTopologySuite.Planargraph.GraphComponent
bool IsVisited [get]
 Tests if a component has been visited during the course of a graph algorithm. More...
 
bool Visited [get, set]
 Gets/Sets the visited flag for this component. More...
 
bool IsMarked [get]
 Tests if a component has been marked at some point during the processing involving this graph. More...
 
bool Marked [get, set]
 Gets/Sets the marked flag for this component. More...
 
abstract bool IsRemoved [get]
 Tests whether this component has been removed from its containing graph. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

NetTopologySuite.Planargraph.DirectedEdge.DirectedEdge ( Node  from,
Node  to,
Coordinate  directionPt,
bool  edgeDirection 
)

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

Parameters
from
to
directionPtSpecifies this DirectedEdge's direction (given by an imaginary line from the from node to directionPt).
edgeDirectionWhether this DirectedEdge's direction is the same as or opposite to that of the parent Edge (if any).

Member Function Documentation

int NetTopologySuite.Planargraph.DirectedEdge.CompareDirection ( DirectedEdge  e)

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 roundoff. 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.

Parameters
e
Returns
int NetTopologySuite.Planargraph.DirectedEdge.CompareTo ( Object  obj)

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 roundoff. 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.

Parameters
obj
Returns
static IList<Edge> NetTopologySuite.Planargraph.DirectedEdge.ToEdges ( IList< DirectedEdge dirEdges)
static

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

Parameters
dirEdges
Returns
void NetTopologySuite.Planargraph.DirectedEdge.Write ( StreamWriter  outstream)

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

Parameters
outstream

Property Documentation

double NetTopologySuite.Planargraph.DirectedEdge.Angle
get

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

Coordinate NetTopologySuite.Planargraph.DirectedEdge.Coordinate
get

Returns the coordinate of the from-node.

Coordinate NetTopologySuite.Planargraph.DirectedEdge.DirectionPt
get

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

Edge NetTopologySuite.Planargraph.DirectedEdge.Edge
getset

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

bool NetTopologySuite.Planargraph.DirectedEdge.EdgeDirection
getprotected set

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

Node NetTopologySuite.Planargraph.DirectedEdge.FromNode
get

Returns the node from which this DirectedEdge leaves.

override bool NetTopologySuite.Planargraph.DirectedEdge.IsRemoved
get

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

int NetTopologySuite.Planargraph.DirectedEdge.Quadrant
get

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

DirectedEdge NetTopologySuite.Planargraph.DirectedEdge.Sym
getset

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.

Node NetTopologySuite.Planargraph.DirectedEdge.ToNode
get

Returns the node to which this DirectedEdge goes.


The documentation for this class was generated from the following file: