- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/GraphAction/SubgraphDissectionAction.cpp
r3213f2 rf47e00b 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"47 44 #include "Actions/ActionQueue.hpp" 48 45 #include "Actions/ActionRegistry.hpp" … … 63 60 void GraphSubgraphDissectionAction::prepare(ActionRegistry &AR) 64 61 { 65 actions.addAction(AR.getActionByName(std::string("push-atom-selection")));66 62 actions.addAction(AR.getActionByName(std::string("select-all-atoms"))); 67 63 actions.addAction(AR.getActionByName(std::string("destroy-adjacency"))); 68 64 actions.addAction(AR.getActionByName(std::string("create-adjacency"))); 69 65 actions.addAction(AR.getActionByName(std::string("update-molecules"))); 70 actions.addAction(AR.getActionByName(std::string("pop-atom-selection")));71 66 isPrepared = true; 72 67 } … … 79 74 } 80 75 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 81 85 ActionState::ptr GraphSubgraphDissectionAction::performCall(){ 86 // we need to "emulate" that all atoms have been selected without destroying 87 // current selection 88 const std::vector<atom *> selected_atoms = World::getInstance().getSelectedAtoms(); 82 89 ActionState::ptr state(MakroAction::performCall()); 90 reselectAtoms(selected_atoms); 83 91 84 92 return state; … … 86 94 87 95 ActionState::ptr GraphSubgraphDissectionAction::performUndo(ActionState::ptr _state) { 96 // we need to "emulate" that all atoms have been selected without destroying 97 // current selection 98 const std::vector<atom *> selected_atoms = World::getInstance().getSelectedAtoms(); 88 99 ActionState::ptr state(MakroAction::performUndo(_state)); 100 reselectAtoms(selected_atoms); 89 101 90 102 return state; … … 92 104 93 105 ActionState::ptr GraphSubgraphDissectionAction::performRedo(ActionState::ptr _state){ 106 // we need to "emulate" that all atoms have been selected without destroying 107 // current selection 108 const std::vector<atom *> selected_atoms = World::getInstance().getSelectedAtoms(); 94 109 ActionState::ptr state(MakroAction::performRedo(_state)); 110 reselectAtoms(selected_atoms); 95 111 96 112 return state;
Note:
See TracChangeset
for help on using the changeset viewer.