コード例 #1
0
 public IElemento Add(object item)
 {
     /*            if (this.siguiente.HasNext) this.siguiente.Add(item);
     else this.siguiente = this.siguiente.Add(item);
     return (this);*/
     this.siguiente = this.siguiente.Add(item);
     return this;
 }
コード例 #2
0
ファイル: Raqueta.cs プロジェクト: ferreirapmartin/Pong
        public override Coordenada Choque(IElemento elemento)
        {
            int signo = elemento.Velocidad.X / Math.Abs(elemento.Velocidad.X);
            int velocidadX = (Math.Abs(elemento.Velocidad.X) + 1) * signo * -1, velocidadY = 1;
            int centroElemento = elemento.Posicion.Y + (elemento.Dimension.Altura / 2);

            if (centroElemento < this.Posicion.Y + this.seccion)
            {
                velocidadY = -1;
            }
            else if (centroElemento < this.Posicion.Y + (this.seccion * 2))
            {
                velocidadY = 0;
            }

            return(new Coordenada(velocidadX, velocidadY));
        }
コード例 #3
0
        public void Agregar(IElemento elemento)
        {
            if (!document.IsOpen())
            {
                Iniciar();
            }
            var tabla = elemento as Tabla;

            if (tabla != null && tabla.PosicionAbsoluta)
            {
                var pdfTable = elemento.GetElemento() as PdfPTable;
                pdfTable.TotalWidth = document.PageSize.Width;
                pdfTable.WriteSelectedRows(0, -1, tabla.PosicionX, document.PageSize.Height - tabla.PosicionY, pdfWriter.DirectContent);
            }
            else
            {
                document.Add(elemento.GetElemento());
            }
        }
コード例 #4
0
        public void MoverAMitadTramo()
        {
            List <IElemento> elementos = Tendencia_Estribo_Origen.Tendencia_Refuerzo_Origen.NervioOrigen.Lista_Elementos;
            IElemento        elemento  = elementos.Find(y => y.IsVisibleCoordAutoCAD(XI));

            if (elemento is cSubTramo)
            {
                var subtramo = elemento as cSubTramo;
                var Tramo    = subtramo.TramoOrigen;
                var xmin     = Tramo.Lista_SubTramos.First().Vistas.Perfil_AutoCAD.Reales.Min(y => y.X);
                var xmax     = Tramo.Lista_SubTramos.First().Vistas.Perfil_AutoCAD.Reales.Max(y => y.X);
                if (direccionEstribo == eLadoDeZona.Derecha)
                {
                    XI = xmin + (xmax - xmin) / 2f - LongitudZonaEstribos / 2f;
                }
                else
                {
                    XF = xmin + (xmax - xmin) / 2f + LongitudZonaEstribos / 2f;
                }
            }
        }
コード例 #5
0
 public Cola()
 {
     this.tope = new ElementoVacio();
 }
コード例 #6
0
 public void Agregar(IElemento elemento)
 {
     contenido.Add(elemento);
 }
コード例 #7
0
ファイル: Reporte.cs プロジェクト: hamekoz/hamekoz-sharp
 public void Agregar(IElemento elemento)
 {
     if (!document.IsOpen ()) {
         Iniciar ();
     }
     document.Add (elemento.GetElemento ());
 }
コード例 #8
0
        private void CrearCoordenadasReales()
        {
            float Yi                       = YInicial();
            float DeltaHEstribo            = 0.2f;
            float W_Recuadro_MoverEstribos = 0.08f;
            float DeltaEstriboBorde        = 0.1f;

            if (direccionEstribo == eLadoDeZona.Derecha)
            {
                xf = xi + LongitudZonaEstribos;
            }
            else
            {
                xi = xf - LongitudZonaEstribos;
            }
            Recuadro_ModoEdicion.Reales = new List <PointF>()
            {
                new PointF(xi - DeltaEstriboBorde, Yi - DeltaHEstribo - DeltaEstriboBorde),
                new PointF(xi + LongitudZonaEstribos + DeltaEstriboBorde, Yi - DeltaHEstribo - DeltaEstriboBorde),
                new PointF(xi + LongitudZonaEstribos + DeltaEstriboBorde, Yi + DeltaHEstribo + DeltaEstriboBorde),
                new PointF(xi - DeltaEstriboBorde, Yi + DeltaHEstribo + DeltaEstriboBorde)
            };


            if (direccionEstribo == eLadoDeZona.Derecha)
            {
                Recuadro_MoverBloqueEstribos.Reales = new List <PointF>()
                {
                    new PointF(xi - DeltaEstriboBorde - W_Recuadro_MoverEstribos / 2f, Yi - DeltaHEstribo / 2f),
                    new PointF(xi - DeltaEstriboBorde + W_Recuadro_MoverEstribos / 2f, Yi - DeltaHEstribo / 2f),
                    new PointF(xi - DeltaEstriboBorde + W_Recuadro_MoverEstribos / 2f, Yi + DeltaHEstribo / 2f),
                    new PointF(xi - DeltaEstriboBorde - W_Recuadro_MoverEstribos / 2f, Yi + DeltaHEstribo / 2f)
                };
            }
            else
            {
                Recuadro_MoverBloqueEstribos.Reales = new List <PointF>()
                {
                    new PointF(xf + DeltaEstriboBorde + W_Recuadro_MoverEstribos / 2f, Yi - DeltaHEstribo / 2f),
                    new PointF(xf + DeltaEstriboBorde - W_Recuadro_MoverEstribos / 2f, Yi - DeltaHEstribo / 2f),
                    new PointF(xf + DeltaEstriboBorde - W_Recuadro_MoverEstribos / 2f, Yi + DeltaHEstribo / 2f),
                    new PointF(xf + DeltaEstriboBorde + W_Recuadro_MoverEstribos / 2f, Yi + DeltaHEstribo / 2f)
                };
            }

            if (direccionEstribo == eLadoDeZona.Derecha)
            {
                Recuadro_CambiarDireccionBloqueEstribos.Reales = new List <PointF>()
                {
                    new PointF(xf + DeltaEstriboBorde - W_Recuadro_MoverEstribos / 2f, Yi - DeltaEstriboBorde / 1.5f),
                    new PointF(xf + DeltaEstriboBorde + W_Recuadro_MoverEstribos / 1.5f, Yi),
                    new PointF(xf + DeltaEstriboBorde - W_Recuadro_MoverEstribos / 2f, Yi + DeltaEstriboBorde / 1.5f)
                };
            }
            else
            {
                Recuadro_CambiarDireccionBloqueEstribos.Reales = new List <PointF>()
                {
                    new PointF(xi - DeltaEstriboBorde + W_Recuadro_MoverEstribos / 2f, Yi - DeltaEstriboBorde / 1.5f),
                    new PointF(xi - DeltaEstriboBorde - W_Recuadro_MoverEstribos / 1.5f, Yi),
                    new PointF(xi - DeltaEstriboBorde + W_Recuadro_MoverEstribos / 2f, Yi + DeltaEstriboBorde / 1.5f)
                };
            }


            float deltaS = 0;

            ListaEstribos.Clear();
            for (int i = 0; i < cantidad; i++)
            {
                float x = xi + deltaS;
                if (i + 1 == cantidad && CoordXEstriboEstriboFinal != cVariables.ValueNull && direccionEstribo == eLadoDeZona.Derecha)
                {
                    x = CoordXEstriboEstriboFinal;
                }
                else if (i == 0 && CoordXEstriboEstriboFinal != cVariables.ValueNull && direccionEstribo == eLadoDeZona.Izquierda)
                {
                    x = CoordXEstriboEstriboFinal;
                }
                IElemento elemento = Tendencia_Estribo_Origen.Tendencia_Refuerzo_Origen.NervioOrigen.Lista_Elementos.First(y => y.IsVisibleCoordAutoCAD(x));
                cEstribo1 estribo1 = new cEstribo1(elemento, noBarra, noRamas, Tendencia_Estribo_Origen,
                                                   new cCoordenadas()
                {
                    Reales = new List <PointF>()
                    {
                        new PointF(x, Yi - DeltaHEstribo),
                        new PointF(x, Yi + DeltaHEstribo)
                    }
                });
                deltaS += separacion;
                ListaEstribos.Add(estribo1);
            }
            AsignarLimites();
            CalcularPesoRefuerzoTransversal();
        }
コード例 #9
0
ファイル: Grupo.cs プロジェクト: hamekoz/hamekoz-sharp
 public void Agregar(IElemento elemento)
 {
     contenido.Add (elemento);
 }
コード例 #10
0
 public ElementoVacio()
 {
     this.siguiente = null;
 }
コード例 #11
0
 public ElementoHub(IElemento elemento)
 {
     _elemento = elemento;
 }
コード例 #12
0
 public ElementoLleno(object item)
 {
     this.siguiente = new ElementoVacio();
     this.objeto = item;
 }
コード例 #13
0
 }                                                   // retornar el primer item, lanzar exception si esta vacío.
 public void Remove()
 {
     this.tope = this.tope.Remove();
 }                                                    // remover el primer item, lanzar exception si esta vacío.*/
コード例 #14
0
 public void Add(object item)
 {
     this.tope = this.tope.Add(item);
 }
コード例 #15
0
 public Cola()
 {
     this.tope = new ElementoVacio();
 }
コード例 #16
0
 public ElementoLleno(object item)
 {
     this.siguiente = new ElementoVacio();
     this.objeto    = item;
 }
コード例 #17
0
ファイル: Red.cs プロジェクト: ferreirapmartin/Pong
 public Coordenada Choque(IElemento elemento)
 {
     this.Chocado?.Invoke(this, new ChocadoEventArgs(elemento));
     return(new Coordenada(elemento.Velocidad.X * -1, elemento.Velocidad.Y));
 }
コード例 #18
0
 public void Add(object item)
 {
     this.tope = this.tope.Add(item);
 }
コード例 #19
0
ファイル: Pelota.cs プロジェクト: ferreirapmartin/Pong
 public override Coordenada Choque(IElemento elemento) => throw new NotImplementedException();
コード例 #20
0
 public void Remove()
 {
     this.tope = this.tope.Remove();
 }
コード例 #21
0
 public void AgregarElemento(IElemento elemento)
 {
     this.Elementos.Add(elemento);
 }
コード例 #22
0
 public abstract Coordenada Choque(IElemento elemento);
コード例 #23
0
        public void Paint(Graphics e, float Zoom, float HeigthForm)
        {
            float Espesor = 3f;
            Pen   Pen; SolidBrush Brush_Form = new SolidBrush(Color.FromArgb(81, 126, 255)); Pen Pen_Form_NoSelect = new Pen(Color.FromArgb(0, 0, 0), 1); Pen Pen_Form_Select = new Pen(Color.FromArgb(0, 0, 0), 3);


            Pen           PenSinSelect = new Pen(cDiccionarios.ColorBarra[NoBarra], Espesor); Pen PenFormIzq, PenFormDer;
            Pen           PenSelect = new Pen(Color.FromArgb(232, 36, 13), Espesor); Pen PenSombra = new Pen(Color.FromArgb(100, 100, 100), Espesor);
            List <PointF> PuntosSobra = C_Barra.Escaladas.ToList(); for (int i = 0; i < PuntosSobra.Count; i++)

            {
                PuntosSobra[i] = new PointF(PuntosSobra[i].X + 2f, PuntosSobra[i].Y + 2f);
            }

            if (C_Barra.IsSelect | C_Barra.IsSelectArrastre)
            {
                e.DrawLines(PenSombra, PuntosSobra.ToArray());
                Pen = PenSelect;
            }
            else
            {
                Pen = PenSinSelect;
            }

            if (tendenciaOrigen.Tendencia_Refuerzo_Origen.NervioOrigen.BloquearNervio)
            {
                Pen = cNervio.PenBloquearNervio;
            }
            e.DrawLines(Pen, C_Barra.Escaladas.ToArray());

            if (C_Barra.IsSelectArrastre)
            {
                PenFormDer = C_F_Derecha.IsSelect ? Pen_Form_Select : Pen_Form_NoSelect;
                PenFormIzq = C_F_Izquierda.IsSelect ? Pen_Form_Select : Pen_Form_NoSelect;
                e.DrawEllipse(PenFormIzq, cFunctionsProgram.CrearCirculo(C_F_Izquierda.Escaladas));
                e.FillEllipse(Brush_Form, cFunctionsProgram.CrearCirculo(C_F_Izquierda.Escaladas));
                e.DrawEllipse(PenFormDer, cFunctionsProgram.CrearCirculo(C_F_Derecha.Escaladas));
                e.FillEllipse(Brush_Form, cFunctionsProgram.CrearCirculo(C_F_Derecha.Escaladas));
            }

            if (F_Base.Proyecto.EtiquetasDeBarras)
            {
                float      TamanoLetra = Zoom > 0 ? 9 * Zoom : 1;
                Font       Font1 = new Font("Calibri", TamanoLetra, FontStyle.Bold);
                string     TextBarra = $"{cantBarra}{cFunctionsProgram.ConvertireNoBarraToString(noBarra)} L= {string.Format("{0:0.00}",longitud)}";
                SolidBrush Brush_String = new SolidBrush(Color.FromArgb(0, 0, 0));
                SizeF      SText = e.MeasureString(TextBarra, Font1);
                float      XminBa = C_Barra.Escaladas.Min(x => x.X); float XmaxBa = C_Barra.Escaladas.Max(x => x.X); float YminB = C_F_Izquierda.Escaladas.Max(x => x.Y);
                PointF     PointString = new PointF(XminBa + (XmaxBa - XminBa) / 2f - SText.Width / 2f, YminB - SText.Height / 2 - Espesor);
                e.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
                e.DrawString(TextBarra, Font1, Brush_String, PointString);
            }
            if (F_Base.Proyecto.AcotamientoInteligente && C_Barra.IsSelectArrastre)
            {
                Pen PenCota = new Pen(Brushes.Gray, 2); PenCota.DashStyle = DashStyle.Dot;

                if (C_F_Derecha.IsSelect)
                {
                    IElemento Elemento = ObtenerElementoContenedorEscalado(C_F_Derecha.Escaladas.First());
                    CrearCotasInteligentes(e, Elemento, Zoom, PenCota, C_F_Derecha.Escaladas.First(), C_F_Derecha.Reales.First(), Espesor, true, true, true);
                }
                if (C_F_Izquierda.IsSelect)
                {
                    IElemento Elemento = ObtenerElementoContenedorEscalado(C_F_Izquierda.Escaladas.First());
                    CrearCotasInteligentes(e, Elemento, Zoom, PenCota, C_F_Izquierda.Escaladas.First(), C_F_Izquierda.Reales.First(), Espesor, true, true, true);
                }
                if (C_F_Central.IsSelect)
                {
                    IElemento Elemento = ObtenerElementoContenedorEscalado(C_F_Derecha.Escaladas.First());
                    CrearCotasInteligentes(e, Elemento, Zoom, PenCota, C_F_Derecha.Escaladas.First(), C_F_Derecha.Reales.First(), Espesor, true, false, true);
                    IElemento Elemento2 = ObtenerElementoContenedorEscalado(C_F_Izquierda.Escaladas.First());
                    CrearCotasInteligentes(e, Elemento2, Zoom, PenCota, C_F_Izquierda.Escaladas.First(), C_F_Izquierda.Reales.First(), Espesor, true, true, false);
                }
            }
        }
コード例 #24
0
 public ChocadoEventArgs(IElemento elemento) : base()
 {
     this.Elemento = elemento;
 }
コード例 #25
0
 public ElementoVacio()
 {
     this.siguiente = null;
 }
コード例 #26
0
 public InventarioController(IElemento elemento)
 {
     _elemento = elemento;
 }
コード例 #27
0
        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
            {
            }
        }
コード例 #28
0
 public void QuitarElemento(IElemento elemento)
 {
     this.Elementos.Remove(elemento);
 }
コード例 #29
0
 public static void MapearElementoDTO2Elemento(ElementoDTO elementoDTO, IElemento elemento)
 {
     elemento.Nombre         = elementoDTO.Nombre;
     elemento.Caducidad      = elementoDTO.Caducidad;
     elemento.TipoElementoId = elementoDTO.Tipo;
 }
コード例 #30
0
 public static void MapearElemento2ElementoDTO(IElemento elemento, ElementoDTO elementoDTO)
 {
     elementoDTO.Nombre    = elemento.Nombre;
     elementoDTO.Caducidad = elemento.Caducidad;
     elementoDTO.Tipo      = elemento.TipoElementoId;
 }
コード例 #31
0
ファイル: Pared.cs プロジェクト: ferreirapmartin/Pong
 public override Coordenada Choque(IElemento elemento)
 {
     this.OnChocado(new ChocadoEventArgs(elemento));
     return(new Coordenada(elemento.Velocidad.X, elemento.Velocidad.Y * -1));
 }