Ignore:
Timestamp:
Jul 24, 2015, 4:44:35 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:
084304
Parents:
f3b597
git-author:
Frederik Heber <heber@…> (06/02/15 11:23:35)
git-committer:
Frederik Heber <heber@…> (07/24/15 16:44:35)
Message:

FIX: QtInfoBox now works mostly on ids.

  • slots are requested as ..Id_t and not as ptrs anymore for some time.
Location:
src/UIElements/Views/Qt4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/Views/Qt4/QtInfoBox.cpp

    rf3b597 re7341e  
    4040#include "CodePatterns/MemDebug.hpp"
    4141
     42#include "Descriptors/AtomIdDescriptor.hpp"
     43#include "Descriptors/MoleculeIdDescriptor.hpp"
     44
    4245#include "molecule.hpp"
    4346#include "Element/element.hpp"
     47#include "World.hpp"
    4448
    4549using namespace std;
     
    4953QtInfoBox::QtInfoBox() :
    5054    QTabWidget(),
    51     curAtom(NULL), nextAtom(NULL),
    52     curMolecule(NULL), nextMolecule(NULL),
     55    curAtomId(-1), nextAtomId(-1),
     56    curMoleculeId(-1), nextMoleculeId(-1),
    5357    page_mol(NULL), page_atom(NULL)
    5458{
     
    6872}
    6973
    70 void QtInfoBox::atomHover(const atom &_atom)
    71 {
    72   nextAtom = &_atom;
     74void QtInfoBox::atomHover(const atomId_t _id)
     75{
     76  nextAtomId = _id;
    7377  timer->start(500);
    7478}
    7579
    76 void QtInfoBox::moleculeHover(const molecule &_mol)
    77 {
    78   nextMolecule = &_mol;
     80void QtInfoBox::moleculeHover(const moleculeId_t _id)
     81{
     82  nextMoleculeId = _id;
    7983  timer->start(500);
    8084}
     
    8286void QtInfoBox::timerTimeout()
    8387{
    84   if (nextAtom)
    85     showAtom(nextAtom);
    86   if (nextMolecule)
    87     showMolecule(nextMolecule);
     88  if (nextAtomId != (atomId_t)-1)
     89    showAtom(nextAtomId);
     90  if (nextMoleculeId != (moleculeId_t)-1)
     91    showMolecule(nextMoleculeId);
    8892}
    8993
     
    102106}
    103107
    104 void QtInfoBox::showAtom(const atom *_atom)
     108void QtInfoBox::showAtom(const atomId_t _id)
    105109{
    106110  currentPage = currentIndex();
     
    109113  clearTabs();
    110114
    111   curAtom = _atom;
    112   nextAtom = NULL;
    113   nextMolecule = NULL;
     115  const atom *curAtom = const_cast<const World &>(World::getInstance()).
     116      getAtom(AtomById(_id));
     117  curAtomId = curAtom->getId();
     118  nextAtomId = -1;
     119  nextMoleculeId = -1;
    114120
    115121  // Show new tabs.
     
    130136}
    131137
    132 void QtInfoBox::showMolecule(const molecule *_mol)
     138void QtInfoBox::showMolecule(const moleculeId_t _id)
    133139{
    134140  currentPage = currentIndex();
     
    137143  clearTabs();
    138144
    139   curMolecule = _mol;
    140   nextAtom = NULL;
    141   nextMolecule = NULL;
     145  const molecule *curMolecule = const_cast<const World &>(World::getInstance()).
     146      getMolecule(MoleculeById(_id));
     147  nextAtomId = -1;
     148  nextMoleculeId = -1;
    142149
    143150  // Show new tabs.
  • src/UIElements/Views/Qt4/QtInfoBox.hpp

    rf3b597 re7341e  
    1919#include <QtGui/QTreeWidget>
    2020#include <QTimer>
     21
    2122#include "CodePatterns/Observer/Observer.hpp"
     23
     24#include "types.hpp"
    2225
    2326class molecule;
     
    3538  virtual ~QtInfoBox();
    3639
    37   void showAtom(const atom *_atom);
    38   void showMolecule(const molecule *_mol);
     40  void showAtom(const atomId_t _id);
     41  void showMolecule(const moleculeId_t _id);
    3942
    4043public slots:
    41   void atomHover(const atom &_atom);
    42   void moleculeHover(const molecule &_mol);
     44  void atomHover(const atomId_t _id);
     45  void moleculeHover(const moleculeId_t _id);
    4346  void timerTimeout();
    4447
     
    4649
    4750private:
    48   const atom *curAtom;
    49   const atom *nextAtom;
    50   const molecule *curMolecule;
    51   const molecule *nextMolecule;
     51  atomId_t curAtomId;
     52  atomId_t nextAtomId;
     53  moleculeId_t curMoleculeId;
     54  moleculeId_t nextMoleculeId;
    5255  QtMoleculeInfoPage *page_mol;
    5356  QtAtomInfoPage *page_atom;
Note: See TracChangeset for help on using the changeset viewer.