Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/World.cpp

    r4f2895 r0763ce  
    4848#include "Descriptors/AtomDescriptor.hpp"
    4949#include "Descriptors/AtomDescriptor_impl.hpp"
     50#include "Descriptors/AtomIdDescriptor.hpp"
    5051#include "Descriptors/AtomSelectionDescriptor.hpp"
    5152#include "Descriptors/MoleculeDescriptor.hpp"
    5253#include "Descriptors/MoleculeDescriptor_impl.hpp"
     54#include "Descriptors/MoleculeIdDescriptor.hpp"
    5355#include "Descriptors/MoleculeSelectionDescriptor.hpp"
    5456#include "Descriptors/SelectiveConstIterator_impl.hpp"
     
    226228    const atom * const Walker = (*bonditer)->leftatom;
    227229    const atom * const OtherWalker = (*bonditer)->rightatom;
    228     const_cast<atom *>(Walker)->addBond(_deststep, const_cast<atom *>(OtherWalker));
     230    bond::ptr const _bond =
     231        const_cast<atom *>(Walker)->addBond(_deststep, const_cast<atom *>(OtherWalker));
     232    _bond->setDegree((*bonditer)->getDegree());
    229233  }
    230234}
     
    559563  OBSERVE;
    560564  NOTIFY(SelectionChanged);
    561   selectedAtoms = selectedAtoms_Stack.top();
     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);
    562570  selectedAtoms_Stack.pop();
    563571}
     
    566574  OBSERVE;
    567575  NOTIFY(SelectionChanged);
    568   selectedAtoms_Stack.push( selectedAtoms );
     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 );
    569582  selectedAtoms.clear();
    570583}
     
    703716  OBSERVE;
    704717  NOTIFY(SelectionChanged);
    705   selectedMolecules = selectedMolecules_Stack.top();
     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);
    706723  selectedMolecules_Stack.pop();
    707724}
     
    710727  OBSERVE;
    711728  NOTIFY(SelectionChanged);
    712   selectedMolecules_Stack.push( selectedMolecules );
     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 );
    713737  selectedMolecules.clear();
    714738}
Note: See TracChangeset for help on using the changeset viewer.