Esempio n. 1
0
        public static NuGenBox2F operator *(NuGenBox2F b, NuGenTrafo2F t)
        {
            NuGenBox2F result = NuGenBox2F.Empty;

            result += b.LL * t;
            result += b.LU * t;
            result += b.UL * t;
            result += b.UU * t;
            return(result);
        }
Esempio n. 2
0
 public static bool ApproxEqual(NuGenBox2F a, NuGenBox2F b)
 {
     return
         NuGenVector.ApproxEquals(a.Lower, b.Lower) &&
         NuGenVector.ApproxEquals(a.Upper, b.Upper);
 }
Esempio n. 3
0
 public bool IsOnBorder(NuGenBox2F b)
 {
     return IsInsideOrOnBorder(b) && !IsInside(b);
 }
Esempio n. 4
0
 public bool IsInsideOrOnBorder(NuGenBox2F b)
 {
     return lower <= b.lower && upper >= b.upper;
 }
Esempio n. 5
0
 public bool IsInside(NuGenBox2F b)
 {
     return lower < b.lower && upper > b.upper;
 }
Esempio n. 6
0
        private void button_ok_Click(object sender, EventArgs e)
        {
            if (Genetibase.MathX.NuGenStructures.NuGen_Structures_Main.ind == 1)
            {
                if (u_x1.Text == "" || u_x2.Text == "" || u_y1.Text == "" || u_y2.Text == "" || l_x1.Text == "" || l_x2.Text == "" || l_y1.Text == "" || l_y2.Text == "")
                {
                    MessageBox.Show("Please Input All The Co-ordinates.");
                }
                else
                {
                    button_add.Enabled = true;

                    //NuGenBox2D lower_u, upper_u;


                    box1 = new Genetibase.MathX.NuGenStructures.NuGenBox2D();
                    box2 = new Genetibase.MathX.NuGenStructures.NuGenBox2D();

                    //upper_u = new NuGenBox2D();

                    box1.lower    = new NuGenPnt2D();
                    box1.lower._x = new Double[2];

                    box1.lower._x[0] = (double.Parse(l_x1.Text));
                    box1.lower._x[1] = (double.Parse(l_y1.Text));

                    box1.upper._x    = new Double[2];
                    box1.upper._x[0] = (double.Parse(u_x1.Text));
                    box1.upper._x[1] = double.Parse(u_y1.Text);

                    box2.lower._x    = new Double[2];
                    box2.lower._x[0] = double.Parse(l_x2.Text);
                    box2.lower._x[1] = double.Parse(l_y2.Text);

                    box2.upper._x    = new Double[2];
                    box2.upper._x[0] = double.Parse(u_x2.Text);
                    box2.upper._x[1] = double.Parse(u_y2.Text);
                }
            }
            else if (Genetibase.MathX.NuGenStructures.NuGen_Structures_Main.ind == 2)
            {
                if (u_x1.Text == "" || u_x2.Text == "" || u_y1.Text == "" || u_y2.Text == "" || l_x1.Text == "" || l_x2.Text == "" || l_y1.Text == "" || l_y2.Text == "")
                {
                    MessageBox.Show("Please Input All The Co-ordinates.");
                }
                else
                {
                    button_add.Enabled = true;

                    //NuGenBox2D lower_u, upper_u;


                    box1_f = new Genetibase.MathX.NuGenStructures.NuGenBox2F();
                    box2_f = new Genetibase.MathX.NuGenStructures.NuGenBox2F();

                    //upper_u = new NuGenBox2D();

                    box1_f.lower    = new NuGenPnt2F();
                    box1_f.lower._x = new float[2];

                    box1_f.lower._x[0] = (float.Parse(l_x1.Text));
                    box1_f.lower._x[1] = (float.Parse(l_y1.Text));

                    box1_f.upper._x    = new float[2];
                    box1_f.upper._x[0] = (float.Parse(u_x1.Text));
                    box1_f.upper._x[1] = float.Parse(u_y1.Text);

                    box2_f.lower._x    = new float[2];
                    box2_f.lower._x[0] = float.Parse(l_x2.Text);
                    box2_f.lower._x[1] = float.Parse(l_y2.Text);

                    box2_f.upper._x    = new float[2];
                    box2_f.upper._x[0] = float.Parse(u_x2.Text);
                    box2_f.upper._x[1] = float.Parse(u_y2.Text);
                }
            }
        }
        private void button_ok_Click(object sender, EventArgs e)
        {
            if (Genetibase.MathX.NuGenStructures.NuGen_Structures_Main.ind == 1)
            {


                if (u_x1.Text == "" || u_x2.Text == "" || u_y1.Text == "" || u_y2.Text == "" || l_x1.Text == "" || l_x2.Text == "" || l_y1.Text == "" || l_y2.Text == "")
                {
                    MessageBox.Show("Please Input All The Co-ordinates.");

                }
                else
                {
                    button_add.Enabled = true;

                    //NuGenBox2D lower_u, upper_u;


                    box1 = new Genetibase.MathX.NuGenStructures.NuGenBox2D();
                    box2 = new Genetibase.MathX.NuGenStructures.NuGenBox2D();

                    //upper_u = new NuGenBox2D();

                    box1.lower = new NuGenPnt2D();
                    box1.lower._x = new Double[2];

                    box1.lower._x[0] = (double.Parse(l_x1.Text));
                    box1.lower._x[1] = (double.Parse(l_y1.Text));

                    box1.upper._x = new Double[2];
                    box1.upper._x[0] = (double.Parse(u_x1.Text));
                    box1.upper._x[1] = double.Parse(u_y1.Text);

                    box2.lower._x = new Double[2];
                    box2.lower._x[0] = double.Parse(l_x2.Text);
                    box2.lower._x[1] = double.Parse(l_y2.Text);

                    box2.upper._x = new Double[2];
                    box2.upper._x[0] = double.Parse(u_x2.Text);
                    box2.upper._x[1] = double.Parse(u_y2.Text);


                }
            }
            else if (Genetibase.MathX.NuGenStructures.NuGen_Structures_Main.ind == 2)
            {
                if (u_x1.Text == "" || u_x2.Text == "" || u_y1.Text == "" || u_y2.Text == "" || l_x1.Text == "" || l_x2.Text == "" || l_y1.Text == "" || l_y2.Text == "")
                {
                    MessageBox.Show("Please Input All The Co-ordinates.");

                }
                else
                {
                    button_add.Enabled = true;

                    //NuGenBox2D lower_u, upper_u;


                    box1_f = new Genetibase.MathX.NuGenStructures.NuGenBox2F();
                    box2_f= new Genetibase.MathX.NuGenStructures.NuGenBox2F();

                    //upper_u = new NuGenBox2D();

                    box1_f.lower = new NuGenPnt2F();
                    box1_f.lower._x = new float[2];

                    box1_f.lower._x[0] = (float.Parse(l_x1.Text));
                    box1_f.lower._x[1] = (float.Parse(l_y1.Text));

                    box1_f.upper._x = new float[2];
                    box1_f.upper._x[0] = (float.Parse(u_x1.Text));
                    box1_f.upper._x[1] = float.Parse(u_y1.Text);

                    box2_f.lower._x = new float[2];
                    box2_f.lower._x[0] = float.Parse(l_x2.Text);
                    box2_f.lower._x[1] = float.Parse(l_y2.Text);

                    box2_f.upper._x = new float[2];
                    box2_f.upper._x[0] = float.Parse(u_x2.Text);
                    box2_f.upper._x[1] = float.Parse(u_y2.Text);


                }

            }
           
        }
Esempio n. 8
0
        public override bool Equals(object obj)
        {
            NuGenBox2F x = (NuGenBox2F)obj;

            return(lower == x.Lower && upper == x.Upper);
        }
Esempio n. 9
0
 public static bool ApproxEqual(NuGenBox2F a, NuGenBox2F b)
 {
     return
         (NuGenVector.ApproxEquals(a.Lower, b.Lower) &&
          NuGenVector.ApproxEquals(a.Upper, b.Upper));
 }
Esempio n. 10
0
 public bool IsOnBorder(NuGenBox2F b)
 {
     return(IsInsideOrOnBorder(b) && !IsInside(b));
 }
Esempio n. 11
0
 public bool IsInsideOrOnBorder(NuGenBox2F b)
 {
     return(lower <= b.lower && upper >= b.upper);
 }
Esempio n. 12
0
 public bool IsInside(NuGenBox2F b)
 {
     return(lower < b.lower && upper > b.upper);
 }