Exemple #1
0
        private static void ParaDosSubTramos(ref List <PdfPTable> Tablas, cSubTramo S1, cSubTramo S2, cNervio nervio = null)
        {
            PdfPTable Tabla2 = new PdfPTable(9);

            if (nervio != null)
            {
                Tabla2.AddCell(Vcell($"{nervio.Nombre} - {nervio.PisoOrigen.Nombre}", BordAb: 0, Colspan: 6, IsBold: true));
                Tabla2.AddCell(Vcell("", 0, 0, 0, 0, 3));
            }
            string Text1 = $"Sección (BXH) {S1.Seccion.B}x{S1.Seccion.H} L={S1.Longitud}m";
            string Text2 = $"Sección (BXH) {S2.Seccion.B}x{S2.Seccion.H} L={S2.Longitud}m";


            Tabla2.AddCell(Vcell(Text1, BordeD: 0, Colspan: 3));
            Tabla2.AddCell(Vcell(Text2, Colspan: 3));
            Tabla2.AddCell(Vcell("", 0, 0, 0, 0, 3, 9));

            object[][][] DatosResumidos1 = cFunctionsProgram.EstacionesResumidas(S1.Estaciones);
            object[][][] DatosResumidos2 = cFunctionsProgram.EstacionesResumidas(S2.Estaciones);

            #region Parte Negativa

            Tabla2.AddCell(Vcell($"Mu-={string.Format("{0:0.00}", DatosResumidos1[1][1][0])}", 1, 0, 0, 0));
            Tabla2.AddCell(Vcell($"  ", 0, 0, 0, 0));
            Tabla2.AddCell(Vcell($"Mu-={string.Format("{0:0.00}", DatosResumidos1[1][1][1])}", 0, 0, 0, 0));

            Tabla2.AddCell(Vcell($"Mu-={string.Format("{0:0.00}", DatosResumidos2[1][1][0])}", 1, 0, 0, 0));
            Tabla2.AddCell(Vcell($"  ", 0, 0, 0, 0));
            Tabla2.AddCell(Vcell($"Mu-={string.Format("{0:0.00}", DatosResumidos2[1][1][1])}", 0, 1, 0, 0));


            Tabla2.AddCell(Vcell($"Asr={string.Format("{0:0.00}", DatosResumidos1[1][2][0])}", 1, 0, 0, 0));
            Tabla2.AddCell(Vcell($"  ", 0, 0, 0, 0));
            Tabla2.AddCell(Vcell($"Asr={string.Format("{0:0.00}", DatosResumidos1[1][2][1])}", 0, 0, 0, 0));

            Tabla2.AddCell(Vcell($"Asr={string.Format("{0:0.00}", DatosResumidos2[1][2][0])}", 1, 0, 0, 0));
            Tabla2.AddCell(Vcell($"  ", 0, 0, 0, 0));
            Tabla2.AddCell(Vcell($"Asr={string.Format("{0:0.00}", DatosResumidos2[1][2][1])}", 0, 1, 0, 0));


            Tabla2.AddCell(Vcell($"As={string.Format("{0:0.00}", DatosResumidos1[1][0][0])}", 1, 0, 0, 0.5f));
            Tabla2.AddCell(Vcell($"  ", 0, 0, 0, 0.5f));
            Tabla2.AddCell(Vcell($"As={string.Format("{0:0.00}", DatosResumidos1[1][0][1])}", 0, 0, 0, 0.5f));

            Tabla2.AddCell(Vcell($"As={string.Format("{0:0.00}", DatosResumidos2[1][0][0])}", 1, 0, 0, 0.5f));
            Tabla2.AddCell(Vcell($"  ", 0, 0, 0, 0.5f));
            Tabla2.AddCell(Vcell($"As={string.Format("{0:0.00}", DatosResumidos2[1][0][1])}", 0, 1, 0, 0.5f));

            #endregion

            #region PartePositiva
            Tabla2.AddCell(Vcell($"Mu+={string.Format("{0:0.00}", DatosResumidos1[0][1][0])}", 1, 0, 0, 0));
            Tabla2.AddCell(Vcell($"Mu+={string.Format("{0:0.00}", DatosResumidos1[0][1][1])}", 0, 0, 0, 0));
            Tabla2.AddCell(Vcell($"Mu+={string.Format("{0:0.00}", DatosResumidos1[0][1][2])}", 0, 0, 0, 0));

            Tabla2.AddCell(Vcell($"Mu+={string.Format("{0:0.00}", DatosResumidos2[0][1][0])}", 1, 0, 0, 0));
            Tabla2.AddCell(Vcell($"Mu+={string.Format("{0:0.00}", DatosResumidos2[0][1][1])}", 0, 0, 0, 0));
            Tabla2.AddCell(Vcell($"Mu+={string.Format("{0:0.00}", DatosResumidos2[0][1][2])}", 0, 1, 0, 0));


            Tabla2.AddCell(Vcell($"Asr={string.Format("{0:0.00}", DatosResumidos1[0][2][0])}", 1, 0, 0, 0));
            Tabla2.AddCell(Vcell($"Asr={string.Format("{0:0.00}", DatosResumidos1[0][2][1])}", 0, 0, 0, 0));
            Tabla2.AddCell(Vcell($"Asr={string.Format("{0:0.00}", DatosResumidos1[0][2][2])}", 0, 0, 0, 0));

            Tabla2.AddCell(Vcell($"Asr={string.Format("{0:0.00}", DatosResumidos2[0][2][0])}", 1, 0, 0, 0));
            Tabla2.AddCell(Vcell($"Asr={string.Format("{0:0.00}", DatosResumidos2[0][2][1])}", 0, 0, 0, 0));
            Tabla2.AddCell(Vcell($"Asr={string.Format("{0:0.00}", DatosResumidos2[0][2][2])}", 0, 1, 0, 0));


            Tabla2.AddCell(Vcell($"As={string.Format("{0:0.00}", DatosResumidos1[0][0][0])}", 1, 0, 0, 0.5f));
            Tabla2.AddCell(Vcell($"As={string.Format("{0:0.00}", DatosResumidos1[0][0][1])}", 0, 0, 0, 0.5f));
            Tabla2.AddCell(Vcell($"As={string.Format("{0:0.00}", DatosResumidos1[0][0][2])}", 0, 0, 0, 0.5f));

            Tabla2.AddCell(Vcell($"As={string.Format("{0:0.00}", DatosResumidos2[0][0][0])}", 1, 0, 0, 0.5f));
            Tabla2.AddCell(Vcell($"As={string.Format("{0:0.00}", DatosResumidos2[0][0][1])}", 0, 0, 0, 0.5f));
            Tabla2.AddCell(Vcell($"As={string.Format("{0:0.00}", DatosResumidos2[0][0][2])}", 0, 1, 0, 0.5f));

            #endregion

            #region Estribos
            Tabla2.AddCell(Vcell($"V+={string.Format("{0:0.00}", DatosResumidos1[2][0][0])}", 1, 0, 0, 0));
            Tabla2.AddCell(Vcell($"  ", 0, 0, 0, 0));
            Tabla2.AddCell(Vcell($"V-={string.Format("{0:0.00}", DatosResumidos1[2][0][1])}", 0, 0, 0, 0));

            Tabla2.AddCell(Vcell($"V+={string.Format("{0:0.00}", DatosResumidos2[2][0][0])}", 1, 0, 0, 0));
            Tabla2.AddCell(Vcell($"  ", 0, 0, 0, 0));
            Tabla2.AddCell(Vcell($"V-={string.Format("{0:0.00}", DatosResumidos2[2][0][1])}", 0, 1, 0, 0));

            if (DatosResumidos1[2][1][0].ToString() != "" && DatosResumidos1[2][1][1].ToString() != "")
            {
                Tabla2.AddCell(Vcell($"{DatosResumidos1[2][1][0]}", 1, 0, 0, 1));
                Tabla2.AddCell(Vcell($"  ", 0, 0, 0, 1));
                Tabla2.AddCell(Vcell($"{DatosResumidos1[2][1][1]}", 0, 0, 0, 1));
            }
            else if (DatosResumidos1[2][1][0].ToString() != "")
            {
                Tabla2.AddCell(Vcell($"{DatosResumidos1[2][1][0]}", 1, 0, 0, 1, 3));
            }
            else if (DatosResumidos1[2][1][1].ToString() != "")
            {
                Tabla2.AddCell(Vcell($"{DatosResumidos1[2][1][1]}", 1, 0, 0, 1, 3));
            }
            else
            {
                Tabla2.AddCell(Vcell($"  ", 1, 0, 0, 1, 3));
            }

            if (DatosResumidos2[2][1][0].ToString() != "" && DatosResumidos2[2][1][1].ToString() != "")
            {
                Tabla2.AddCell(Vcell($"{DatosResumidos2[2][1][0]}", 1, 0, 0, 1));
                Tabla2.AddCell(Vcell($"  ", 0, 0, 0, 1));
                Tabla2.AddCell(Vcell($"{DatosResumidos2[2][1][1]}", 0, 1, 0, 1));
            }
            else if (DatosResumidos2[2][1][0].ToString() != "")
            {
                Tabla2.AddCell(Vcell($"{DatosResumidos2[2][1][0]}", 1, 1, 0, 1, 3));
            }
            else if (DatosResumidos2[2][1][1].ToString() != "")
            {
                Tabla2.AddCell(Vcell($"{DatosResumidos2[2][1][1]}", 1, 1, 0, 1, 3));
            }
            else
            {
                Tabla2.AddCell(Vcell($"  ", 1, 1, 0, 1, 3));
            }


            Tabla2.AddCell(Vcell($" ", 0, 0, 0, 0, 9));
            Tablas.Add(Tabla2);
            #endregion
        }
        public void Paint_AutoCAD(float X, float Y)
        {
            Barras.ForEach(x => x.Paint_AutoCAD(X, Y));

            //Agregar Cotas
            try
            {
                if (UbicacionRefuerzo == eUbicacionRefuerzo.Inferior)
                {
                    Barras.ForEach(Barra =>
                    {
                        if (!Barra.TraslpaoDerecha && !Barra.TraslapoIzquierda)
                        {
                            cSubTramo SubTramo = (cSubTramo)Tendencia_Refuerzo_Origen.NervioOrigen.Lista_Elementos.Find(x => x.IsVisibleCoordAutoCAD(Barra.XF) && x is cSubTramo);

                            if (SubTramo != null)
                            {
                                float Ymax = Barra.C_Barra.Reales.Max(x => x.Y);

                                PointF P1 = B_Operaciones_Matricialesl.Operaciones.Traslacion(new PointF(Barra.XF, Ymax), X, Y);
                                PointF P2 = B_Operaciones_Matricialesl.Operaciones.Traslacion(new PointF(SubTramo.Vistas.Perfil_AutoCAD.Reales[2].X, Ymax), X, Y);
                                FunctionsAutoCAD.AddCota(P1, P2, cVariables.C_Cotas, cVariables.Estilo_Cotas, cVariables.Desplazamiento_Cotas_RefuerzoInferior,
                                                         DeplazaTextY: cVariables.DesplazamientoTexto_Cotas);
                            }
                        }
                    });
                }
                else
                {
                    void AgregarCotaBarrasIndependietes(cBarra Barra, IElemento ElementoXF)
                    {
                        float  Ymax = Barra.C_Barra.Reales.Max(x => x.Y);
                        PointF P1   = B_Operaciones_Matricialesl.Operaciones.Traslacion(new PointF(ElementoXF.Vistas.Perfil_AutoCAD.Reales[0].X, Ymax), X, Y);
                        PointF P2   = B_Operaciones_Matricialesl.Operaciones.Traslacion(new PointF(Barra.C_Barra.Reales.Max(y => y.X), Ymax), X, Y);

                        FunctionsAutoCAD.AddCota(P1, P2, cVariables.C_Cotas, cVariables.Estilo_Cotas, -cVariables.Desplazamiento_Cotas_RefuerzoSuperior,
                                                 DeplazaTextY: cVariables.DesplazamientoTexto_Cotas);
                    }

                    int MaximoNivelBarras = Barras.Max(x => x.Nivel);
                    Barras.ForEach(Barra =>
                    {
                        IElemento ElementoXI = Tendencia_Refuerzo_Origen.NervioOrigen.Lista_Elementos.Find(x => x.IsVisibleCoordAutoCAD(Barra.C_Barra.Reales.Min(y => y.X)));
                        IElemento ElementoXF = Tendencia_Refuerzo_Origen.NervioOrigen.Lista_Elementos.Find(x => x.IsVisibleCoordAutoCAD(Barra.C_Barra.Reales.Max(y => y.X)));

                        if (!(ElementoXI is cApoyo) && !(ElementoXF is cApoyo) && Barra.GanchoDerecha == eTipoGancho.None && Barra.GanchoIzquierda == eTipoGancho.None)
                        {
                            if (Barra.Nivel == MaximoNivelBarras)
                            {
                                AgregarCotaBarrasIndependietes(Barra, ElementoXF);
                            }
                            else
                            {
                                cBarra BarraNivelPosterior = EncontrarBarraConentedora(Barra);
                                if (BarraNivelPosterior == null)
                                {
                                    AgregarCotaBarrasIndependietes(Barra, ElementoXF);
                                }
                                else
                                {
                                    float Ymax     = BarraNivelPosterior.C_Barra.Reales.Max(x => x.Y);
                                    float DespCota = Barra.C_Barra.Reales.Min(x => x.Y) - Ymax;
                                    PointF P1      = B_Operaciones_Matricialesl.Operaciones.Traslacion(new PointF(BarraNivelPosterior.C_Barra.Reales.Max(y => y.X), Ymax), X, Y);
                                    PointF P2      = B_Operaciones_Matricialesl.Operaciones.Traslacion(new PointF(Barra.C_Barra.Reales.Max(y => y.X), Barra.C_Barra.Reales.Min(x => x.Y)), X, Y);
                                    FunctionsAutoCAD.AddCota(P1, P2, cVariables.C_Cotas, cVariables.Estilo_Cotas, -DespCota - 0.13f,
                                                             DeplazaTextY: cVariables.DesplazamientoTexto_Cotas, RA: false);
                                }
                            }
                        }
                    });
                }

                Barras.ForEach(x => { x.CotaParaAutoCADIzquierda = false; x.CotaParaAutoCADDerecha = false; });
                Barras.ForEach(Barra =>
                {
                    if (Barra.TraslpaoDerecha && !Barra.CotaParaAutoCADDerecha)
                    {
                        List <cBarra> Barras1 = Barras.FindAll(x => x.TraslapoIzquierda);
                        foreach (cBarra barra in Barras1)
                        {
                            if (barra != Barra && XiPerteneceaX0X1(Barra.C_Barra.Reales.Min(y => y.X), Barra.C_Barra.Reales.Max(y => y.X), barra.XI))
                            {
                                Barra.CotaParaAutoCADDerecha   = true;
                                barra.CotaParaAutoCADIzquierda = true;
                                cBarra BarraPredominante       = barra.C_Barra.Reales.Max(x => x.Y) > Barra.C_Barra.Reales.Max(x => x.Y) ? barra : Barra;
                                float Ymax     = BarraPredominante.C_Barra.Reales.Min(x => x.Y);
                                float DespCota = cVariables.Desplazamiento_Cotas_RefuerzoInferior;
                                if (UbicacionRefuerzo == eUbicacionRefuerzo.Superior)
                                {
                                    DespCota = -cVariables.Desplazamiento_Cotas_RefuerzoSuperior;
                                }
                                PointF P1 = B_Operaciones_Matricialesl.Operaciones.Traslacion(new PointF(barra.C_Barra.Reales.Min(y => y.X), Ymax), X, Y);
                                PointF P2 = B_Operaciones_Matricialesl.Operaciones.Traslacion(new PointF(Barra.C_Barra.Reales.Max(y => y.X), Ymax), X, Y);
                                FunctionsAutoCAD.AddCota(P1, P2, cVariables.C_Cotas, cVariables.Estilo_Cotas, DespCota,
                                                         DeplazaTextY: cVariables.DesplazamientoTexto_Cotas, RA: false);
                            }
                        }
                    }
                });
            }
            catch
            {
            }
        }