Changeset 27e464 for src/molecule.cpp


Ignore:
Timestamp:
Jan 29, 2015, 7:38:10 AM (10 years ago)
Author:
Frederik Heber <heber@…>
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:
7912e9, eea0bb
Parents:
0ac85c3 (diff), 2050b2 (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:

Merge branch 'Refactoring_QtMoleculeList_as_QModel' into Candidate_v1.4.10

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/molecule.cpp

    r0ac85c3 r27e464  
    3535#include "CodePatterns/MemDebug.hpp"
    3636
    37 #include <cstring>
     37#include <algorithm>
    3838#include <boost/bind.hpp>
    3939#include <boost/foreach.hpp>
     40#include <cstring>
    4041
    4142#include <gsl/gsl_inline.h>
     
    102103molecule::~molecule()
    103104{
     105  // inform all UI elements about imminent removal before anything is lost
     106  {
     107    OBSERVE;
     108    NOTIFY(AboutToBeRemoved);
     109  }
    104110  CleanupMolecule();
    105111};
     
    648654void removeAtomsinMolecule(molecule *&_mol)
    649655{
     656  // copy list of atoms from molecule as it will be changed
     657  std::vector<atom *> atoms;
     658  atoms.resize(_mol->getAtomCount(), NULL);
     659  std::copy(_mol->begin(), _mol->end(), atoms.begin());
    650660  // remove each atom from world
    651   for(molecule::iterator AtomRunner = _mol->begin(); !_mol->empty(); AtomRunner = _mol->begin())
     661  for(std::vector<atom *>::iterator AtomRunner = atoms.begin();
     662      AtomRunner != atoms.end(); ++AtomRunner)
    652663    World::getInstance().destroyAtom(*AtomRunner);
    653664  // make sure that pointer os not usable
     
    934945    output << "Map is ";
    935946    for (molecule::const_iterator iter = begin(); iter != end(); ++iter) {
    936       if ((*iter)->father == NULL) {
     947      if ((*iter)->getFather() == NULL) {
    937948        AtomicMap[(*iter)->getNr()] = -2;
    938949      } else {
     
    940951      //for (int i=0;i<AtomCount;i++) { // search atom
    941952        //for (int j=0;j<OtherMolecule->getAtomCount();j++) {
    942           //LOG(4, "Comparing father " << (*iter)->father << " with the other one " << (*runner)->father << ".");
    943           if ((*iter)->father == (*runner))
     953          //LOG(4, "Comparing father " << (*iter)->getFather() << " with the other one " << (*runner)->getFather() << ".");
     954          if ((*iter)->getFather() == (*runner))
    944955            AtomicMap[(*iter)->getNr()] = (*runner)->getNr();
    945956        }
Note: See TracChangeset for help on using the changeset viewer.