- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/SelectionAction/NotAllAtomsAction.cpp
r952f38 rbcf653 1 /* 2 * Project: MoleCuilder 3 * Description: creates and alters molecular systems 4 * Copyright (C) 2010 University of Bonn. All rights reserved. 5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details. 6 */ 7 1 8 /* 2 9 * NotAllAtomsAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" … … 28 40 // memento to remember the state when undoing 29 41 30 class Selection AllAtomsState : public ActionState {42 class SelectionNotAllAtomsState : public ActionState { 31 43 public: 32 Selection AllAtomsState(std::vector<atom*> _selectedAtoms) :44 SelectionNotAllAtomsState(std::vector<atom*> _selectedAtoms) : 33 45 selectedAtoms(_selectedAtoms) 34 46 {} … … 61 73 DoLog(1) && (Log() << Verbose(1) << "Unselecting all atoms." << endl); 62 74 World::getInstance().clearAtomSelection(); 63 return Action::state_ptr(new Selection AllAtomsState(selectedAtoms));75 return Action::state_ptr(new SelectionNotAllAtomsState(selectedAtoms)); 64 76 } 65 77 66 78 Action::state_ptr SelectionNotAllAtomsAction::performUndo(Action::state_ptr _state) { 67 Selection AllAtomsState *state = assert_cast<SelectionAllAtomsState*>(_state.get());79 SelectionNotAllAtomsState *state = assert_cast<SelectionNotAllAtomsState*>(_state.get()); 68 80 69 81 World::getInstance().clearAtomSelection(); … … 71 83 World::getInstance().selectAtom(*iter); 72 84 73 return Action::state_ptr(new Selection AllAtomsState(state->selectedAtoms));85 return Action::state_ptr(new SelectionNotAllAtomsState(state->selectedAtoms)); 74 86 } 75 87 76 88 Action::state_ptr SelectionNotAllAtomsAction::performRedo(Action::state_ptr _state){ 77 Selection AllAtomsState *state = assert_cast<SelectionAllAtomsState*>(_state.get());89 SelectionNotAllAtomsState *state = assert_cast<SelectionNotAllAtomsState*>(_state.get()); 78 90 79 91 World::getInstance().clearAtomSelection(); 80 92 81 return Action::state_ptr(new Selection AllAtomsState(state->selectedAtoms));93 return Action::state_ptr(new SelectionNotAllAtomsState(state->selectedAtoms)); 82 94 } 83 95
Note:
See TracChangeset
for help on using the changeset viewer.