public Parametros(RSAConfiguration configuration,ParametroInfo partInfo,object[] valores) { config=configuration; pInfo=partInfo; val=valores; // // Required for Windows Form Designer support // InitializeComponent(); InitMycontrols(); // // TODO: Add any constructor code after InitializeComponent call // }
public RSADibujable(RSAConfiguration config,ParticulaInfo pInfo,ITracker track) { aleatpart=(bool)config.Valores["colorParticulaAleatorio"]; showNumber=(bool)config.Valores["mostrarNumeros"]; colorParticula=(float[])config.Valores["colorParticulas"]; idVisualizarPlanesOn=Gl.glGenLists(1); idVisualizarPlanesOff=Gl.glGenLists(1); xmlreader = new XmlParticulaReader((string)config.Valores["particulaXml"]); //ParticulaInfo xmlInfo = pInfo; rsa=new GestorAlgoritmo().CreaRSA(config,pInfo,track); // if(((string)config.Valores["rsaClase"])=="RSAAdvanced") // { // if((((string)config.Valores["parametroVariable"])=="cantidadParticulas")) // { // rsa = new RSAAdvanced((double)config.Valores["ladoCubo"], (double)config.Valores["fraccionVolumetrica"],(int)config.Valores["cantidadParticulas"], pInfo,track); // } // else // { // if(((object[])config.Valores["parametros"]).Length!=pInfo.InfoParametro.Cantidad)throw new Exception("Error"); // object[] auxArray=(object[])config.Valores["parametros"]; // rsa = new RSAAdvanced((double)config.Valores["ladoCubo"], (double)config.Valores["fraccionVolumetrica"],auxArray, pInfo,track); // } // } // else // { // if((((string)config.Valores["parametroVariable"])=="cantidadParticulas")) // { // rsa=new RSA((double)config.Valores["ladoCubo"], (double)config.Valores["fraccionVolumetrica"],(int)config.Valores["cantidadParticulas"], pInfo,track); // } // else // { // if(((object[])config.Valores["parametros"]).Length!=pInfo.InfoParametro.Cantidad)throw new Exception("Error"); // object[] auxArray=(object[])config.Valores["parametros"]; // rsa = new RSA((double)config.Valores["ladoCubo"], (double)config.Valores["fraccionVolumetrica"],auxArray, pInfo,track); // } // } spheresInBox =(bool)config.Valores["spheresInBox"]; gestorDib = new GestorDibujables(xmlreader); ParticulaDibujable.SetOwner(this); NumerosDibujables.SetOwner(this); cuboDib = new CuboDibujable(this, (float[])config.Valores["colorCubo"], new float[] { 0, 0, 0, 0 }); planosAClipear = new double[6][] { new double[4] { 1, 0, 0, rsa.Cubo.PuntoInicial.X }, new double[4] { 0, 1, 0, rsa.Cubo.PuntoInicial.Y }, new double[4] { 0, 0, 1, rsa.Cubo.PuntoInicial.Z }, new double[4] { -1, 0, 0, rsa.Cubo.PuntoInicial.X + rsa.Cubo.Lado }, new double[4] { 0, -1, 0, rsa.Cubo.PuntoInicial.Y + rsa.Cubo.Lado }, new double[4] { 0, 0, -1, rsa.Cubo.PuntoInicial.Z + rsa.Cubo.Lado } }; numdib = new NumerosDibujables[rsa.particulas.Length]; ansyswriter = gestorDib.GeneraAnsysWriter(pInfo.Nombre, this.rsa); this.Recompile(); }
public virtual RSA CreaRSA(RSAConfiguration config,ParticulaInfo pInfo,ITracker track) { Assembly partAssembly = GestorEnsamblados.GetAssemblyByName((string)config.Valores["rsaClase"],/*config.Valores["rsaEnsamblado"]*/ "TES1.dll"); RSA result=null; try { if((((string)config.Valores["parametroVariable"])=="cantidadParticulas")) { result=(RSA)partAssembly.CreateInstance((string)config.Valores["rsaClase"],true,BindingFlags.CreateInstance,null,new object[]{(double)config.Valores["ladoCubo"], (double)config.Valores["fraccionVolumetrica"],(int)config.Valores["cantidadParticulas"], pInfo,track},null,null); } else { if(((object[])config.Valores["parametros"]).Length!=pInfo.InfoParametro.Cantidad)throw new Exception("Error"); object[] auxArray=(object[])config.Valores["parametros"]; result=(RSA)partAssembly.CreateInstance((string)config.Valores["rsaClase"],true,BindingFlags.CreateInstance,null,new object[]{(double)config.Valores["ladoCubo"], (double)config.Valores["fraccionVolumetrica"],auxArray, pInfo,track},null,null); } } catch(Exception e){throw new Exception("Error al crear particula en Gestor de Creacion");} if(result==null)throw new Exception("Error al crear particula en Gestor de Creacion"); return result; }
public virtual void ReInit(RSAConfiguration config,ParticulaInfo pInfo,ITracker track) { aleatpart=(bool)config.Valores["colorParticulaAleatorio"]; showNumber=(bool)config.Valores["mostrarNumeros"]; for(int i=0;i<colorParticula.Length;i++ ) colorParticula[i]=((float[])config.Valores["colorParticulas"])[i]; // idVisualizarPlanesOn=Gl.glGenLists(1); // idVisualizarPlanesOff=Gl.glGenLists(1); xmlreader.Path=(string)config.Valores["particulaXml"]; //ParticulaInfo xmlInfo = xmlreader.GetInfoParticulas((string)config.Valores["particulaInicial"]); if(((string)config.Valores["rsaClase"])=="RSAAdvanced") { if((((string)config.Valores["parametroVariable"])=="cantidadParticulas")) { rsa = new RSAAdvanced((double)config.Valores["ladoCubo"], (double)config.Valores["fraccionVolumetrica"],(int)config.Valores["cantidadParticulas"], pInfo,track); } else { if(((object[])config.Valores["parametros"]).Length!=pInfo.InfoParametro.Cantidad)throw new Exception("Error"); object[] auxArray=(object[])config.Valores["parametros"]; rsa = new RSAAdvanced((double)config.Valores["ladoCubo"], (double)config.Valores["fraccionVolumetrica"],auxArray, pInfo,track); } } else { if((((string)config.Valores["parametroVariable"])=="cantidadParticulas")) { rsa=new RSA((double)config.Valores["ladoCubo"], (double)config.Valores["fraccionVolumetrica"],(int)config.Valores["cantidadParticulas"], pInfo,track); } else { if(((object[])config.Valores["parametros"]).Length!=pInfo.InfoParametro.Cantidad)throw new Exception("Error"); object[] auxArray=(object[])config.Valores["parametros"]; rsa = new RSA((double)config.Valores["ladoCubo"], (double)config.Valores["fraccionVolumetrica"],auxArray, pInfo,track); } } spheresInBox =(bool)config.Valores["spheresInBox"]; gestorDib.Xml=xmlreader; ParticulaDibujable.SetOwner(this); NumerosDibujables.SetOwner(this); cuboDib.Color=(float[])config.Valores["colorCubo"]; //planosAClipear = new double[6][] { new double[4] { 1, 0, 0, rsa.Cubo.PuntoInicial.X }, new double[4] { 0, 1, 0, rsa.Cubo.PuntoInicial.Y }, new double[4] { 0, 0, 1, rsa.Cubo.PuntoInicial.Z }, new double[4] { -1, 0, 0, rsa.Cubo.PuntoInicial.X + rsa.Cubo.Lado }, new double[4] { 0, -1, 0, rsa.Cubo.PuntoInicial.Y + rsa.Cubo.Lado }, new double[4] { 0, 0, -1, rsa.Cubo.PuntoInicial.Z + rsa.Cubo.Lado } }; numdib = new NumerosDibujables[rsa.particulas.Length]; ansyswriter = gestorDib.GeneraAnsysWriter(pInfo.Nombre, this.rsa); this.Recompile(); }
public WinForms() { modified=false; scene = new Scene(); scene.redraw += new EventHandler(scene_redraw); InitializeComponent(); if(Screen.PrimaryScreen.Bounds.Width==800 &&Screen.PrimaryScreen.Bounds.Height==600) { this.WindowState=FormWindowState.Maximized; } this.uiStatusBar1.Panels[0].Width=this.uiTab1.Location.X+uiTab1.Width; simpleOpenGlControl1.InitializeContexts(); scene.Initialize(); scene.Reshape(simpleOpenGlControl1.Width, simpleOpenGlControl1.Height); config=new RSAConfiguration(); reader=new XmlParticulaReader((string)config.Valores["particulaXml"]); ParametroInfo pInfo=reader.GetInfoParametros((string)config.Valores["particulaInicial"]); // varPar=(object[])config.Valores["parametros"]; // for(int i=0;i<pInfo.Cantidad;i++) // { // varPar[i]=0; // } scene.element=new RSADibujable(config, reader.GetInfoParticulas((string)config.Valores["particulaInicial"]),this); textBox1.Text=((RSADibujable)scene.element).AnsysObj.Ruta; textBox2.Text=((RSADibujable)scene.element).AnsysObj.NombreArchivo; Init(); // this.progressBar1.Location=this.uiStatusBar1.Location; // this.progressBar1.Left=this.uiTab1.Location.X+uiTab1.Width; // this.progressBar1.Top-=this.progressBar1.Height; }