Esempio n. 1
0
 public void Clear()
 {
     ll.Clear();
     non_merged = true;
     selected   = false;
     p_parent   = null;
 }
Esempio n. 2
0
 public void Clear()
 {
     pl.Clear();
     pl_tag.Clear();
     model_boundary_ll.Clear();
     ll.Clear();
     ll_tag.Clear();
     ll_triangle.Clear();
     ll_pebi.Clear();
     p_tags = null;
 }
Esempio n. 3
0
        public void Show_sl()
        {
            Node <SURFACE> sn;

            sn = sl.Head;
            while (sn != null)
            {
                PAINT.GetSL(sn.Data);
                sn = sn.Next;
            }
            sl.Clear();
        }
Esempio n. 4
0
        void Four_po_netnumber(PO[] p)
        {
            /*
             * 输入:长方形区域的四个角点的坐标
             * 输出:长方形所包括的网格的坐标
             */
            util u1 = new util();
            int  x1, x1g, x2, x2g, xm, X0, Y0, X1, Y1, i;
            PO   p1d, p2d, pm;

            pm = new PO();
            if (u1.Direct_2d(new LINE(p[1], p[2]), p[3]) * u1.Direct_2d(new LINE(p[1], p[2]), p[0]) >= 0)
            {
                pm.x   = p[2].x;
                pm.y   = p[2].y;
                p[2].x = p[3].x;
                p[2].y = p[3].y;
                p[3].x = pm.x;
                p[3].y = pm.y;
            }
            X0  = (int)(p[0].x / Xi);
            Y0  = (int)(p[0].y / Yi);
            X1  = (int)(p[3].x / Xi);
            Y1  = (int)(p[3].y / Yi);
            p1d = p[0];
            p2d = p[0];
            x1g = x2g = 0;
            net_choosed.Clear();
            for (i = Y0 + 1; i <= Y1 + 1; i++)
            {
                if (p1d.x == p[1].x)
                {
                    x1 = (int)(p[1].x / Xi);
                }
                else if (p1d.y == p[1].y)
                {
                    x1 = (int)(p[1].x / Xi);
                }
                else
                {
                    x1 = (int)(u1.Cal_po_on_Line(p1d, p[1], (i + x1g) * Yi) / Xi);
                }
                if (p2d.x == p[2].x)
                {
                    x2 = (int)(p[2].x / Xi);
                }
                else if (p2d.y == p[2].y)
                {
                    x2 = (int)(p[2].x / Xi);
                }
                else
                {
                    x2 = (int)(u1.Cal_po_on_Line(p2d, p[2], (i + x2g) * Yi) / Xi);
                }
                if (i - 1 == (int)(p[1].y / Yi))
                {
                    x1  = (int)(p[1].x / Xi);
                    p1d = p[3];
                    x1g = -1;
                }
                if (i - 1 == (int)(p[2].y / Yi))
                {
                    x2  = (int)(p[2].x / Xi);
                    x2g = -1;
                    p2d = p[3];
                }
                if (x1 > x2)
                {
                    xm = x1; x1 = x2; x2 = xm;
                }
                while (x1 <= x2)
                {
                    net_choosed.Insert(new PO(x1, i - 1));
                    x1++;
                }
            }
        }
Esempio n. 5
0
        public void In_model()
        {
            model_l.Clear();
            plane.edge_pl.Clear();
            util   u1 = new util();
            string sn = "";
            string str;

            float[]      fn    = new float[9];
            int          j     = 0;
            int          first = 0;
            well2d       w0;
            StreamReader sr = new StreamReader(u1.model_info, true);

            while ((str = sr.ReadLine()) != null)
            {
                j = 0;
                foreach (char ch in str)
                {
                    if ((int)ch >= 48 && (int)ch <= 57 || ch.Equals('.') || ch.Equals('-') || ch.Equals('E'))
                    {
                        sn = sn + ch;
                    }
                    else
                    {
                        if (!sn.Equals(""))
                        {
                            fn[j++] = float.Parse(sn);
                        }
                        sn = "";
                    }
                }

                //1,2,3,4,5,6
                PO[] pc = new PO[2];
                pc[0]   = new PO();
                pc[0].x = fn[1];
                pc[0].y = fn[2];
                pc[0].z = 0;
                pc[1]   = new PO();
                pc[1].x = fn[3];
                pc[1].y = fn[4];
                pc[1].z = 0;
                switch ((int)fn[0])
                {
                case 1:
                    u1.InFile(u1.wherepath, ("well:" + pc[0].x + ',' + pc[0].y + ',' + pc[0].z));
                    w0 = Create_Vertical_Well(pc[0]);
                    if (first++ == 0)
                    {
                        center = w0.center;
                        w0.Set_initial_pl(initial_pl);
                    }
                    break;

                case 2:
                    Create_fault(new LINE(pc[0], pc[1]));
                    u1.InFile(u1.wherepath, ("fault:" + pc[0].x + ',' + pc[0].y + ',' + pc[0].z + ',' + pc[1].x + ',' + pc[1].y + ',' + pc[1].z));
                    break;

                case 4:
                    Create_h_well2d(new LINE(pc[0], pc[1]));
                    u1.InFile(u1.wherepath, ("h_well:" + pc[0].x + ',' + pc[0].y + ',' + pc[0].z + ',' + pc[1].x + ',' + pc[1].y + ',' + pc[1].z));
                    break;

                case 0:
                    plane.edge_pl.Insert(pc[0]);
                    break;
                }
            }
        }