Changeset e7341e for src/UIElements/Views
- Timestamp:
- Jul 24, 2015, 4:44:35 PM (9 years ago)
- 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)
- Location:
- src/UIElements/Views/Qt4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Views/Qt4/QtInfoBox.cpp
rf3b597 re7341e 40 40 #include "CodePatterns/MemDebug.hpp" 41 41 42 #include "Descriptors/AtomIdDescriptor.hpp" 43 #include "Descriptors/MoleculeIdDescriptor.hpp" 44 42 45 #include "molecule.hpp" 43 46 #include "Element/element.hpp" 47 #include "World.hpp" 44 48 45 49 using namespace std; … … 49 53 QtInfoBox::QtInfoBox() : 50 54 QTabWidget(), 51 curAtom (NULL), nextAtom(NULL),52 curMolecule (NULL), nextMolecule(NULL),55 curAtomId(-1), nextAtomId(-1), 56 curMoleculeId(-1), nextMoleculeId(-1), 53 57 page_mol(NULL), page_atom(NULL) 54 58 { … … 68 72 } 69 73 70 void QtInfoBox::atomHover(const atom &_atom)71 { 72 nextAtom = &_atom;74 void QtInfoBox::atomHover(const atomId_t _id) 75 { 76 nextAtomId = _id; 73 77 timer->start(500); 74 78 } 75 79 76 void QtInfoBox::moleculeHover(const molecule &_mol)77 { 78 nextMolecule = &_mol;80 void QtInfoBox::moleculeHover(const moleculeId_t _id) 81 { 82 nextMoleculeId = _id; 79 83 timer->start(500); 80 84 } … … 82 86 void QtInfoBox::timerTimeout() 83 87 { 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); 88 92 } 89 93 … … 102 106 } 103 107 104 void QtInfoBox::showAtom(const atom *_atom)108 void QtInfoBox::showAtom(const atomId_t _id) 105 109 { 106 110 currentPage = currentIndex(); … … 109 113 clearTabs(); 110 114 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; 114 120 115 121 // Show new tabs. … … 130 136 } 131 137 132 void QtInfoBox::showMolecule(const molecule *_mol)138 void QtInfoBox::showMolecule(const moleculeId_t _id) 133 139 { 134 140 currentPage = currentIndex(); … … 137 143 clearTabs(); 138 144 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; 142 149 143 150 // Show new tabs. -
src/UIElements/Views/Qt4/QtInfoBox.hpp
rf3b597 re7341e 19 19 #include <QtGui/QTreeWidget> 20 20 #include <QTimer> 21 21 22 #include "CodePatterns/Observer/Observer.hpp" 23 24 #include "types.hpp" 22 25 23 26 class molecule; … … 35 38 virtual ~QtInfoBox(); 36 39 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); 39 42 40 43 public 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); 43 46 void timerTimeout(); 44 47 … … 46 49 47 50 private: 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; 52 55 QtMoleculeInfoPage *page_mol; 53 56 QtAtomInfoPage *page_atom;
Note:
See TracChangeset
for help on using the changeset viewer.