Changes in src/molecule.cpp [0a5beb:a7aebd]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/molecule.cpp
r0a5beb ra7aebd 35 35 #include "CodePatterns/MemDebug.hpp" 36 36 37 #include < algorithm>37 #include <cstring> 38 38 #include <boost/bind.hpp> 39 39 #include <boost/foreach.hpp> 40 #include <cstring>41 40 42 41 #include <gsl/gsl_inline.h> … … 103 102 molecule::~molecule() 104 103 { 105 // inform all UI elements about imminent removal before anything is lost106 {107 OBSERVE;108 NOTIFY(AboutToBeRemoved);109 }110 104 CleanupMolecule(); 111 105 }; … … 654 648 void removeAtomsinMolecule(molecule *&_mol) 655 649 { 656 // copy list of atoms from molecule as it will be changed657 std::vector<atom *> atoms;658 atoms.resize(_mol->getAtomCount(), NULL);659 std::copy(_mol->begin(), _mol->end(), atoms.begin());660 650 // remove each atom from world 661 for(std::vector<atom *>::iterator AtomRunner = atoms.begin(); 662 AtomRunner != atoms.end(); ++AtomRunner) 651 for(molecule::iterator AtomRunner = _mol->begin(); !_mol->empty(); AtomRunner = _mol->begin()) 663 652 World::getInstance().destroyAtom(*AtomRunner); 664 653 // make sure that pointer os not usable … … 945 934 output << "Map is "; 946 935 for (molecule::const_iterator iter = begin(); iter != end(); ++iter) { 947 if ((*iter)-> getFather()== NULL) {936 if ((*iter)->father == NULL) { 948 937 AtomicMap[(*iter)->getNr()] = -2; 949 938 } else { … … 951 940 //for (int i=0;i<AtomCount;i++) { // search atom 952 941 //for (int j=0;j<OtherMolecule->getAtomCount();j++) { 953 //LOG(4, "Comparing father " << (*iter)-> getFather() << " with the other one " << (*runner)->getFather()<< ".");954 if ((*iter)-> getFather()== (*runner))942 //LOG(4, "Comparing father " << (*iter)->father << " with the other one " << (*runner)->father << "."); 943 if ((*iter)->father == (*runner)) 955 944 AtomicMap[(*iter)->getNr()] = (*runner)->getNr(); 956 945 }
Note:
See TracChangeset
for help on using the changeset viewer.