- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/TesselationAction/NonConvexEnvelopeAction.cpp
r980dd6 r047878 6 6 */ 7 7 8 #include "Helpers/MemDebug.hpp" 9 8 10 #include "Actions/TesselationAction/NonConvexEnvelopeAction.hpp" 11 #include "Actions/ActionRegistry.hpp" 12 #include "boundary.hpp" 13 #include "linkedcell.hpp" 14 #include "log.hpp" 15 #include "molecule.hpp" 16 #include "verbose.hpp" 17 #include "World.hpp" 9 18 10 19 #include <iostream> … … 15 24 #include "UIElements/UIFactory.hpp" 16 25 #include "UIElements/Dialog.hpp" 17 #include "Actions/MapOfActions.hpp" 18 19 #include "atom.hpp" 20 #include "boundary.hpp" 21 #include "linkedcell.hpp" 22 #include "log.hpp" 23 #include "molecule.hpp" 24 #include "verbose.hpp" 25 #include "World.hpp" 26 #include "UIElements/ValueStorage.hpp" 26 27 27 28 /****** TesselationNonConvexEnvelopeAction *****/ … … 48 49 {} 49 50 51 void TesselationNonConvexEnvelope(double radius, std::string &filename) { 52 ValueStorage::getInstance().setCurrentValue(TesselationNonConvexEnvelopeAction::NAME, radius); 53 ValueStorage::getInstance().setCurrentValue("nonconvex-file", filename); 54 ActionRegistry::getInstance().getActionByName(TesselationNonConvexEnvelopeAction::NAME)->call(Action::NonInteractive); 55 }; 56 57 Dialog* TesselationNonConvexEnvelopeAction::fillDialog(Dialog *dialog) { 58 ASSERT(dialog,"No Dialog given when filling action dialog"); 59 60 dialog->queryDouble(NAME, MapOfActions::getInstance().getDescription(NAME)); 61 dialog->queryString("nonconvex-file", MapOfActions::getInstance().getDescription("nonconvex-file")); 62 63 return dialog; 64 } 65 50 66 Action::state_ptr TesselationNonConvexEnvelopeAction::performCall() { 51 67 string filename; 52 Dialog *dialog = UIFactory::getInstance().makeDialog();53 68 molecule * Boundary = NULL; 54 69 double SphereRadius = 0; … … 56 71 clock_t start,end; 57 72 58 dialog->queryMolecule(NAME, &Boundary, MapOfActions::getInstance().getDescription(NAME)); 59 dialog->queryString("nonconvex-file", &filename, MapOfActions::getInstance().getDescription("nonconvex-file")); 60 dialog->queryDouble("sphere-radius", &SphereRadius, MapOfActions::getInstance().getDescription("sphere-radius")); 73 ValueStorage::getInstance().queryCurrentValue(NAME, SphereRadius); 74 ValueStorage::getInstance().queryCurrentValue("nonconvex-file", filename); 61 75 62 if(dialog->display()) { 76 for (World::MoleculeSelectionIterator iter = World::getInstance().beginMoleculeSelection(); iter != World::getInstance().endMoleculeSelection(); ++iter) { 77 Boundary = iter->second; 63 78 class Tesselation *T = NULL; 64 79 const LinkedCell *LCList = NULL; … … 74 89 delete(LCList); 75 90 delete(T); 76 delete dialog;77 if (Success)78 return Action::success;79 else80 return Action::failure;81 91 } 82 delete dialog; 83 return Action::failure; 92 if (Success) 93 return Action::success; 94 else 95 return Action::failure; 84 96 } 85 97
Note:
See TracChangeset
for help on using the changeset viewer.