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