Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/molecule.cpp

    ra7aebd r0a5beb  
    3535#include "CodePatterns/MemDebug.hpp"
    3636
    37 #include <cstring>
     37#include <algorithm>
    3838#include <boost/bind.hpp>
    3939#include <boost/foreach.hpp>
     40#include <cstring>
    4041
    4142#include <gsl/gsl_inline.h>
     
    102103molecule::~molecule()
    103104{
     105  // inform all UI elements about imminent removal before anything is lost
     106  {
     107    OBSERVE;
     108    NOTIFY(AboutToBeRemoved);
     109  }
    104110  CleanupMolecule();
    105111};
     
    648654void removeAtomsinMolecule(molecule *&_mol)
    649655{
     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());
    650660  // 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)
    652663    World::getInstance().destroyAtom(*AtomRunner);
    653664  // make sure that pointer os not usable
     
    934945    output << "Map is ";
    935946    for (molecule::const_iterator iter = begin(); iter != end(); ++iter) {
    936       if ((*iter)->father == NULL) {
     947      if ((*iter)->getFather() == NULL) {
    937948        AtomicMap[(*iter)->getNr()] = -2;
    938949      } else {
     
    940951      //for (int i=0;i<AtomCount;i++) { // search atom
    941952        //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))
    944955            AtomicMap[(*iter)->getNr()] = (*runner)->getNr();
    945956        }
Note: See TracChangeset for help on using the changeset viewer.