Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp

    r112b09 r047878  
    99
    1010#include "Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.hpp"
     11#include "Actions/ActionRegistry.hpp"
     12#include "log.hpp"
     13#include "molecule.hpp"
     14#include "verbose.hpp"
     15
    1116
    1217#include <iostream>
     
    1823#include "UIElements/UIFactory.hpp"
    1924#include "UIElements/Dialog.hpp"
    20 #include "Actions/MapOfActions.hpp"
    21 
    22 #include "log.hpp"
    23 #include "molecule.hpp"
    24 #include "verbose.hpp"
     25#include "UIElements/ValueStorage.hpp"
    2526
    2627/****** MoleculeRotateToPrincipalAxisSystemAction *****/
     
    4748{}
    4849
     50void MoleculeRotateToPrincipalAxisSystem() {
     51  ActionRegistry::getInstance().getActionByName(MoleculeRotateToPrincipalAxisSystemAction::NAME)->call(Action::NonInteractive);
     52};
     53
     54Dialog* MoleculeRotateToPrincipalAxisSystemAction::fillDialog(Dialog *dialog) {
     55  ASSERT(dialog,"No Dialog given when filling action dialog");
     56
     57  dialog->queryEmpty(NAME, MapOfActions::getInstance().getDescription(NAME));
     58
     59  return dialog;
     60}
     61
    4962Action::state_ptr MoleculeRotateToPrincipalAxisSystemAction::performCall() {
    50   Dialog *dialog = UIFactory::getInstance().makeDialog();
    5163  molecule *mol = NULL;
    5264
    53   dialog->queryMolecule(NAME, &mol, MapOfActions::getInstance().getDescription(NAME));
    54 
    55   if(dialog->display()) {
     65  for (World::MoleculeSelectionIterator iter = World::getInstance().beginMoleculeSelection(); iter != World::getInstance().endMoleculeSelection(); ++iter) {
     66    mol = iter->second;
    5667    DoLog(0) && (Log() << Verbose(0) << "Converting to prinicipal axis system." << endl);
    5768    mol->PrincipalAxisSystem(true);
    58     delete dialog;
    59     return Action::success;
    6069  }
    61   delete dialog;
    62   return Action::failure;
     70  return Action::success;
    6371}
    6472
Note: See TracChangeset for help on using the changeset viewer.