/* * Project: MoleCuilder * Description: creates and alters molecular systems * Copyright (C) 2010 University of Bonn. All rights reserved. * Please see the LICENSE file or "Copyright notice" in builder.cpp for details. */ /* * UndoAction.cpp * * Created on: Oct 27, 2010 * Author: heber */ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include "CodePatterns/MemDebug.hpp" #include "ActionHistory.hpp" #include #include "CodePatterns/Assert.hpp" using namespace MoleCuilder; #include "Actions/UndoAction.hpp" // and construct the stuff #include "UndoAction.def" #include "Action_impl_pre.hpp" /** =========== define the function ====================== */ Action::state_ptr UndoAction::performCall(){ std::cout << "Undo" << std::endl; ActionHistory::getInstance().undoLast(); return Action::success; } Action::state_ptr UndoAction::performUndo(Action::state_ptr){ ASSERT(0,"Cannot undo an undo (should use redo for this"); return Action::success; } Action::state_ptr UndoAction::performRedo(Action::state_ptr){ ASSERT(0,"Cannot redo an undo"); return Action::success; } bool UndoAction::canUndo(){ return false; } bool UndoAction::shouldUndo(){ return false; } /** =========== end of function ====================== */