Example #1
0
        //冲突处理的总函数
        private void Conflict_Deal(model2d m1, model2d m2)
        {
            int t1, t2;

            t1 = m1.type;
            t2 = m2.type;     //1-直井,2-断层,3-PLANE
            if (t1 == 2 && t2 == 2)
            {
                DE_LL((fault2d)m1, (fault2d)m2);
            }
            if (t1 == 1 && t2 == 1)
            {
                DE_WW((well2d)m1, (well2d)m2);
            }
        }
Example #2
0
        // 处理两个断层之间的冲突
        private bool Is_Conflict(model2d m1, model2d m2)
        {
            //检查断层f1和f2是否存在冲突,如果存在返回true,否则返回false
            Node <PO> pnt = m1.edge_pl.Head;

            while (pnt != null)
            {
                if (m2.Is_po_inMe(pnt.Data))
                {
                    return(true);
                }
                pnt = pnt.Next;
            }
            return(false);
        }
Example #3
0
        public void Initial(model2d m)
        {
            //m从生成某个模型的点集中获取包含一个初始面的点集
            util u1 = new util();
            PO   p0, p1;
            LINE l1;

            //获取初始面的三个顶点和一个初始面
            p0 = m.pi;
            p1 = m.pj;
            //加入初始的点,构成初始点集
            p0.selected = true;
            p1.selected = true;
            work_pl.Insert(p0);
            work_pl.Insert(p1);
            //产生初始三角形的一条边
            l1 = new LINE(p0, p1);
            //为每个点加入初始的边集
            p0.ll.Insert(l1);
            p1.ll.Insert(l1);
            pl = m.Get_p_l();        //获取模型的点数据,为一个点链
            PAINT.GetLL(l1);
        }
Example #4
0
        private void Cal_new_edge_po_insert(model2d m0, PO p1, PO p2)
        {
            util  u1 = new util();
            PO    np;
            float f1, f2;

            f1 = 0;
            f2 = 0;
            bool      flag = false;
            Node <PO> pn = m0.edge_pl.Head, pnt, pnt1;

            pnt1 = null;
            LINE lt = new LINE(p1, p2);

            //PAINT.pl_tag.Insert(m0.edge_pl.Last.Data);
            if (pn != null)
            {
                while (pn.Next != null)
                {
                    //寻找与p1,p2相交的直线段
                    np = u1.IsXl(pn.Data, pn.Next.Data, p1, p2, ref f1, ref f2);
                    if (f1 > 0 && f1 < 1 && np != null)
                    {//将np插入到pn-pnt之间
                        pnt = new Node <PO>(np);
                        PAINT.pl_tag.Insert(np);
                        pnt.Next = pn.Next;
                        pn.Next  = pnt;
                        pn       = pn.Next;
                        if (pnt1 == null)
                        {
                            pnt1 = pnt;
                            //u1.InFile(u1.wherepath,"find point 1");
                            //u1.InFile(u1.wherepath, u1.Direct_2d(lt, pn.Next.Data));
                            //u1.InFile(u1.wherepath, u1.Direct_2d(lt, m0.center));
                            //PAINT.pl_tag.Insert(pn.Next.Data);
                            //PAINT.pl_tag.Insert(m0.center);
                            if (u1.Direct_2d(lt, pn.Next.Data) * u1.Direct_2d(lt, m0.center) < 0)
                            {
                                flag = true;
                                //u1.InFile(u1.wherepath, "flag=true");
                            }
                        }
                        else
                        {
                            if (flag)
                            {
                                //u1.InFile(u1.wherepath, "deal 1");
                                pnt1.Next = pnt;
                                return;
                            }
                            else
                            {
                                //u1.InFile(u1.wherepath, "deal 2");
                                m0.edge_pl.Head      = pnt1;
                                m0.edge_pl.Last      = pnt;
                                m0.edge_pl.Last.Next = null;
                                return;
                            }
                        }
                    }
                    pn = pn.Next;
                }
            }
            //u1.InFile(u1.wherepath, "middle");
            np = u1.IsXl(pn.Data, m0.edge_pl.Head.Data, p1, p2, ref f1, ref f2);
            if (f1 > 0 && f1 < 1 && np != null)
            {    //将np插入到pn-pnt之间
                np.key = 2;
                PAINT.pl_tag.Insert(np);
                pnt      = new Node <PO>(np);
                pnt.Next = pn.Next;
                pn.Next  = pnt;
                if (pnt1 != null)
                {
                    if (flag)
                    {
                        //u1.InFile(u1.wherepath, "deal 1");
                        pnt1.Next = pnt;
                        return;
                    }
                    else
                    {
                        //u1.InFile(u1.wherepath, "deal 2");
                        m0.edge_pl.Head = pnt1;
                        m0.edge_pl.Last = pnt;
                        return;
                    }
                }
            }
        }