Changes in src/World.cpp [4f2895:0763ce]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/World.cpp
r4f2895 r0763ce 48 48 #include "Descriptors/AtomDescriptor.hpp" 49 49 #include "Descriptors/AtomDescriptor_impl.hpp" 50 #include "Descriptors/AtomIdDescriptor.hpp" 50 51 #include "Descriptors/AtomSelectionDescriptor.hpp" 51 52 #include "Descriptors/MoleculeDescriptor.hpp" 52 53 #include "Descriptors/MoleculeDescriptor_impl.hpp" 54 #include "Descriptors/MoleculeIdDescriptor.hpp" 53 55 #include "Descriptors/MoleculeSelectionDescriptor.hpp" 54 56 #include "Descriptors/SelectiveConstIterator_impl.hpp" … … 226 228 const atom * const Walker = (*bonditer)->leftatom; 227 229 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()); 229 233 } 230 234 } … … 559 563 OBSERVE; 560 564 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); 562 570 selectedAtoms_Stack.pop(); 563 571 } … … 566 574 OBSERVE; 567 575 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 ); 569 582 selectedAtoms.clear(); 570 583 } … … 703 716 OBSERVE; 704 717 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); 706 723 selectedMolecules_Stack.pop(); 707 724 } … … 710 727 OBSERVE; 711 728 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 ); 713 737 selectedMolecules.clear(); 714 738 }
Note:
See TracChangeset
for help on using the changeset viewer.