Пример #1
0
        private void Shadow_Delete(LINE lpa, PO lpa_pk, LINE lshadow, PO ls_pk)
        {
            /*
             * 将影子点的边转移到父点中去
             * shap是影子点,shapflag是影子点的标记点
             * pap是父点,papflag是父点的标记点
             */
            util u1 = new util();

            if (lpa.sl.Head.Data.Belongme(lpa_pk))
            {//如果标记点在父点的首边上
                if (lshadow.sl.Head.Data.Belongme(ls_pk))
                {
                    info.Insert("case1");
                    #region case1
                    Node <SURFACE> sn = lshadow.sl.Head;
                    while (sn != null)
                    {
                        //用父点换掉边中的影子点
                        lpa.sl.Head_Insert(sn.Data);
                        sn = sn.Next;
                    }
                    #endregion case1
                }
                else
                {
                    info.Insert("case2");
                    #region case2
                    LinkList <SURFACE> st = new LinkList <SURFACE>();
                    Node <SURFACE>     sn = lshadow.sl.Head;
                    while (sn != null)//将shap的线链反序
                    {
                        st.Head_Insert(sn.Data);
                        sn = sn.Next;
                    }
                    sn = st.Head;
                    while (sn != null)
                    {
                        lpa.sl.Head_Insert(sn.Data);
                        sn = sn.Next;
                    }
                    #endregion case2
                }
            }
            else
            {//如果标记点在父点的尾边上
                if (lshadow.sl.Head.Data.Belongme(ls_pk))
                {
                    info.Insert("case3");
                    #region case3
                    Node <SURFACE> sn = lshadow.sl.Head;
                    while (sn != null)
                    {
                        //用父点换掉边中的影子点
                        lpa.sl.Insert(sn.Data);
                        sn = sn.Next;
                    }
                    #endregion
                }
                else
                {
                    info.Insert("case4");
                    #region case4
                    LinkList <SURFACE> st = new LinkList <SURFACE>();
                    Node <SURFACE>     sn = lshadow.sl.Head;
                    while (sn != null)//将shap的线链反序
                    {
                        st.Head_Insert(sn.Data);
                        sn = sn.Next;
                    }
                    sn = st.Head;
                    while (sn != null)
                    {
                        lpa.sl.Insert(sn.Data);
                        sn = sn.Next;
                    }
                    #endregion
                }
            }
            lpa.p1.ll.Delete(lshadow);
            lpa.p2.ll.Delete(lshadow);
            sn_current = lpa.sl.Last;
        }
Пример #2
0
        private void shadowpo(PO shap, PO shapflag, PO pap, PO papflag)
        {
            /*
             * 将影子点的边转移到父点中去
             * shap是影子点,shapflag是影子点的标记点
             * pap是父点,papflag是父点的标记点
             */

            if (pap.ll.Head.Data.Po_insideme(papflag))
            {//如果标记点在父点的首边上
                if (shap.ll.Head.Data.Po_insideme(shapflag))
                {
                    #region case1
                    Node <LINE> lnt = shap.ll.Head;
                    while (lnt != null)
                    {
                        //用父点换掉边中的影子点
                        lnt.Data.Po_insideme_and_changeit(pap);
                        pap.ll.Head_Insert(lnt.Data);
                        lnt = lnt.Next;
                    }
                    #endregion case1
                }
                else
                {
                    #region case2
                    LinkList <LINE> lt  = new LinkList <LINE>();
                    Node <LINE>     lnt = shap.ll.Head;
                    while (lnt != null)//将shap的线链反序
                    {
                        lt.Head_Insert(lnt.Data);
                        lnt = lnt.Next;
                    }
                    lnt = lt.Head;
                    while (lnt != null)
                    {
                        lnt.Data.Po_insideme_and_changeit(pap);
                        pap.ll.Head_Insert(lnt.Data);
                        lnt = lnt.Next;
                    }
                    #endregion case2
                }
            }
            else
            {//如果标记点在父点的尾边上
                if (shap.ll.Head.Data.Po_insideme(shapflag))
                {
                    #region case3
                    Node <LINE> lnt = shap.ll.Head;
                    while (lnt != null)
                    {
                        lnt.Data.Po_insideme_and_changeit(pap);
                        pap.ll.Insert(lnt.Data);
                        lnt = lnt.Next;
                    }
                    #endregion case3
                }
                else
                {
                    #region case4
                    LinkList <LINE> lt  = new LinkList <LINE>();
                    Node <LINE>     lnt = shap.ll.Head;
                    while (lnt != null)//将shap的线链反序
                    {
                        lt.Head_Insert(lnt.Data);
                        lnt = lnt.Next;
                    }
                    lnt = lt.Head;
                    while (lnt != null)
                    {
                        lnt.Data.Po_insideme_and_changeit(pap);
                        pap.ll.Insert(lnt.Data);
                        lnt = lnt.Next;
                    }
                    #endregion case4
                }
            }
            work_pl.Delete(shap);
        }
Пример #3
0
        private void shadowPO(PO shap, PO shapflag, PO pap, PO papflag)
        {
            /*
             * 将影子点的边转移到父点中去
             * shap是影子点,shapflag是影子点的标记点
             * pap是父点,papflag是父点的标记点
             */
            util u1 = new util();

            if (pap.ll.Head.Data.Po_insideme(papflag))
            {//如果标记点在父点的首边上
                if (shap.ll.Head.Data.Po_insideme(shapflag))
                {
                    #region case1
                    Node <LINE> lnt = shap.ll.Head;
                    while (lnt != null)
                    {
                        //用父点换掉边中的影子点
                        lnt.Data.Po_insideme_and_changeit(pap);
                        pap.ll.Head_Insert(lnt.Data);
                        lnt = lnt.Next;
                    }
                    #endregion case1
                }
                else
                {
                    #region case2
                    LinkList <LINE> lt  = new LinkList <LINE>();
                    Node <LINE>     lnt = shap.ll.Head;
                    while (lnt != null)//将shap的线链反序
                    {
                        lt.Head_Insert(lnt.Data);
                        lnt = lnt.Next;
                    }
                    lnt = lt.Head;
                    while (lnt != null)
                    {
                        lnt.Data.Po_insideme_and_changeit(pap);
                        pap.ll.Head_Insert(lnt.Data);
                        lnt = lnt.Next;
                    }
                    #endregion case2
                }
            }
            else
            {//如果标记点在父点的尾边上
                if (shap.ll.Head.Data.Po_insideme(shapflag))
                {
                    shap.ToString();
                    #region case3
                    Node <LINE> lnt = shap.ll.Head;
                    while (lnt != null)
                    {
                        lnt.Data.Po_insideme_and_changeit(pap);
                        pap.ll.Insert(lnt.Data);
                        lnt = lnt.Next;
                    }
                    #endregion case3
                }
                else
                {
                    #region case4
                    LinkList <LINE> lt  = new LinkList <LINE>();
                    Node <LINE>     lnt = shap.ll.Head;
                    while (lnt != null)//将shap的线链反序
                    {
                        lt.Head_Insert(lnt.Data);
                        lnt = lnt.Next;
                    }
                    lnt = lt.Head;
                    while (lnt != null)
                    {
                        lnt.Data.Po_insideme_and_changeit(pap);
                        pap.ll.Insert(lnt.Data);
                        lnt = lnt.Next;
                    }
                    #endregion case4
                }
            }
            work_pl.Delete(shap);
            //如果此时父节点的尾边封闭,则开启其尾边相应方向
            if (!pap.ll.Last.Data.negtive && !pap.ll.Last.Data.positive && pkey.key != 3)
            {
                Open_direction(pap.ll, pap);
            }
        }