/// <summary>
        /// Cadデータをコピーする
        /// </summary>
        /// <param name="src"></param>
        public void CopyData(CadLogicBase src)
        {
            //System.Diagnostics.Debug.WriteLine("-------CadLogicBase CopyData-------");
            if (src == this)
            {
                System.Diagnostics.Debug.WriteLine("Why? another me exists!");
                //System.Diagnostics.Debug.Assert(false);
                return;
            }

            // CadモードもUndo/Redo対象に入れる
            _CadMode = src._CadMode;
            // CadObj
            SerializedCadObjBuff = src.SerializedCadObjBuff;
            // LoopList
            LoopList.Clear();
            foreach (Loop srcLoop in src.LoopList)
            {
                Loop loop = new Loop(srcLoop);
                LoopList.Add(loop);
            }
            //check
            //foreach (EdgeCollection work in EdgeCollectionList)
            //{
            //    System.Diagnostics.Debug.WriteLine("  prev:No {0}  cnt {1}",  work.No, work.EdgeIds.Count);
            //}
            //foreach (EdgeCollection work in src.EdgeCollectionList)
            //{
            //    System.Diagnostics.Debug.WriteLine("  src:No {0}  cnt {1}", work.No, work.EdgeIds.Count);
            //}
            EdgeCollectionList.Clear();
            foreach (EdgeCollection srcEdge in src.EdgeCollectionList)
            {
                EdgeCollection edge = new EdgeCollection();
                edge.CP(srcEdge);
                EdgeCollectionList.Add(edge);
            }
            //check
            //foreach (EdgeCollection work in EdgeCollectionList)
            //{
            //    System.Diagnostics.Debug.WriteLine("  setted:No {0}  cnt {1}", work.No, work.EdgeIds.Count);
            //}

            // edit
            EditPts.Clear();
            foreach (CVector2D pp in src.EditPts)
            {
                EditPts.Add(pp);
            }
            // edit
            EditVertexIds.Clear();
            foreach (uint id_v in src.EditVertexIds)
            {
                EditVertexIds.Add(id_v);
            }
            // edit
            EditEdgeIds.Clear();
            foreach (uint id_e in src.EditEdgeIds)
            {
                EditEdgeIds.Add(id_e);
            }

            IncidentPortNo = src.IncidentPortNo;
            //SelectedMediaIndex = src.SelectedMediaIndex;
            for (int i = 0; i < src.Medias.Length; i++)
            {
                Medias[i].SetP(src.Medias[i].P);
                Medias[i].SetQ(src.Medias[i].Q);
            }
            //System.Diagnostics.Debug.WriteLine("-------CadLogicBase CopyData end----------");
        }
        /// <summary>
        /// Cadデータをコピーする
        /// </summary>
        /// <param name="src"></param>
        public void CopyData(CadLogicBase src)
        {
            //Console.WriteLine("-------CadLogicBase CopyData-------");
            if (src == this)
            {
                Console.WriteLine("Why? another me exists!");
                //System.Diagnostics.Debug.Assert(false);
                return;
            }

            // CadモードもUndo/Redo対象に入れる
            _CadMode = src._CadMode;
            // CadObj
            SerializedCadObjBuff = src.SerializedCadObjBuff;
            // LoopList
            LoopList.Clear();
            foreach (Loop srcLoop in src.LoopList)
            {
                Loop loop = new Loop(srcLoop);
                LoopList.Add(loop);
            }
            //check
            //foreach (EdgeCollection work in EdgeCollectionList)
            //{
            //    Console.WriteLine("  prev:No {0}  cnt {1}",  work.No, work.EdgeIds.Count);
            //}
            //foreach (EdgeCollection work in src.EdgeCollectionList)
            //{
            //    Console.WriteLine("  src:No {0}  cnt {1}", work.No, work.EdgeIds.Count);
            //}
            EdgeCollectionList.Clear();
            foreach (EdgeCollection srcEdge in src.EdgeCollectionList)
            {
                EdgeCollection edge = new EdgeCollection();
                edge.CP(srcEdge);
                EdgeCollectionList.Add(edge);
            }
            //check
            //foreach (EdgeCollection work in EdgeCollectionList)
            //{
            //    Console.WriteLine("  setted:No {0}  cnt {1}", work.No, work.EdgeIds.Count);
            //}

            // edit
            EditPts.Clear();
            foreach (CVector2D pp in src.EditPts)
            {
                EditPts.Add(pp);
            }
            // edit
            EditVertexIds.Clear();
            foreach (uint id_v in src.EditVertexIds)
            {
                EditVertexIds.Add(id_v);
            }
            // edit
            EditEdgeIds.Clear();
            foreach (uint id_e in src.EditEdgeIds)
            {
                EditEdgeIds.Add(id_e);
            }

            IncidentPortNo = src.IncidentPortNo;
            //SelectedMediaIndex = src.SelectedMediaIndex;
            for (int i = 0; i < src.Medias.Length; i++)
            {
                Medias[i].SetP(src.Medias[i].P);
                Medias[i].SetQ(src.Medias[i].Q);
            }
            //Console.WriteLine("-------CadLogicBase CopyData end----------");
        }