- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp
r112b09 r047878 9 9 10 10 #include "Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.hpp" 11 #include "Actions/ActionRegistry.hpp" 12 #include "log.hpp" 13 #include "molecule.hpp" 14 #include "verbose.hpp" 15 11 16 12 17 #include <iostream> … … 18 23 #include "UIElements/UIFactory.hpp" 19 24 #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" 25 26 26 27 /****** MoleculeRotateToPrincipalAxisSystemAction *****/ … … 47 48 {} 48 49 50 void MoleculeRotateToPrincipalAxisSystem() { 51 ActionRegistry::getInstance().getActionByName(MoleculeRotateToPrincipalAxisSystemAction::NAME)->call(Action::NonInteractive); 52 }; 53 54 Dialog* 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 49 62 Action::state_ptr MoleculeRotateToPrincipalAxisSystemAction::performCall() { 50 Dialog *dialog = UIFactory::getInstance().makeDialog();51 63 molecule *mol = NULL; 52 64 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; 56 67 DoLog(0) && (Log() << Verbose(0) << "Converting to prinicipal axis system." << endl); 57 68 mol->PrincipalAxisSystem(true); 58 delete dialog;59 return Action::success;60 69 } 61 delete dialog; 62 return Action::failure; 70 return Action::success; 63 71 } 64 72
Note:
See TracChangeset
for help on using the changeset viewer.