Exemplo n.º 1
0
        public static D_Raud mergeTwoRebar_long(B_Raud one, B_Raud two)
        {
            G.Point a = one._SidePoint;
            G.Point b = one.StartPoint;
            G.Point c = two.StartPoint;
            G.Point d = two._EndPoint;

            G.Line temp1 = new G.Line(a, b);
            G.Line main  = new G.Line(b, c);
            G.Line temp2 = new G.Line(c, d);

            double s1  = temp1.Length();
            double s2  = temp2.Length();
            double max = Math.Max(s1, s2);

            G.Vector v1 = (-1) * temp1.getDirectionVector();
            G.Vector v2 = temp2.getDirectionVector();

            G.Point new_a = b.move(max, v1);
            G.Point new_d = c.move(max, v2);

            G.Line side1 = new G.Line(new_a, b);
            G.Line side2 = new G.Line(c, new_d);

            D_Raud raud = new D_Raud(main, side1, side2, one.Number, one.Diameter, one.Materjal);

            return(raud);
        }
Exemplo n.º 2
0
 public bool Equals(B_Raud other)
 {
     if (other == null)
     {
         return(false);
     }
     return(this.A == other.A &&
            this.B == other.B &&
            this.Diameter == other.Diameter &&
            this.Materjal == other.Materjal);
 }
        //B HANDLE
        private bool B_vs_C_handler(G.Point mainPoint, G.Point mainEnd, G.Point sideStart, G.Edge e, G.Corner oc)
        {
            G.Line main = new G.Line(mainPoint, mainEnd);
            G.Line side = new G.Line(sideStart, mainPoint);

            G.Line temp1 = trimLine_basepoint(main, mainPoint);
            if (temp1.Length() > main.Length() * _V_.M_TRIM_TOLERANCE)
            {
                main = temp1.Copy();
            }
            if (denier(main))
            {
                return(false);
            }

            G.Line temp2 = trimLine_basepoint(side, mainPoint);
            if (temp2.Length() > side.Length() * _V_.M_TRIM_TOLERANCE)
            {
                side = temp2.Copy();
            }
            if (denier(side))
            {
                return(false);
            }

            if (main.Length() < _V_.Y_REINFORCEMENT_MAIN_RADIUS)
            {
                return(false);
            }
            if (side.Length() < _V_.Y_REINFORCEMENT_MAIN_RADIUS)
            {
                return(false);
            }

            G.Vector v1 = main.getDirectionVector();
            G.Vector v2 = side.getDirectionVector();

            double ang = G.Converter.AngleDeltaCW(v1, v2);

            if (Math.Abs(ang - Math.PI / 2) < _V_.M_B_BAR_TOLERANCE)
            {
                R.B_Raud reinf = new R.B_Raud(main, side, _V_.X_REINFORCEMENT_NUMBER, _V_.X_REINFORCEMENT_MAIN_DIAMETER, _V_.X_REINFORCEMENT_MARK);
                keep(reinf, e, oc, null);
            }
            else
            {
                R.C_Raud reinf = new R.C_Raud(main, side, _V_.X_REINFORCEMENT_NUMBER, _V_.X_REINFORCEMENT_MAIN_DIAMETER, _V_.X_REINFORCEMENT_MARK);
                keep(reinf, e, oc, null);
            }

            return(true);
        }
Exemplo n.º 4
0
        public void B_Raud_class_test()
        {
            G.Point start = new G.Point(0.0, 0.0);
            G.Point mainp = start.move(10.0, new G.Vector(1, 0));
            G.Point sidep = start.move(10.0, new G.Vector(0, 1));

            G.Line main = new G.Line(start, mainp);
            G.Line side = new G.Line(sidep, start);

            R.B_Raud reinf = new R.B_Raud(main, side, 2, 8, "B500B");

            Assert.IsTrue(reinf is R.Raud);
            Assert.IsTrue(reinf is R.B_Raud);
        }
Exemplo n.º 5
0
        public static D_Raud mergeTwoRebar(B_Raud one, B_Raud two)
        {
            G.Point a = one._SidePoint;
            G.Point b = one.StartPoint;
            G.Point c = two.StartPoint;
            G.Point d = two._EndPoint;

            G.Line side1 = new G.Line(a, b);
            G.Line main  = new G.Line(b, c);
            G.Line side2 = new G.Line(c, d);

            D_Raud raud = new D_Raud(main, side1, side2, one.Number, one.Diameter, one.Materjal);

            return(raud);
        }
Exemplo n.º 6
0
        public void B_Raud_Init_test3()
        {
            G.Point start = new G.Point(6.0, 2.0);
            G.Point mainp = start.move(5, new G.Vector(1, -1));
            G.Point sidep = start.move(10, new G.Vector(1, 1));

            G.Line main = new G.Line(start, mainp);
            G.Line side = new G.Line(sidep, start);

            R.B_Raud reinf = new R.B_Raud(main, side, 2, 8, "B500B");

            Assert.AreEqual(reinf.StartPoint.X, 6.0, 0.001);
            Assert.AreEqual(reinf.StartPoint.Y, 2.0, 0.001);
            Assert.AreEqual(reinf.Rotation, Math.PI + 3 * Math.PI / 4, 0.001);

            Assert.AreEqual(reinf.A, 10, 0.001);
            Assert.AreEqual(reinf.B, 5, 0.001);

            Assert.AreEqual(reinf.Length, 15.0, 0.001);
            Assert.AreEqual(reinf.Diameter, 8, 0.001);
            Assert.AreEqual(reinf.Materjal, "B500B");
        }
        private bool AB_handler_replace_main(R.A_Raud a, R.B_Raud b)
        {
            G.Line t1 = a.makeLine();
            G.Line t2 = b.makeMainLine();
            G.Line t3 = b.makeSideLine();

            G.Line new_a_line = new G.Line(b.IP, a.EndPoint);

            G.Point new_b_side_point = t3.Start.move(_V_.Y_CONCRETE_COVER_DELTA, (-1) * t3.getDirectionVector());
            G.Point new_b_start      = t3.End.move(_V_.Y_CONCRETE_COVER_DELTA, (-1) * t3.getDirectionVector());

            G.Point new_b_end = new_b_start.move(_V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH, t2.getDirectionVector());

            G.Line new_b_side_line = new G.Line(new_b_side_point, new_b_start);
            G.Line new_b_main_line = new G.Line(new_b_start, new_b_end);

            R.A_Raud new_A = new R.A_Raud(new_a_line, a.Number, a.Diameter, a.Materjal);
            R.B_Raud new_B = new R.B_Raud(new_b_main_line, new_b_side_line, b.Number, b.Diameter, b.Materjal);

            if (denier(new_A.makeLine()))
            {
                return(false);
            }
            if (denier(new_B.makeSideLine()))
            {
                return(false);
            }
            if (denier(new_B.makeMainLine()))
            {
                return(false);
            }

            keep_replace(new_A, new_B, a, b);

            return(true);
        }
Exemplo n.º 8
0
        private void setBendingBlockParameters(_Db.AttributeReference ar, R.Raud _ALFA_)
        {
            if (ar != null)
            {
                if (ar.Tag == "Teraseklass")
                {
                    ar.TextString = _ALFA_.Materjal.ToString();
                }
                if (ar.Tag == "Positsioon")
                {
                    ar.TextString = _ALFA_.ToStringNoCount();
                }

                if (_ALFA_ is R.A_Raud)
                {
                    R.A_Raud _BETA_ = _ALFA_ as R.A_Raud;
                    if (ar.Tag == "A")
                    {
                        ar.TextString = _BETA_.A.ToString();
                    }
                }

                if (_ALFA_ is R.B_Raud)
                {
                    R.B_Raud _BETA_ = _ALFA_ as R.B_Raud;
                    if (ar.Tag == "A")
                    {
                        ar.TextString = _BETA_.A.ToString();
                    }
                    else if (ar.Tag == "B")
                    {
                        ar.TextString = _BETA_.B.ToString();
                    }
                }

                if (_ALFA_ is R.C_Raud)
                {
                    R.C_Raud _BETA_ = _ALFA_ as R.C_Raud;
                    if (ar.Tag == "A")
                    {
                        ar.TextString = _BETA_.A.ToString();
                    }
                    else if (ar.Tag == "B")
                    {
                        ar.TextString = _BETA_.B.ToString();
                    }
                    else if (ar.Tag == "U")
                    {
                        ar.TextString = ((int)Math.Round(G.Converter.ToDeg(_BETA_.U), 0)).ToString();
                    }
                }

                if (_ALFA_ is R.D_Raud)
                {
                    R.D_Raud _BETA_ = _ALFA_ as R.D_Raud;
                    if (ar.Tag == "A")
                    {
                        ar.TextString = _BETA_.A.ToString();
                    }
                    else if (ar.Tag == "B")
                    {
                        ar.TextString = _BETA_.B2.ToString(); // parand magic
                    }
                    else if (ar.Tag == "C")
                    {
                        ar.TextString = _BETA_.C.ToString();
                    }
                }

                if (_ALFA_ is R.E_Raud)
                {
                    R.E_Raud _BETA_ = _ALFA_ as R.E_Raud;
                    if (ar.Tag == "A")
                    {
                        ar.TextString = _BETA_.A.ToString();
                    }
                    else if (ar.Tag == "B")
                    {
                        ar.TextString = _BETA_.B2.ToString(); // parand magic
                    }
                    else if (ar.Tag == "C")
                    {
                        ar.TextString = _BETA_.C.ToString();
                    }
                    else if (ar.Tag == "U")
                    {
                        ar.TextString = ((int)Math.Round(G.Converter.ToDeg(_BETA_.U), 0)).ToString();
                    }
                    else if (ar.Tag == "V")
                    {
                        ar.TextString = ((int)Math.Round(G.Converter.ToDeg(_BETA_.V), 0)).ToString();
                    }
                    else if (ar.Tag == "X")
                    {
                        ar.TextString = ((int)_BETA_.X).ToString();
                    }
                    else if (ar.Tag == "Y")
                    {
                        ar.TextString = ((int)_BETA_.Y).ToString();
                    }
                }

                if (_ALFA_ is R.U_Raud)
                {
                    R.U_Raud _BETA_ = _ALFA_ as R.U_Raud;
                    if (ar.Tag == "A")
                    {
                        ar.TextString = _BETA_.A.ToString();
                    }
                    else if (ar.Tag == "B")
                    {
                        ar.TextString = _BETA_.B.ToString();
                    }
                    else if (ar.Tag == "C")
                    {
                        ar.TextString = _BETA_.C.ToString();
                    }
                }
            }
        }
Exemplo n.º 9
0
        private void setReinforcementBlockParameters(_Db.BlockReference newBlockReference, R.Raud _ALFA_)
        {
            _Db.DynamicBlockReferencePropertyCollection aa = newBlockReference.DynamicBlockReferencePropertyCollection;
            foreach (_Db.DynamicBlockReferenceProperty a in aa)
            {
                if (a != null)
                {
                    if (_ALFA_ is R.A_Raud)
                    {
                        R.A_Raud _BETA_ = _ALFA_ as R.A_Raud;
                        if (a.PropertyName == "A")
                        {
                            a.Value = _BETA_.A;
                        }
                    }

                    else if (_ALFA_ is R.B_Raud)
                    {
                        R.B_Raud _BETA_ = _ALFA_ as R.B_Raud;
                        if (a.PropertyName == "A")
                        {
                            a.Value = _BETA_.A;
                        }
                        else if (a.PropertyName == "B")
                        {
                            a.Value = _BETA_.B;
                        }
                    }

                    else if (_ALFA_ is R.C_Raud)
                    {
                        R.C_Raud _BETA_ = _ALFA_ as R.C_Raud;
                        if (a.PropertyName == "A")
                        {
                            a.Value = _BETA_.A;
                        }
                        else if (a.PropertyName == "B")
                        {
                            a.Value = _BETA_.B;
                        }
                        else if (a.PropertyName == "U")
                        {
                            a.Value = Math.PI - _BETA_.U;                             // HERE
                        }
                    }

                    else if (_ALFA_ is R.D_Raud)
                    {
                        R.D_Raud _BETA_ = _ALFA_ as R.D_Raud;
                        if (a.PropertyName == "A")
                        {
                            a.Value = _BETA_.A;
                        }
                        else if (a.PropertyName == "B")
                        {
                            a.Value = _BETA_.B;
                        }
                        else if (a.PropertyName == "C")
                        {
                            a.Value = _BETA_.C;
                        }

                        else if (a.PropertyName == "A/C")
                        {
                            a.Value = _BETA_.A;
                        }
                    }

                    else if (_ALFA_ is R.E_Raud)
                    {
                        R.E_Raud _BETA_ = _ALFA_ as R.E_Raud;

                        if (a.PropertyName == "A")
                        {
                            a.Value = _BETA_.A;
                        }
                        else if (a.PropertyName == "B")
                        {
                            a.Value = _BETA_.B;
                        }
                        else if (a.PropertyName == "C")
                        {
                            a.Value = _BETA_.C;
                        }
                        else if (a.PropertyName == "U")
                        {
                            a.Value = Math.PI - _BETA_.U;                             // HERE
                        }
                        else if (a.PropertyName == "V")
                        {
                            if (_BETA_.B > 6000)
                            {
                                a.Value = _BETA_.V + Math.PI;
                            }
                            else
                            {
                                a.Value = _BETA_.V;
                            }
                        }
                        else if (a.PropertyName == "X")
                        {
                            a.Value = _BETA_.X;
                        }
                        else if (a.PropertyName == "Y")
                        {
                            a.Value = _BETA_.Y;
                        }
                    }
                    else if (_ALFA_ is R.U_Raud)
                    {
                        R.U_Raud _BETA_ = _ALFA_ as R.U_Raud;
                        if (a.PropertyName == "A")
                        {
                            a.Value = _BETA_.A;
                        }
                        else if (a.PropertyName == "B")
                        {
                            a.Value = _BETA_.B;
                        }
                        else if (a.PropertyName == "C")
                        {
                            a.Value = _BETA_.C;
                        }
                    }
                }
            }
        }
Exemplo n.º 10
0
        private bool B_handler_replace(R.B_Raud a, R.B_Raud b)
        {
            R.D_Raud new_reinf_long = R.B_Raud.mergeTwoRebar_long(a, b);

            bool longD = true;

            if (denier(new_reinf_long.makeMainLine()))
            {
                longD = false;
            }
            if (denier(new_reinf_long.makeSide1Line()))
            {
                longD = false;
            }
            if (denier(new_reinf_long.makeSide2Line()))
            {
                longD = false;
            }

            if (new_reinf_long.A < _V_.Y_REINFORCEMENT_MAIN_RADIUS)
            {
                longD = false;
            }
            if (new_reinf_long.B2 < _V_.Y_REINFORCEMENT_MAIN_RADIUS * 1.99)
            {
                longD = false;
            }
            if (new_reinf_long.C < _V_.Y_REINFORCEMENT_MAIN_RADIUS)
            {
                longD = false;
            }
            if (new_reinf_long.Length > _V_.X_REINFORCEMENT_MAX_D_LENGTH)
            {
                longD = false;
            }

            if (longD == true)
            {
                keep_replace(new_reinf_long, a, b);
                return(true);
            }

            R.D_Raud new_reinf_normal = R.B_Raud.mergeTwoRebar(a, b);

            if (denier(new_reinf_normal.makeMainLine()))
            {
                return(false);
            }
            if (denier(new_reinf_normal.makeSide1Line()))
            {
                return(false);
            }
            if (denier(new_reinf_normal.makeSide2Line()))
            {
                return(false);
            }

            if (new_reinf_normal.A < _V_.Y_REINFORCEMENT_MAIN_RADIUS)
            {
                return(false);
            }
            if (new_reinf_normal.B2 < _V_.Y_REINFORCEMENT_MAIN_RADIUS * 1.99)
            {
                return(false);
            }
            if (new_reinf_normal.C < _V_.Y_REINFORCEMENT_MAIN_RADIUS)
            {
                return(false);
            }
            if (new_reinf_long.Length > _V_.X_REINFORCEMENT_MAX_D_LENGTH)
            {
                return(false);
            }

            keep_replace(new_reinf_normal, a, b);

            return(true);
        }
Exemplo n.º 11
0
 private void B_remover(R.B_Raud a)
 {
     keep_remove(a);
 }