Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/WorldAction/RemoveSphereOfAtomsAction.cpp

    rd74077 r952f38  
    1212#include "Descriptors/AtomDescriptor.hpp"
    1313#include "atom.hpp"
    14 #include "element.hpp"
    15 #include "log.hpp"
     14#include "Helpers/Log.hpp"
    1615#include "molecule.hpp"
    17 #include "vector.hpp"
    18 #include "verbose.hpp"
     16#include "LinearAlgebra/Vector.hpp"
     17#include "Helpers/Verbose.hpp"
    1918#include "World.hpp"
    2019
     
    2625#include "UIElements/UIFactory.hpp"
    2726#include "UIElements/Dialog.hpp"
    28 #include "UIElements/ValueStorage.hpp"
     27#include "Actions/ValueStorage.hpp"
    2928
    3029const char WorldRemoveSphereOfAtomsAction::NAME[] = "remove-sphere";
     
    4342};
    4443
    45 Dialog* WorldRemoveSphereOfAtomsAction::createDialog() {
    46   Dialog *dialog = UIFactory::getInstance().makeDialog();
     44Dialog* WorldRemoveSphereOfAtomsAction::fillDialog(Dialog *dialog) {
     45  ASSERT(dialog,"No Dialog given when filling action dialog");
    4746
    4847  dialog->queryDouble(NAME, ValueStorage::getInstance().getDescription(NAME));
     
    6362  vector<molecule *> molecules = World::getInstance().getAllMolecules();
    6463  for (vector<atom*>::iterator AtomRunner = AllAtoms.begin(); AtomRunner != AllAtoms.end(); ++AtomRunner) {
    65     if ((*AtomRunner)->DistanceSquared(point) > radius*radius) { // distance to first above radius ...
    66 //      cout << "Removing " << (*AtomRunner)->getType()->symbol << (*AtomRunner)->getId() << " at " << (*AtomRunner)->getPosition() << " as distance is " << sqrt((*AtomRunner)->DistanceSquared(point)) << endl;
     64    if (point.DistanceSquared((*AtomRunner)->x) > radius*radius) { // distance to first above radius ...
    6765      // TODO: This is not necessary anymore when atoms are completely handled by World (create/destroy and load/save)
    6866      for (vector<molecule *>::iterator iter = molecules.begin();iter != molecules.end();++iter)
     
    7068      World::getInstance().destroyAtom(*AtomRunner);
    7169    }
    72 //    else {
    73 //      cout << "Keeping" << (*AtomRunner)->getType()->symbol << (*AtomRunner)->getId() << " at " << (*AtomRunner)->getPosition() << " as distance is " << sqrt((*AtomRunner)->DistanceSquared(point)) << endl;
    74 //    }
    7570  }
    7671  return Action::success;
Note: See TracChangeset for help on using the changeset viewer.