public void initIMD() { Main.current_frame = Main.total_frames; Main.total_frames += 1; molecules = GetComponent<Main> ().molecules; energies= new IMDEnergies(); temp_pos = new float[molecules[0].Atoms.Count*3]; if(IMD_isConnected()) IMD_stop(); IMD_init(server, port); IMD_setNbParticles(molecules[0].Atoms.Count); for (int i =0; i<molecules.Count; i++) { molecules[i].Gameobject[Main.current_frame]=molecules[i].Gameobject[Main.current_frame-1]; for(int j=0;j<molecules[i].Atoms.Count;j++){ molecules[i].Atoms[j].Gameobject[Main.current_frame]=molecules[i].Atoms[j].Gameobject[Main.current_frame-1]; } } init = true; }
public Molecule(Molecule m) : base(m) { chains = new List<Chain> (); residues = new List<Residue> (); atoms = new List<Atom> (); for (int i = 0; i<m.Chains.Count; i++) { Chain c= new Chain(m.Chains[i]); this.Chains.Add(c); for (int j = 0; j<m.Chains[i].Residues.Count; j++) { Residue r = new Residue(m.Chains[i].Residues[j],c); this.Chains[i].Residues.Add(r); this.Residues.Add(r); for (int k =0; k<m.Chains[i].Residues[j].Atoms.Count; k++) { Atom a = new Atom(m.Chains[i].Residues[j].Atoms[k],r,c); this.Chains[i].Residues[j].Atoms.Add(a); this.Chains[i].Atoms.Add(a); this.Atoms.Add(a); } } } bonds = new List<int[]> (m.Bonds); chainsBonds = new List<List<int>> (m.chainsBonds); color = m.color; type = m.type; render = m.render; select = m.select; energies = m.energies; }