Ignore:
Timestamp:
Jun 16, 2010, 12:24:21 PM (15 years ago)
Author:
Tillmann Crueger <crueger@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
492279
Parents:
f8e486 (diff), 980dd6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Broken: Merge commit 'Gitosis/stable' into stable

Conflicts:

molecuilder/src/Actions/AnalysisAction/PairCorrelationToPointAction.cpp
molecuilder/src/Actions/AnalysisAction/PairCorrelationToSurfaceAction.cpp
molecuilder/src/Makefile.am

Location:
src/Actions/AtomAction
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/AtomAction/AddAction.cpp

    rf8e486 re6317b  
    99
    1010#include "Actions/AtomAction/AddAction.hpp"
    11 #include "CommandLineParser.hpp"
    1211#include "atom.hpp"
    1312#include "element.hpp"
    1413#include "log.hpp"
    15 #include "periodentafel.hpp"
     14#include "molecule.hpp"
    1615#include "vector.hpp"
    1716#include "verbose.hpp"
     
    3837Action::state_ptr AtomAddAction::performCall() {
    3938  Dialog *dialog = UIFactory::getInstance().makeDialog();
    40   int Z = -1;
     39  std::vector<element *> elements;
    4140  Vector position;
    4241
    43   dialog->queryInt(NAME, &Z, MapOfActions::getInstance().getDescription(NAME));
     42  dialog->queryElement(NAME, &elements, MapOfActions::getInstance().getDescription(NAME));
    4443  dialog->queryVector("position", &position, World::getInstance().getDomain(), true, MapOfActions::getInstance().getDescription("position"));
     44  cout << "pre-dialog" << endl;
    4545
    4646  if(dialog->display()) {
     47    cout << "post-dialog" << endl;
    4748    delete dialog;
    48     atom * first = World::getInstance().createAtom();
    49     first->type = World::getInstance().getPeriode()->FindElement(Z);
    50     first->x = position;
    51     if (first->type != NULL) {
     49    if (elements.size() == 1) {
     50      atom * first = World::getInstance().createAtom();
     51      first->type = *(elements.begin());
     52      first->x = position;
    5253      DoLog(1) && (Log() << Verbose(1) << "Adding new atom with element " << first->type->name << " at " << (first->x) << "." << endl);
     54      // TODO: remove when all of World's atoms are stored.
     55      std::vector<molecule *> molecules = World::getInstance().getAllMolecules();
     56      if (!molecules.empty()) {
     57        std::vector<molecule *>::iterator iter = molecules.begin();
     58        (*iter)->AddAtom(first);
     59      }
    5360      return Action::success;
    5461    } else {
    5562      DoeLog(1) && (eLog()<< Verbose(1) << "Could not find the specified element." << endl);
    56       World::getInstance().destroyAtom(first);
    5763      return Action::failure;
    5864    }
  • src/Actions/AtomAction/ChangeElementAction.cpp

    rf8e486 re6317b  
    99
    1010#include "Actions/AtomAction/ChangeElementAction.hpp"
    11 #include "CommandLineParser.hpp"
    1211#include "atom.hpp"
    1312#include "log.hpp"
     
    3635Action::state_ptr AtomChangeElementAction::performCall() {
    3736  Dialog *dialog = UIFactory::getInstance().makeDialog();
    38   int Z = -1;
    3937  atom *first = NULL;
    40   element *elemental = NULL;
     38  std::vector<element *> elements;
    4139
    42   dialog->queryElement(NAME, (const element **) &elemental, MapOfActions::getInstance().getDescription(NAME));
    43   dialog->queryAtom("atom-by-id", &first, MapOfActions::getInstance().getDescription("atom-by-id"));
     40  dialog->queryAtom(NAME, &first, MapOfActions::getInstance().getDescription(NAME));
     41  dialog->queryElement("element", &elements, MapOfActions::getInstance().getDescription("element"));
    4442
    4543  if(dialog->display()) {
    4644    delete dialog;
    47     DoLog(1) && (Log() << Verbose(1) << "Changing atom " << *first << " to element " << elemental << "." << endl);
    48     if (elemental != NULL) {
    49       first->type = elemental;
     45    ASSERT(elements.size() == 1, "Unequal to one element specified when changing an atom's element");
     46    ASSERT(first != NULL, "No valid atom specified");
     47    DoLog(1) && (Log() << Verbose(1) << "Changing atom " << *first << " to element " << elements.at(0) << "." << endl);
     48    if (elements.at(0) != NULL) {
     49      first->type = elements.at(0);
    5050      return Action::success;
    5151    } else
  • src/Actions/AtomAction/RemoveAction.cpp

    rf8e486 re6317b  
    99
    1010#include "Actions/AtomAction/RemoveAction.hpp"
    11 #include "CommandLineParser.hpp"
    1211#include "atom.hpp"
    1312#include "Descriptors/AtomDescriptor.hpp"
    1413#include "log.hpp"
     14#include "molecule.hpp"
    1515#include "verbose.hpp"
    1616#include "World.hpp"
     
    4343    delete dialog;
    4444    DoLog(1) && (Log() << Verbose(1) << "Removing atom " << first->getId() << "." << endl);
     45    // TODO: this is not necessary when atoms and their storing to file are handled by the World
     46    // simply try to erase in every molecule found
     47    std::vector<molecule *> molecules = World::getInstance().getAllMolecules();
     48    for (std::vector<molecule *>::iterator iter = molecules.begin();iter != molecules.end(); ++iter) {
     49      (*iter)->erase(first);
     50    }
    4551    World::getInstance().destroyAtom(first);
    4652    return Action::success;
Note: See TracChangeset for help on using the changeset viewer.