Ignore:
Timestamp:
Aug 5, 2015, 5:32:11 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:
25a81d
Parents:
07b800
git-author:
Frederik Heber <heber@…> (07/19/15 13:25:40)
git-committer:
Frederik Heber <heber@…> (08/05/15 17:32:11)
Message:

GLMoleculeObject_molecule also has ObservedValue for name.

  • this removes any (uncached) molecule::getName() from Qt code part.
Location:
src/UIElements/Views/Qt4/Qt3D
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_molecule.cpp

    r07b800 r5b61e5  
    8787const Observable::channels_t GLMoleculeObject_molecule::BoundingBoxChannels(getAllAtomicChangesChannels());
    8888const Observable::channels_t GLMoleculeObject_molecule::IndexChannels(1, molecule::IndexChanged);
     89const Observable::channels_t GLMoleculeObject_molecule::NameChannels(1, molecule::MoleculeNameChanged);
    8990
    9091static QGLSceneNode *createMoleculeMesh(const QGeometryData &_geo)
     
    108109  MolIndexUpdater(
    109110      boost::bind(&GLMoleculeObject_molecule::updateIndex, this)
     111      ),
     112  MolNameUpdater(
     113      boost::bind(&GLMoleculeObject_molecule::updateName, this)
    110114      ),
    111115  TesselationHullUpdater(
     
    124128      _molid,
    125129      IndexChannels),
     130  MolName(
     131      molref,
     132      MolNameUpdater,
     133      "MoleculeName_"+toString(_molid),
     134      updateName(),
     135      NameChannels),
    126136  TesselationHull(
    127137      molref,
     
    177187      boost::bind(&GLMoleculeObject_molecule::updateIndex, this)
    178188      ),
     189  MolNameUpdater(
     190      boost::bind(&GLMoleculeObject_molecule::updateName, this)
     191      ),
    179192  TesselationHullUpdater(
    180193      boost::bind(&GLMoleculeObject_molecule::updateTesselationHull, this)
     
    192205      _molid,
    193206      IndexChannels),
     207  MolName(
     208      molref,
     209      MolNameUpdater,
     210      "MoleculeName_"+toString(_molid),
     211      updateName(),
     212      NameChannels),
    194213  TesselationHull(
    195214      molref,
     
    332351    // Tesselate the points.
    333352    Tesselation T;
    334     PointCloudAdaptor<molecule> cloud(const_cast<molecule *>(molref), molref->getName());
     353    PointCloudAdaptor<molecule> cloud(const_cast<molecule *>(molref), MolName.get());
    335354    T(cloud, minradius);
    336355
     
    411430}
    412431
     432std::string GLMoleculeObject_molecule::updateName() const
     433{
     434  const molecule * const mol = getMolecule(MolIndex.get());
     435  return mol->getName();
     436}
     437
    413438void GLMoleculeObject_molecule::resetTesselationHull()
    414439{
     
    458483
    459484  emit indexChanged(this, oldId, newId);
     485}
     486
     487void GLMoleculeObject_molecule::resetName()
     488{
    460489}
    461490
  • src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_molecule.hpp

    r07b800 r5b61e5  
    8989  void resetAtoms();
    9090  void resetIndex();
     91  void resetName();
    9192
    9293  void AtomSelected(const atomId_t _id);
     
    128129  atoms_t updateAtoms();
    129130  moleculeId_t updateIndex() const;
     131  std::string updateName() const;
    130132
    131133  //!> the Observable we are signed on, also indicates whether we are sign on (not NULL)
     
    143145  //!> list of channels when the index needs to update
    144146  static const Observable::channels_t IndexChannels;
     147  //!> list of channels when the name needs to update
     148  static const Observable::channels_t NameChannels;
    145149
    146150  boost::function<moleculeId_t ()> MolIndexUpdater;
     151  boost::function<std::string ()> MolNameUpdater;
    147152  boost::function<QGeometryData ()> TesselationHullUpdater;
    148153  boost::function<BoundingBoxInfo ()> BoundingBoxUpdater;
     
    151156  //!> contains the current molecule index
    152157  ObservedValue<moleculeId_t> MolIndex;
     158  //!> contains the current molecule name
     159  ObservedValue<std::string> MolName;
    153160  //!> contains current version of the tesselation hull on request
    154161  Cacheable<QGeometryData> TesselationHull;
Note: See TracChangeset for help on using the changeset viewer.