- Timestamp:
- Apr 23, 2021, 9:02:12 PM (5 years ago)
- Branches:
- Candidate_v1.7.0, stable
- Children:
- 2390e6
- Parents:
- d54e37
- git-author:
- Frederik Heber <frederik.heber@…> (04/10/21 19:57:13)
- git-committer:
- Frederik Heber <frederik.heber@…> (04/23/21 21:02:12)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/SelectionAction/Atoms/NotAtomByElementAction.cpp
rd54e37 r87c1cc 57 57 ActionState::ptr SelectionNotAtomByElementAction::performCall() { 58 58 LOG(1, "Unselecting atoms of type " << *params.elemental.get()); 59 std::vector<const atom *> unselectedAtoms = const_cast<const World &>(World::getInstance()). 60 getAllAtoms(!AtomsBySelection()); 59 // build undo state: get all previously unselected atoms of the given type 60 const World &world = World::getConstInstance(); 61 const std::vector<const atom *> atoms_of_element = world. 62 getAllAtoms(AtomByType(params.elemental.get())); 63 std::vector<atomId_t> unselectedAtomIds; 64 unselectedAtomIds.reserve(atoms_of_element.size()); 65 BOOST_FOREACH(const atom * _atom, atoms_of_element) { 66 if (!world.isSelected(_atom)) 67 unselectedAtomIds.push_back(_atom->getId()); 68 } 61 69 World::getInstance().unselectAllAtoms(AtomByType(params.elemental.get())); 62 LOG(0, World::getInstance().countSelectedAtoms() << " atoms remain selected.");63 return ActionState::ptr(new SelectionNotAtomByElementState(unselectedAtom s,params));70 LOG(0, world.countSelectedAtoms() << " atoms remain selected."); 71 return ActionState::ptr(new SelectionNotAtomByElementState(unselectedAtomIds,params)); 64 72 } 65 73 … … 68 76 69 77 World::getInstance().selectAllAtoms(AtomByType(state->params.elemental.get())); 70 BOOST_FOREACH(const atom *_atom, state->unselectedAtoms)71 World::getInstance().unselectAtom(_atom );78 BOOST_FOREACH(const atomId_t _atomid, state->unselectedAtomIds) 79 World::getInstance().unselectAtom(_atomid); 72 80 73 81 return ActionState::ptr(_state);
Note:
See TracChangeset
for help on using the changeset viewer.
