- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/Legacy/oldmenu.cpp
r181488 r98a2987 9 9 #include "Legacy/oldmenu.hpp" 10 10 #include "analysis_correlation.hpp" 11 #include "World.hpp" 11 12 #include "atom.hpp" 12 13 #include "bond.hpp" … … 77 78 case 'a': // absolute coordinates of atom 78 79 Log() << Verbose(0) << "Enter absolute coordinates." << endl; 79 first = new atom;80 first = World::get()->createAtom(); 80 81 first->x.AskPosition(mol->cell_size, false); 81 82 first->type = periode->AskElement(); // give type … … 84 85 85 86 case 'b': // relative coordinates of atom wrt to reference point 86 first = new atom;87 first = World::get()->createAtom(); 87 88 valid = true; 88 89 do { … … 100 101 101 102 case 'c': // relative coordinates of atom wrt to already placed atom 102 first = new atom;103 first = World::get()->createAtom(); 103 104 valid = true; 104 105 do { … … 116 117 117 118 case 'd': // two atoms, two angles and a distance 118 first = new atom;119 first = World::get()->createAtom(); 119 120 valid = true; 120 121 do { … … 216 217 217 218 case 'e': // least square distance position to a set of atoms 218 first = new atom;219 first = World::get()->createAtom(); 219 220 atoms = new (Vector*[128]); 220 221 valid = true; … … 238 239 mol->AddAtom(first); // add to molecule 239 240 } else { 240 delete first;241 World::get()->destroyAtom(first); 241 242 Log() << Verbose(0) << "Please enter at least two vectors!\n"; 242 243 } … … 736 737 Log() << Verbose(0) << "New element by atomic number Z: "; 737 738 cin >> Z; 738 first-> type = periode->FindElement(Z);739 first->setType(Z); 739 740 Log() << Verbose(0) << "Atom " << first->nr << "'s element is " << first->type->name << "." << endl; 740 741 } … … 781 782 x.AddVector(&y); // per factor one cell width further 782 783 for (int k=count;k--;) { // go through every atom of the original cell 783 first = new atom(); // create a new body784 first = World::get()->createAtom(); // create a new body 784 785 first->x.CopyVector(vectors[k]); // use coordinate of original atom 785 786 first->x.AddVector(&x); // translate the coordinates … … 811 812 void oldmenu::ManipulateMolecules(periodentafel *periode, MoleculeListClass *molecules, config *configuration) 812 813 { 813 atom *first = NULL;814 814 Vector x,y,z,n; // coordinates for absolute point in cell volume 815 int j, axis, count, faktor;816 815 char choice; // menu choice char 817 816 molecule *mol = NULL; 818 element **Elements;819 Vector **vectors;820 817 MoleculeLeafClass *Subgraphs = NULL; 821 818 … … 1092 1089 A++; 1093 1090 } 1094 delete(mol);1091 World::get()->destroyMolecule(mol); 1095 1092 }; 1096 1093
Note:
See TracChangeset
for help on using the changeset viewer.