예제 #1
0
 /// <summary>
 /// Gets a directed edge id.
 /// </summary>
 public static long IdDirected(this GeometricGraph.EdgeEnumerator edge)
 {
     if (edge.DataInverted)
     {
         return(-(edge.Id + 1));
     }
     return(edge.Id + 1);
 }
예제 #2
0
 /// <summary>
 /// Creates a new geometric edge.
 /// </summary>
 internal GeometricEdge(GeometricGraph.EdgeEnumerator enumerator)
 {
     this.Id           = enumerator.Id;
     this.From         = enumerator.From;
     this.To           = enumerator.To;
     this.Data         = enumerator.Data;
     this.DataInverted = enumerator.DataInverted;
     this.Shape        = enumerator.Shape;
 }
예제 #3
0
        /// <summary>
        /// Moves to the given directed edge-id.
        /// </summary>
        public static void MoveToEdge(this GeometricGraph.EdgeEnumerator enumerator, long directedEdgeId)
        {
            if (directedEdgeId == 0)
            {
                throw new ArgumentOutOfRangeException("directedEdgeId");
            }

            uint edgeId;

            if (directedEdgeId > 0)
            {
                edgeId = (uint)directedEdgeId - 1;
            }
            else
            {
                edgeId = (uint)((-directedEdgeId) - 1);
            }
            enumerator.MoveToEdge(edgeId);
        }