/* * Project: MoleCuilder * Description: creates and alters molecular systems * Copyright (C) 2010-2011 University of Bonn. All rights reserved. * Please see the LICENSE file or "Copyright notice" in builder.cpp for details. */ /* * SetOutputFormatsAction.cpp * * Created on: May 8, 2010 * Author: heber */ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include "CodePatterns/MemDebug.hpp" #include "Parser/ChangeTracker.hpp" #include "Parser/FormatParserStorage.hpp" #include "CodePatterns/Log.hpp" #include "CodePatterns/Verbose.hpp" #include "World.hpp" #include #include #include "SetOutputFormatsAction.hpp" using namespace MoleCuilder; // and construct the stuff #include "SetOutputFormatsAction.def" #include "Action_impl_pre.hpp" /** =========== define the function ====================== */ Action::state_ptr ParserSetOutputFormatsAction::performCall() { // obtain information getParametersfromValueStorage(); LOG(1, "Format list is: " << params.FormatList); for (vector::iterator iter = params.FormatList.begin(); iter != params.FormatList.end(); ++iter) { if (!FormatParserStorage::getInstance().add(*iter)) { ELOG(1, "Unknown parser format in ParserSetOutputFormatsAction: '" << *iter << "'"); } else { FormatParserStorage::getInstance().setOutputFormat(*iter); } } return Action::success; } Action::state_ptr ParserSetOutputFormatsAction::performUndo(Action::state_ptr _state) { // ParserLoadXyzState *state = assert_cast(_state.get()); return Action::failure; // string newName = state->mol->getName(); // state->mol->setName(state->lastName); // // return Action::state_ptr(new ParserLoadXyzState(state->mol,newName)); } Action::state_ptr ParserSetOutputFormatsAction::performRedo(Action::state_ptr _state){ return Action::failure; } bool ParserSetOutputFormatsAction::canUndo() { return false; } bool ParserSetOutputFormatsAction::shouldUndo() { return false; } /** =========== end of function ====================== */