- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/GraphAction/SubgraphDissectionAction.cpp
rf47e00b r3213f2 42 42 #include "Actions/GraphAction/UpdateMoleculesAction.hpp" 43 43 #include "Actions/GraphAction/SubgraphDissectionAction.hpp" 44 #include "Actions/SelectionAction/Atoms/PushAtomsAction.hpp" 45 #include "Actions/SelectionAction/Atoms/PopAtomsAction.hpp" 46 #include "Actions/SelectionAction/Atoms/AllAtomsAction.hpp" 44 47 #include "Actions/ActionQueue.hpp" 45 48 #include "Actions/ActionRegistry.hpp" … … 60 63 void GraphSubgraphDissectionAction::prepare(ActionRegistry &AR) 61 64 { 65 actions.addAction(AR.getActionByName(std::string("push-atom-selection"))); 62 66 actions.addAction(AR.getActionByName(std::string("select-all-atoms"))); 63 67 actions.addAction(AR.getActionByName(std::string("destroy-adjacency"))); 64 68 actions.addAction(AR.getActionByName(std::string("create-adjacency"))); 65 69 actions.addAction(AR.getActionByName(std::string("update-molecules"))); 70 actions.addAction(AR.getActionByName(std::string("pop-atom-selection"))); 66 71 isPrepared = true; 67 72 } … … 74 79 } 75 80 76 void reselectAtoms(const std::vector<atom *> &selected_atoms)77 {78 World::getInstance().clearAtomSelection();79 for (std::vector<atom *>::const_iterator iter = selected_atoms.begin();80 iter != selected_atoms.end();81 ++iter)82 World::getInstance().selectAtom(*iter);83 }84 85 81 ActionState::ptr GraphSubgraphDissectionAction::performCall(){ 86 // we need to "emulate" that all atoms have been selected without destroying87 // current selection88 const std::vector<atom *> selected_atoms = World::getInstance().getSelectedAtoms();89 82 ActionState::ptr state(MakroAction::performCall()); 90 reselectAtoms(selected_atoms);91 83 92 84 return state; … … 94 86 95 87 ActionState::ptr GraphSubgraphDissectionAction::performUndo(ActionState::ptr _state) { 96 // we need to "emulate" that all atoms have been selected without destroying97 // current selection98 const std::vector<atom *> selected_atoms = World::getInstance().getSelectedAtoms();99 88 ActionState::ptr state(MakroAction::performUndo(_state)); 100 reselectAtoms(selected_atoms);101 89 102 90 return state; … … 104 92 105 93 ActionState::ptr GraphSubgraphDissectionAction::performRedo(ActionState::ptr _state){ 106 // we need to "emulate" that all atoms have been selected without destroying107 // current selection108 const std::vector<atom *> selected_atoms = World::getInstance().getSelectedAtoms();109 94 ActionState::ptr state(MakroAction::performRedo(_state)); 110 reselectAtoms(selected_atoms);111 95 112 96 return state;
Note:
See TracChangeset
for help on using the changeset viewer.