public Node2List(IEnumerable <Point3d> pts)
 {
     m_nodes = new List <Node2>();
     m_sort  = NodeListSort.none;
     if (pts != null)
     {
         foreach (Point3d pt in pts)
         {
             m_nodes.Add(new Node2(pt.X, pt.Y));
         }
     }
 }
        public Node2List(Node2List L)
        {
            m_nodes          = new List <Node2>();
            m_sort           = NodeListSort.none;
            m_nodes.Capacity = L.m_nodes.Count;
            m_sort           = L.m_sort;
            int num = L.m_nodes.Count - 1;

            for (int i = 0; i <= num; i++)
            {
                if (L.m_nodes[i] == null)
                {
                    m_nodes.Add(null);
                }
                else
                {
                    m_nodes.Add(new Node2(L.m_nodes[i]));
                }
            }
        }
        /// <summary>
        /// Sort the list using a sorting type.
        /// </summary>
        /// <param name="type">Type of sorting algorithm.</param>
        public void Sort(NodeListSort type)
        {
            if (m_sort != type)
            {
                m_sort = type;
                switch (type)
                {
                case NodeListSort.none:
                    break;

                case NodeListSort.X:
                    m_nodes.Sort(Comparison_XAscending);
                    break;

                case NodeListSort.Y:
                    m_nodes.Sort(Comparison_YAscending);
                    break;

                case NodeListSort.Index:
                    m_nodes.Sort(Comparison_IAscending);
                    break;
                }
            }
        }
 /// <summary>
 /// Call this method when you made a change that potentially invalidates the sorting flags and caches.
 /// </summary>
 public void ExpireSequence()
 {
     m_sort = NodeListSort.none;
 }
 public Node2List(IEnumerable <Node2> L)
 {
     m_nodes = new List <Node2>();
     m_sort  = NodeListSort.none;
     m_nodes.AddRange(L);
 }
 public Node2List()
 {
     m_nodes = new List <Node2>();
     m_sort  = NodeListSort.none;
 }