Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/TesselationAction/NonConvexEnvelopeAction.cpp

    r980dd6 r047878  
    66 */
    77
     8#include "Helpers/MemDebug.hpp"
     9
    810#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"
    918
    1019#include <iostream>
     
    1524#include "UIElements/UIFactory.hpp"
    1625#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"
    2627
    2728/****** TesselationNonConvexEnvelopeAction *****/
     
    4849{}
    4950
     51void 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
     57Dialog* 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
    5066Action::state_ptr TesselationNonConvexEnvelopeAction::performCall() {
    5167  string filename;
    52   Dialog *dialog = UIFactory::getInstance().makeDialog();
    5368  molecule * Boundary = NULL;
    5469  double SphereRadius = 0;
     
    5671  clock_t start,end;
    5772
    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);
    6175
    62   if(dialog->display()) {
     76  for (World::MoleculeSelectionIterator iter = World::getInstance().beginMoleculeSelection(); iter != World::getInstance().endMoleculeSelection(); ++iter) {
     77    Boundary = iter->second;
    6378    class Tesselation *T = NULL;
    6479    const LinkedCell *LCList = NULL;
     
    7489    delete(LCList);
    7590    delete(T);
    76     delete dialog;
    77     if (Success)
    78       return Action::success;
    79     else
    80       return Action::failure;
    8191  }
    82   delete dialog;
    83   return Action::failure;
     92  if (Success)
     93    return Action::success;
     94  else
     95    return Action::failure;
    8496}
    8597
Note: See TracChangeset for help on using the changeset viewer.