Changeset aa41a3 for src/UIElements


Ignore:
Timestamp:
Feb 14, 2016, 12:34:27 PM (9 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:
3fe318
Parents:
6bce88
git-author:
Frederik Heber <heber@…> (01/05/16 22:19:00)
git-committer:
Frederik Heber <heber@…> (02/14/16 12:34:27)
Message:

QtMoleculeList must not use QtObservedMolecules in lists but only request them on need.

Location:
src/UIElements/Views/Qt4/MoleculeList
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/Views/Qt4/MoleculeList/QtMoleculeList.cpp

    r6bce88 raa41a3  
    105105{
    106106  // get ObservedMolecule from board
    107   QtObservedMolecule::ptr ObservedMolecule = board->getObservedMolecule(_id);
    108107  boost::recursive_mutex::scoped_lock lock(listAccessing_mutex);
    109   newMolecules.push_back( ObservedMolecule );
     108  newMolecules.push_back( _id );
    110109}
    111110
     
    679678  list_of_group_items_t visibilityGroupItems_copy = visibilityGroupItems;
    680679  visibilityGroupItems.clear();
    681   std::vector<QtObservedMolecule::ptr> newMolecules_copy = newMolecules;
     680  std::vector<moleculeId_t> newMolecules_copy = newMolecules;
    682681  newMolecules.clear();
    683682  std::vector<moleculeId_t> removedMolecules_copy = removedMolecules;
     
    785784
    786785  /// 4. instantiate all new items
    787   for (std::vector<QtObservedMolecule::ptr>::iterator moliter = newMolecules_copy.begin();
     786  for (std::vector<moleculeId_t>::iterator moliter = newMolecules_copy.begin();
    788787      moliter != newMolecules_copy.end(); ++moliter) {
    789 //    LOG(1, "Adding molecule " << *moliter);
    790   // check that World knows the molecule still
    791     const std::string formula = addMolecule(*moliter);
    792 //      LOG(1, "Adding " << formula << " to toBeSetOccurrence.");
    793     toBeSetOccurrence.insert( formula );
     788    QtObservedMolecule::ptr ObservedMolecule = board->getObservedMolecule(*moliter);
     789    if (ObservedMolecule) {
     790//     LOG(1, "Adding molecule " << ObservedMolecule->getMoleculeName());
     791      // check that World knows the molecule still
     792      const std::string formula = addMolecule(ObservedMolecule);
     793//        LOG(1, "Adding " << formula << " to toBeSetOccurrence.");
     794      toBeSetOccurrence.insert( formula );
     795    }
    794796  }
    795797
  • src/UIElements/Views/Qt4/MoleculeList/QtMoleculeList.hpp

    r6bce88 raa41a3  
    155155  list_of_group_items_t visibilityGroupItems;
    156156  //!> list of new molecules which need to be added
    157   std::vector<QtObservedMolecule::ptr> newMolecules;
     157  std::vector<moleculeId_t> newMolecules;
    158158  //!> list of molecules that have been removed
    159159  std::vector<moleculeId_t> removedMolecules;
Note: See TracChangeset for help on using the changeset viewer.