Ignore:
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
    18/*
    29 * NotAllAtomsAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
     
    2840// memento to remember the state when undoing
    2941
    30 class SelectionAllAtomsState : public ActionState {
     42class SelectionNotAllAtomsState : public ActionState {
    3143public:
    32   SelectionAllAtomsState(std::vector<atom*> _selectedAtoms) :
     44  SelectionNotAllAtomsState(std::vector<atom*> _selectedAtoms) :
    3345    selectedAtoms(_selectedAtoms)
    3446  {}
     
    6173  DoLog(1) && (Log() << Verbose(1) << "Unselecting all atoms." << endl);
    6274  World::getInstance().clearAtomSelection();
    63   return Action::state_ptr(new SelectionAllAtomsState(selectedAtoms));
     75  return Action::state_ptr(new SelectionNotAllAtomsState(selectedAtoms));
    6476}
    6577
    6678Action::state_ptr SelectionNotAllAtomsAction::performUndo(Action::state_ptr _state) {
    67   SelectionAllAtomsState *state = assert_cast<SelectionAllAtomsState*>(_state.get());
     79  SelectionNotAllAtomsState *state = assert_cast<SelectionNotAllAtomsState*>(_state.get());
    6880
    6981  World::getInstance().clearAtomSelection();
     
    7183    World::getInstance().selectAtom(*iter);
    7284
    73   return Action::state_ptr(new SelectionAllAtomsState(state->selectedAtoms));
     85  return Action::state_ptr(new SelectionNotAllAtomsState(state->selectedAtoms));
    7486}
    7587
    7688Action::state_ptr SelectionNotAllAtomsAction::performRedo(Action::state_ptr _state){
    77   SelectionAllAtomsState *state = assert_cast<SelectionAllAtomsState*>(_state.get());
     89  SelectionNotAllAtomsState *state = assert_cast<SelectionNotAllAtomsState*>(_state.get());
    7890
    7991  World::getInstance().clearAtomSelection();
    8092
    81   return Action::state_ptr(new SelectionAllAtomsState(state->selectedAtoms));
     93  return Action::state_ptr(new SelectionNotAllAtomsState(state->selectedAtoms));
    8294}
    8395
Note: See TracChangeset for help on using the changeset viewer.