Changes in src/moleculelist.cpp [24a5e0:46d958]
- File:
-
- 1 edited
-
src/moleculelist.cpp (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/moleculelist.cpp
r24a5e0 r46d958 7 7 #include <cstring> 8 8 9 #include "World.hpp"10 9 #include "atom.hpp" 11 10 #include "bond.hpp" … … 25 24 /** Constructor for MoleculeListClass. 26 25 */ 27 MoleculeListClass::MoleculeListClass(World *_world) : 28 world(_world) 26 MoleculeListClass::MoleculeListClass() 29 27 { 30 28 // empty lists … … 40 38 for (MoleculeList::iterator ListRunner = ListOfMolecules.begin(); ListRunner != ListOfMolecules.end(); ListRunner++) { 41 39 Log() << Verbose(4) << "ListOfMolecules: Freeing " << *ListRunner << "." << endl; 42 world->destroyMolecule(*ListRunner);40 delete (*ListRunner); 43 41 } 44 42 Log() << Verbose(4) << "Freeing ListOfMolecules." << endl; … … 139 137 * \param *out output stream 140 138 */ 141 void MoleculeListClass::Enumerate(o stream *out)139 void MoleculeListClass::Enumerate(ofstream *out) 142 140 { 143 141 element* Elemental = NULL; … … 215 213 // remove src 216 214 ListOfMolecules.remove(srcmol); 217 World::get()->destroyMolecule(srcmol);215 delete(srcmol); 218 216 return true; 219 217 }; … … 750 748 void MoleculeListClass::DissectMoleculeIntoConnectedSubgraphs(const periodentafel * const periode, config * const configuration) 751 749 { 752 molecule *mol = World::get()->createMolecule();750 molecule *mol = new molecule(periode); 753 751 atom *Walker = NULL; 754 752 atom *Advancer = NULL; … … 775 773 } 776 774 // remove the molecule 777 World::get()->destroyMolecule(*MolRunner);775 delete(*MolRunner); 778 776 ListOfMolecules.erase(MolRunner); 779 777 } … … 797 795 molecule **molecules = Malloc<molecule *>(MolCount, "config::Load() - **molecules"); 798 796 for (int i=0;i<MolCount;i++) { 799 molecules[i] = World::get()->createMolecule();797 molecules[i] = (molecule*) new molecule(mol->elemente); 800 798 molecules[i]->ActiveFlag = true; 801 799 strncpy(molecules[i]->name, mol->name, MAXSTRINGSIZE); … … 895 893 OBSERVE; 896 894 molecule *mol = NULL; 897 mol = World::get()->createMolecule();895 mol = new molecule(periode); 898 896 insert(mol); 899 897 }; … … 904 902 char filename[MAXSTRINGSIZE]; 905 903 Log() << Verbose(0) << "Format should be XYZ with: ShorthandOfElement\tX\tY\tZ" << endl; 906 mol = World::get()->createMolecule();904 mol = new molecule(periode); 907 905 do { 908 906 Log() << Verbose(0) << "Enter file name: "; … … 962 960 mol = *ListRunner; 963 961 ListOfMolecules.erase(ListRunner); 964 World::get()->destroyMolecule(mol);962 delete(mol); 965 963 break; 966 964 } … … 1009 1007 // remove the leaf itself 1010 1008 if (Leaf != NULL) { 1011 World::get()->destroyMolecule(Leaf);1009 delete (Leaf); 1012 1010 Leaf = NULL; 1013 1011 }
Note:
See TracChangeset
for help on using the changeset viewer.
