Ignore:
File:
1 edited

Legend:

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

    r952f38 rd74077  
    1212#include "Descriptors/AtomDescriptor.hpp"
    1313#include "atom.hpp"
    14 #include "Helpers/Log.hpp"
     14#include "element.hpp"
     15#include "log.hpp"
    1516#include "molecule.hpp"
    16 #include "LinearAlgebra/Vector.hpp"
    17 #include "Helpers/Verbose.hpp"
     17#include "vector.hpp"
     18#include "verbose.hpp"
    1819#include "World.hpp"
    1920
     
    2526#include "UIElements/UIFactory.hpp"
    2627#include "UIElements/Dialog.hpp"
    27 #include "Actions/ValueStorage.hpp"
     28#include "UIElements/ValueStorage.hpp"
    2829
    2930const char WorldRemoveSphereOfAtomsAction::NAME[] = "remove-sphere";
     
    4243};
    4344
    44 Dialog* WorldRemoveSphereOfAtomsAction::fillDialog(Dialog *dialog) {
    45   ASSERT(dialog,"No Dialog given when filling action dialog");
     45Dialog* WorldRemoveSphereOfAtomsAction::createDialog() {
     46  Dialog *dialog = UIFactory::getInstance().makeDialog();
    4647
    4748  dialog->queryDouble(NAME, ValueStorage::getInstance().getDescription(NAME));
     
    6263  vector<molecule *> molecules = World::getInstance().getAllMolecules();
    6364  for (vector<atom*>::iterator AtomRunner = AllAtoms.begin(); AtomRunner != AllAtoms.end(); ++AtomRunner) {
    64     if (point.DistanceSquared((*AtomRunner)->x) > radius*radius) { // distance to first above radius ...
     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;
    6567      // TODO: This is not necessary anymore when atoms are completely handled by World (create/destroy and load/save)
    6668      for (vector<molecule *>::iterator iter = molecules.begin();iter != molecules.end();++iter)
     
    6870      World::getInstance().destroyAtom(*AtomRunner);
    6971    }
     72//    else {
     73//      cout << "Keeping" << (*AtomRunner)->getType()->symbol << (*AtomRunner)->getId() << " at " << (*AtomRunner)->getPosition() << " as distance is " << sqrt((*AtomRunner)->DistanceSquared(point)) << endl;
     74//    }
    7075  }
    7176  return Action::success;
Note: See TracChangeset for help on using the changeset viewer.