Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/World.cpp

    r0763ce r4f2895  
    4848#include "Descriptors/AtomDescriptor.hpp"
    4949#include "Descriptors/AtomDescriptor_impl.hpp"
    50 #include "Descriptors/AtomIdDescriptor.hpp"
    5150#include "Descriptors/AtomSelectionDescriptor.hpp"
    5251#include "Descriptors/MoleculeDescriptor.hpp"
    5352#include "Descriptors/MoleculeDescriptor_impl.hpp"
    54 #include "Descriptors/MoleculeIdDescriptor.hpp"
    5553#include "Descriptors/MoleculeSelectionDescriptor.hpp"
    5654#include "Descriptors/SelectiveConstIterator_impl.hpp"
     
    228226    const atom * const Walker = (*bonditer)->leftatom;
    229227    const atom * const OtherWalker = (*bonditer)->rightatom;
    230     bond::ptr const _bond =
    231         const_cast<atom *>(Walker)->addBond(_deststep, const_cast<atom *>(OtherWalker));
    232     _bond->setDegree((*bonditer)->getDegree());
     228    const_cast<atom *>(Walker)->addBond(_deststep, const_cast<atom *>(OtherWalker));
    233229  }
    234230}
     
    563559  OBSERVE;
    564560  NOTIFY(SelectionChanged);
    565   const atomIdsVector_t atomids = selectedAtoms_Stack.top();
    566   boost::function<void (const atomId_t)> IdSelector =
    567       boost::bind(static_cast<void (World::*)(const atomId_t)>(&World::selectAtom), this, _1);
    568   selectedAtoms.clear();
    569   std::for_each(atomids.begin(),atomids.end(), IdSelector);
     561  selectedAtoms = selectedAtoms_Stack.top();
    570562  selectedAtoms_Stack.pop();
    571563}
     
    574566  OBSERVE;
    575567  NOTIFY(SelectionChanged);
    576   atomIdsVector_t atomids(countSelectedAtoms(), (atomId_t)-1);
    577   std::copy(
    578       MapKeyIterator<AtomSelectionConstIterator>(beginAtomSelection()),
    579       MapKeyIterator<AtomSelectionConstIterator>(endAtomSelection()),
    580       atomids.begin());
    581   selectedAtoms_Stack.push( atomids );
     568  selectedAtoms_Stack.push( selectedAtoms );
    582569  selectedAtoms.clear();
    583570}
     
    716703  OBSERVE;
    717704  NOTIFY(SelectionChanged);
    718   const moleculeIdsVector_t moleculeids = selectedMolecules_Stack.top();
    719   boost::function<void (const moleculeId_t)> IdSelector =
    720       boost::bind(static_cast<void (World::*)(const moleculeId_t)>(&World::selectMolecule), this, _1);
    721   selectedMolecules.clear();
    722   std::for_each(moleculeids.begin(),moleculeids.end(), IdSelector);
     705  selectedMolecules = selectedMolecules_Stack.top();
    723706  selectedMolecules_Stack.pop();
    724707}
     
    727710  OBSERVE;
    728711  NOTIFY(SelectionChanged);
    729   moleculeIdsVector_t moleculeids(countSelectedMolecules(), (moleculeId_t)-1);
    730   boost::function<moleculeId_t (const molecule*)> IdRetriever =
    731       boost::bind(&molecule::getId, _1);
    732   std::copy(
    733       MapKeyIterator<MoleculeSelectionConstIterator>(beginMoleculeSelection()),
    734       MapKeyIterator<MoleculeSelectionConstIterator>(endMoleculeSelection()),
    735       moleculeids.begin());
    736   selectedMolecules_Stack.push( moleculeids );
     712  selectedMolecules_Stack.push( selectedMolecules );
    737713  selectedMolecules.clear();
    738714}
Note: See TracChangeset for help on using the changeset viewer.