/* * SetGaussianBasisAction.cpp * * Created on: May 8, 2010 * Author: heber */ #include "Actions/WorldAction/SetGaussianBasisAction.hpp" #include "config.hpp" #include "World.hpp" #include #include using namespace std; #include "UIElements/UIFactory.hpp" #include "UIElements/Dialog.hpp" #include "Actions/MapOfActions.hpp" const char WorldSetGaussianBasisAction::NAME[] = "set-basis"; WorldSetGaussianBasisAction::WorldSetGaussianBasisAction() : Action(NAME) {} WorldSetGaussianBasisAction::~WorldSetGaussianBasisAction() {} Action::state_ptr WorldSetGaussianBasisAction::performCall() { Dialog *dialog = UIFactory::getInstance().makeDialog(); dialog->queryString(NAME, &World::getInstance().getConfig()->basis, MapOfActions::getInstance().getDescription(NAME)); if(dialog->display()) { delete dialog; return Action::success; } else { delete dialog; return Action::failure; } } Action::state_ptr WorldSetGaussianBasisAction::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 WorldSetGaussianBasisAction::performRedo(Action::state_ptr _state){ return Action::failure; } bool WorldSetGaussianBasisAction::canUndo() { return false; } bool WorldSetGaussianBasisAction::shouldUndo() { return false; } const string WorldSetGaussianBasisAction::getName() { return NAME; }