Ignore:
Timestamp:
Feb 14, 2016, 12:34:28 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:
62a0ee
Parents:
e7ed12
git-author:
Frederik Heber <heber@…> (01/06/16 17:34:22)
git-committer:
Frederik Heber <heber@…> (02/14/16 12:34:28)
Message:

QtObservedInstanceBoard now sends QtObserved..::ptr around in signals.

  • this should get rid of the problem that we need to keep the QtObservedAtom until it was requested at least once. And we don't know for how long. Now, we simply place the shared_ptr into the signal (to which it seems to be copied) and hence a representation of the atoms remains valid.
  • cstor of GLMoleculeObject_.. take Observed.. as ref.
Location:
src/UIElements/Views/Qt4/MoleculeList
Files:
2 edited

Legend:

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

    re7ed12 r1b07b1  
    8282  connect(this,SIGNAL(itemChanged(QStandardItem*)),this,SLOT(moleculeNameChanged(QStandardItem*)));
    8383  connect(this, SIGNAL(itemChanged(QStandardItem*)), this, SLOT(checkForVisibilityChange(QStandardItem*)));
    84   connect(board, SIGNAL(moleculeInserted(const moleculeId_t)), this, SLOT(moleculeInserted(const moleculeId_t)));
     84  connect(board, SIGNAL(moleculeInserted(QtObservedMolecule::ptr)), this, SLOT(moleculeInserted(QtObservedMolecule::ptr)));
    8585  connect(board, SIGNAL(moleculeRemoved(const moleculeId_t)), this, SLOT(moleculeRemoved(const moleculeId_t)));
    8686  connect(board, SIGNAL(moleculeIndexChanged(const moleculeId_t,const moleculeId_t)),
     
    102102}
    103103
    104 void QtMoleculeList::moleculeInserted(const moleculeId_t _id)
     104void QtMoleculeList::moleculeInserted(QtObservedMolecule::ptr _mol)
    105105{
    106106  // get ObservedMolecule from board
    107107  boost::recursive_mutex::scoped_lock lock(listAccessing_mutex);
    108   newMolecules.push_back( _id );
     108  newMolecules.push_back( _mol );
    109109}
    110110
     
    678678  list_of_group_items_t visibilityGroupItems_copy = visibilityGroupItems;
    679679  visibilityGroupItems.clear();
    680   std::vector<moleculeId_t> newMolecules_copy = newMolecules;
     680  std::vector<QtObservedMolecule::ptr> newMolecules_copy = newMolecules;
    681681  newMolecules.clear();
    682682  std::vector<moleculeId_t> removedMolecules_copy = removedMolecules;
     
    784784
    785785  /// 4. instantiate all new items
    786   for (std::vector<moleculeId_t>::iterator moliter = newMolecules_copy.begin();
     786  for (std::vector<QtObservedMolecule::ptr>::iterator moliter = newMolecules_copy.begin();
    787787      moliter != newMolecules_copy.end(); ++moliter) {
    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     }
     788//   LOG(1, "Adding molecule " << ObservedMolecule->getMoleculeName());
     789    // check that World knows the molecule still
     790    const std::string formula = addMolecule(*moliter);
     791//      LOG(1, "Adding " << formula << " to toBeSetOccurrence.");
     792    toBeSetOccurrence.insert( formula );
    796793  }
    797794
  • src/UIElements/Views/Qt4/MoleculeList/QtMoleculeList.hpp

    re7ed12 r1b07b1  
    6565
    6666private slots:
    67   void moleculeInserted(const moleculeId_t _id);
     67  void moleculeInserted(QtObservedMolecule::ptr _mol);
    6868  void moleculeRemoved(const moleculeId_t _id);
    6969  void moleculeIndexChanged(const moleculeId_t _oldid, const moleculeId_t _newid);
     
    155155  list_of_group_items_t visibilityGroupItems;
    156156  //!> list of new molecules which need to be added
    157   std::vector<moleculeId_t> newMolecules;
     157  std::vector<QtObservedMolecule::ptr> 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.