- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/TesselationAction/ConvexEnvelopeAction.cpp
rf6bd32 r047878 6 6 */ 7 7 8 #include "Helpers/MemDebug.hpp" 9 8 10 #include "Actions/TesselationAction/ConvexEnvelopeAction.hpp" 11 #include "Actions/ActionRegistry.hpp" 12 #include "boundary.hpp" 13 #include "config.hpp" 14 #include "linkedcell.hpp" 15 #include "log.hpp" 16 #include "molecule.hpp" 17 #include "verbose.hpp" 18 #include "World.hpp" 9 19 10 20 #include <iostream> … … 15 25 #include "UIElements/UIFactory.hpp" 16 26 #include "UIElements/Dialog.hpp" 17 #include "Actions/MapOfActions.hpp" 18 19 #include "atom.hpp" 20 #include "boundary.hpp" 21 #include "config.hpp" 22 #include "linkedcell.hpp" 23 #include "log.hpp" 24 #include "molecule.hpp" 25 #include "verbose.hpp" 26 #include "World.hpp" 27 #include "UIElements/ValueStorage.hpp" 27 28 28 29 /****** TesselationConvexEnvelopeAction *****/ … … 49 50 {} 50 51 52 void TesselationConvexEnvelope(std::string &filenameConvex, std::string &filenameNonConvex) { 53 ValueStorage::getInstance().setCurrentValue("convex-file", filenameConvex); 54 ValueStorage::getInstance().setCurrentValue("nonconvex-file", filenameConvex); 55 ActionRegistry::getInstance().getActionByName(TesselationConvexEnvelopeAction::NAME)->call(Action::NonInteractive); 56 }; 57 58 Dialog* TesselationConvexEnvelopeAction::fillDialog(Dialog *dialog) { 59 ASSERT(dialog,"No Dialog given when filling action dialog"); 60 61 dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME)); 62 dialog->queryString("convex-file", ValueStorage::getInstance().getDescription("convex-file")); 63 dialog->queryString("nonconvex-file", ValueStorage::getInstance().getDescription("nonconvex-file")); 64 65 return dialog; 66 } 67 51 68 Action::state_ptr TesselationConvexEnvelopeAction::performCall() { 52 69 string filenameConvex; 53 70 string filenameNonConvex; 54 Dialog *dialog = UIFactory::getInstance().makeDialog();55 71 molecule * mol = NULL; 56 bool Success = false;72 bool Success = true; 57 73 config *configuration = World::getInstance().getConfig(); 58 74 59 dialog->queryMolecule(NAME, &mol, MapOfActions::getInstance().getDescription(NAME)); 60 dialog->queryString("convex-file", &filenameConvex, MapOfActions::getInstance().getDescription("convex-file")); 61 dialog->queryString("nonconvex-file", &filenameNonConvex, MapOfActions::getInstance().getDescription("nonconvex-file")); 75 ValueStorage::getInstance().queryCurrentValue("convex-file", filenameConvex); 76 ValueStorage::getInstance().queryCurrentValue("nonconvex-file", filenameNonConvex); 62 77 63 if(dialog->display()) { 78 for (World::MoleculeSelectionIterator iter = World::getInstance().beginMoleculeSelection(); iter != World::getInstance().endMoleculeSelection(); ++iter) { 79 mol = iter->second; 64 80 class Tesselation *TesselStruct = NULL; 65 81 const LinkedCell *LCList = NULL; … … 68 84 DoLog(1) && (Log() << Verbose(1) << "Storing tecplot non-convex data in " << filenameNonConvex << "." << endl); 69 85 LCList = new LinkedCell(mol, 100.); 70 //FindConvexBorder(mol, LCList, argv[argptr]); 86 Boundaries *BoundaryPoints = NULL; 87 //FindConvexBorder(mol, BoundaryPoints, TesselStruct, LCList, argv[argptr]); 71 88 // TODO: Beide Funktionen sollten streams anstelle des Filenamen benutzen, besser fuer unit tests 72 89 FindNonConvexBorder(mol, TesselStruct, LCList, 50., filenameNonConvex.c_str()); … … 78 95 delete(TesselStruct); 79 96 delete(LCList); 80 delete dialog;81 if (Success)82 return Action::success;83 else84 return Action::failure;85 97 } 86 delete dialog; 87 return Action::failure; 98 if (Success) 99 return Action::success; 100 else 101 return Action::failure; 88 102 } 89 103
Note:
See TracChangeset
for help on using the changeset viewer.