- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/WorldAction/RemoveSphereOfAtomsAction.cpp
r952f38 rd74077 12 12 #include "Descriptors/AtomDescriptor.hpp" 13 13 #include "atom.hpp" 14 #include "Helpers/Log.hpp" 14 #include "element.hpp" 15 #include "log.hpp" 15 16 #include "molecule.hpp" 16 #include " LinearAlgebra/Vector.hpp"17 #include " Helpers/Verbose.hpp"17 #include "vector.hpp" 18 #include "verbose.hpp" 18 19 #include "World.hpp" 19 20 … … 25 26 #include "UIElements/UIFactory.hpp" 26 27 #include "UIElements/Dialog.hpp" 27 #include " Actions/ValueStorage.hpp"28 #include "UIElements/ValueStorage.hpp" 28 29 29 30 const char WorldRemoveSphereOfAtomsAction::NAME[] = "remove-sphere"; … … 42 43 }; 43 44 44 Dialog* WorldRemoveSphereOfAtomsAction:: fillDialog(Dialog *dialog) {45 ASSERT(dialog,"No Dialog given when filling action dialog");45 Dialog* WorldRemoveSphereOfAtomsAction::createDialog() { 46 Dialog *dialog = UIFactory::getInstance().makeDialog(); 46 47 47 48 dialog->queryDouble(NAME, ValueStorage::getInstance().getDescription(NAME)); … … 62 63 vector<molecule *> molecules = World::getInstance().getAllMolecules(); 63 64 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; 65 67 // TODO: This is not necessary anymore when atoms are completely handled by World (create/destroy and load/save) 66 68 for (vector<molecule *>::iterator iter = molecules.begin();iter != molecules.end();++iter) … … 68 70 World::getInstance().destroyAtom(*AtomRunner); 69 71 } 72 // else { 73 // cout << "Keeping" << (*AtomRunner)->getType()->symbol << (*AtomRunner)->getId() << " at " << (*AtomRunner)->getPosition() << " as distance is " << sqrt((*AtomRunner)->DistanceSquared(point)) << endl; 74 // } 70 75 } 71 76 return Action::success;
Note:
See TracChangeset
for help on using the changeset viewer.
