Ignore:
Timestamp:
Apr 20, 2016, 11:06:55 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:
785d89
Parents:
e4b13a
git-author:
Frederik Heber <heber@…> (04/06/16 17:04:01)
git-committer:
Frederik Heber <heber@…> (04/20/16 23:06:55)
Message:

QtObservedBond now simply gets both QtObservedAtoms on construction.

  • they must exist as QtObservedInstanceBoard is in the current update() loop.
  • and we don't need to take care of them and may throw them away when the bonf itself is removed. We don't need to care for anything else.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/Qt4/InstanceBoard/QtObservedBond.hpp

    re4b13a r4112691  
    2828#include "UIElements/Qt4/InstanceBoard/ObservedValue_types.hpp"
    2929#include "UIElements/Qt4/InstanceBoard/ObservedValuesContainer.hpp"
     30#include "UIElements/Qt4/InstanceBoard/QtObservedAtom.hpp"
    3031#include "types.hpp"
    3132
     
    7172   * \param _id id of observed bond
    7273   * \param _bond ref to observed bond
     74   * \param _leftatom bond's observed left atom for position, element, ...
     75   * \param _rightatom bond's observed right atom for position, element, ...
    7376   * \param _board ref to InstanceBoard for callbacks on occasion of subjectKilled()
    7477   * \param _parent Qt parent to automatically destroy when parent is destroyed
     
    7780      const bondId_t _id,
    7881      const bond::ptr _bond,
     82      const QtObservedAtom::ptr &_leftatom,
     83      const QtObservedAtom::ptr &_rightatom,
    7984      QtObservedInstanceBoard &_board,
    8085      QWidget * _parent=0);
     
    176181  void bondRemoved();
    177182
    178 //private slots:
     183private slots:
     184
     185  void leftAtomIndexChanges(atomId_t, atomId_t);
     186  void rightAtomIndexChanges(atomId_t, atomId_t);
     187  void moleculeIndexChanges(moleculeId_t, moleculeId_t);
    179188
    180189private:
     
    187196private:
    188197  static int updateDegree(const bond &_bond);
    189   static atomId_t updateLeftAtomIndex(const atom &_atomref);
    190   static atomicNumber_t updateLeftAtomElement(const atom &_atomref);
    191   static Vector updateLeftAtomPosition(const atom &_atomref);
    192   static atomId_t updateRightAtomIndex(const atom &_atomref);
    193   static atomicNumber_t updateRightAtomElement(const atom &_atomref);
    194   static Vector updateRightAtomPosition(const atom &_atomref);
    195   static moleculeId_t updateMoleculeIndex(const molecule &_molref);
    196198
    197199  //!> enumeration of observed values to match with entries in ObservedValues
     
    199201    //!> contains the current bond degree
    200202    BondDegree,
    201     //!> contains the index of the left atom
    202     leftAtomIndex,
    203     //!> contains the position of the left atom
    204     leftAtomPosition,
    205     //!> contains the element of the left atom
    206     leftAtomElement,
    207     //!> contains the index of the right atom
    208     rightAtomIndex,
    209     //!> contains the position of the right atom
    210     rightAtomPosition,
    211     //!> contains the element of the right atom
    212     rightAtomElement,
    213     //!> contains the id of the molecule this bond is associated with
    214     moleculeIndex,
    215203    //!> gives the size of the enumeration
    216204    MAX_ObservedTypes
     
    223211   * \param _bondref reference to bond
    224212   * \param _bondsubjectKilled ref to function to call on subjectKilled() from bond
    225    * \param _leftatomsubjectKilled ref to function to call on subjectKilled() from leftatom
    226    * \param _rightatomsubjectKilled ref to function to call on subjectKilled() from rightatom
    227    * \param _moleculesubjectKilled ref to function to call on subjectKilled() from molecule
    228213   */
    229214  void initObservedValues(
     
    231216      const bondId_t _id,
    232217      const bond::ptr _bondref,
    233       const boost::function<void()> &_bondsubjectKilled,
    234       const boost::function<void()> &_leftatomsubjectKilled,
    235       const boost::function<void()> &_rightatomsubjectKilled,
    236       const boost::function<void()> &_moleculesubjectKilled);
     218      const boost::function<void()> &_bondsubjectKilled);
    237219
    238220  /** Destroys all \a ObservedValues entries.
     
    278260  //!> the Observable we are signed on, also indicates whether we are sign on (not NULL)
    279261  const Observable *bondowner;
    280   const Observable *leftatomowner;
    281   const Observable *rightatomowner;
    282   const Observable *moleculeowner;
    283262
    284263private:
     
    310289  bondId_t oldbondId;
    311290
    312   //!> contains still the old id after the index of the left atom changed
     291  //!> observed left atom of bond for position, element, ...
     292  const QtObservedAtom::ptr leftatom;
     293
     294  //!> observed right atom of bond for position, element, ...
     295  const QtObservedAtom::ptr rightatom;
     296
     297  //!> contains still the old leftatom id after the index of the bond changed
    313298  atomId_t oldleftatomId;
    314299
    315   //!> contains still the old id after the index of the right atom changed
     300  //!> contains still the old rightatom id after the index of the bond changed
    316301  atomId_t oldrightatomId;
    317302
    318   //!> contains still the old id after the index of the molecule changed
     303  //!> contains still the old molecule id after the index of the bond changed
    319304  moleculeId_t oldmoleculeId;
    320305
Note: See TracChangeset for help on using the changeset viewer.