Пример #1
0
 /// <summary>
 /// Sets the Marked state for all <see cref="PlanarGraphObject"/>s
 /// in an <see cref="IEnumerator"/>.
 /// </summary>
 /// <param name="i">the Iterator to scan
 /// </param>
 /// <param name="marked">
 /// The state to set the Marked flag to.
 /// </param>
 public static void SetMarked(IEnumerator i, bool marked)
 {
     while (i.MoveNext())
     {
         PlanarGraphObject comp = (PlanarGraphObject)i.Current;
         comp.Marked = marked;
     }
 }
Пример #2
0
 /// <summary>
 /// Sets the Visited state for all <see cref="PlanarGraphObject"/>s
 /// in an <see cref="IEnumerator"/>.
 ///
 /// </summary>
 /// <param name="i">
 /// The <see cref="IEnumerator"/> to scan
 /// </param>
 /// <param name="visited">
 /// The state to set the visited flag to.
 /// </param>
 public static void SetVisited(IEnumerator i, bool visited)
 {
     while (i.MoveNext())
     {
         PlanarGraphObject comp = (PlanarGraphObject)i.Current;
         comp.Visited = visited;
     }
 }
Пример #3
0
        /// <summary>
        /// Finds the first <see cref="PlanarGraphObject"/> in a
        /// <see cref="IEnumerator"/> set which has the specified
        /// visited state.
        /// </summary>
        /// <param name="i">
        /// An <see cref="IEnumerator"/> of GraphComponents
        /// </param>
        /// <param name="visitedState">
        /// The visited state to test.
        /// </param>
        /// <returns>
        /// The first component found, or <code>null</code> if none found
        /// </returns>
        public static PlanarGraphObject GetComponentWithVisitedState(
            IEnumerator i, bool visitedState)
        {
            while (i.MoveNext())
            {
                PlanarGraphObject comp = (PlanarGraphObject)i.Current;
                if (comp.Visited == visitedState)
                {
                    return(comp);
                }
            }

            return(null);
        }