| [81c980b] | 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 | 
 | 
|---|
 | 8 | /*
 | 
|---|
 | 9 |  * SetTremoloAtomdataAction.cpp
 | 
|---|
 | 10 |  *
 | 
|---|
 | 11 |  *  Created on: Aug 9, 2011
 | 
|---|
 | 12 |  *      Author: heber
 | 
|---|
 | 13 |  */
 | 
|---|
 | 14 | 
 | 
|---|
 | 15 | // include config.h
 | 
|---|
 | 16 | #ifdef HAVE_CONFIG_H
 | 
|---|
 | 17 | #include <config.h>
 | 
|---|
 | 18 | #endif
 | 
|---|
 | 19 | 
 | 
|---|
 | 20 | #include "CodePatterns/MemDebug.hpp"
 | 
|---|
 | 21 | 
 | 
|---|
 | 22 | #include "Parser/TremoloParser.hpp"
 | 
|---|
 | 23 | #include "Parser/FormatParserStorage.hpp"
 | 
|---|
 | 24 | #include "CodePatterns/Log.hpp"
 | 
|---|
 | 25 | #include "CodePatterns/Verbose.hpp"
 | 
|---|
 | 26 | 
 | 
|---|
 | 27 | #include <iostream>
 | 
|---|
 | 28 | #include <string>
 | 
|---|
 | 29 | 
 | 
|---|
 | 30 | #include <boost/filesystem/fstream.hpp>
 | 
|---|
 | 31 | 
 | 
|---|
 | 32 | using namespace std;
 | 
|---|
 | 33 | 
 | 
|---|
 | 34 | #include "SetTremoloAtomdataAction.hpp"
 | 
|---|
 | 35 | 
 | 
|---|
 | 36 | // and construct the stuff
 | 
|---|
 | 37 | #include "SetTremoloAtomdataAction.def"
 | 
|---|
 | 38 | #include "Action_impl_pre.hpp"
 | 
|---|
 | 39 | /** =========== define the function ====================== */
 | 
|---|
 | 40 | Action::state_ptr ParserSetTremoloAtomdataAction::performCall() {
 | 
|---|
 | 41 |   // obtain information
 | 
|---|
 | 42 |   getParametersfromValueStorage();
 | 
|---|
 | 43 | 
 | 
|---|
 | 44 |   TremoloParser &tremolo = FormatParserStorage::getInstance().getTremolo();
 | 
|---|
 | 45 | 
 | 
|---|
 | 46 |   DoLog(1) && (Log() << Verbose(1) << "Setting Tremolo's ATOMDATA to: '" << params.atomdata_string << "'" << std::endl);
 | 
|---|
 | 47 | 
 | 
|---|
 | 48 |   tremolo.setAtomData(params.atomdata_string);
 | 
|---|
 | 49 | 
 | 
|---|
 | 50 |   return Action::success;
 | 
|---|
 | 51 | }
 | 
|---|
 | 52 | 
 | 
|---|
 | 53 | Action::state_ptr ParserSetTremoloAtomdataAction::performUndo(Action::state_ptr _state) {
 | 
|---|
 | 54 | //  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
 | 
|---|
 | 55 | 
 | 
|---|
 | 56 |   return Action::failure;
 | 
|---|
 | 57 | //  string newName = state->mol->getName();
 | 
|---|
 | 58 | //  state->mol->setName(state->lastName);
 | 
|---|
 | 59 | //
 | 
|---|
 | 60 | //  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
 | 
|---|
 | 61 | }
 | 
|---|
 | 62 | 
 | 
|---|
 | 63 | Action::state_ptr ParserSetTremoloAtomdataAction::performRedo(Action::state_ptr _state){
 | 
|---|
 | 64 |   return Action::failure;
 | 
|---|
 | 65 | }
 | 
|---|
 | 66 | 
 | 
|---|
 | 67 | bool ParserSetTremoloAtomdataAction::canUndo() {
 | 
|---|
 | 68 |   return false;
 | 
|---|
 | 69 | }
 | 
|---|
 | 70 | 
 | 
|---|
 | 71 | bool ParserSetTremoloAtomdataAction::shouldUndo() {
 | 
|---|
 | 72 |   return false;
 | 
|---|
 | 73 | }
 | 
|---|
 | 74 | /** =========== end of function ====================== */
 | 
|---|