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