Changeset 5aec20 for src/UIElements
- Timestamp:
- Feb 14, 2016, 12:34:27 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:
- 387a84
- Parents:
- 4cac6c
- git-author:
- Frederik Heber <heber@…> (01/05/16 22:24:10)
- git-committer:
- Frederik Heber <heber@…> (02/14/16 12:34:27)
- Location:
- src/UIElements
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Qt4/QtMainWindow.cpp
r4cac6c r5aec20 109 109 moleculeListView->setModel(moleculeList); 110 110 111 elementList = new QtElementList( worldTab);111 elementList = new QtElementList(InstanceBoard, worldTab); 112 112 homologyList = new QtHomologyList(worldTab); 113 113 fragmentList = new QtFragmentList(worldTab); -
src/UIElements/Views/Qt4/QtElementList.cpp
r4cac6c r5aec20 34 34 35 35 #include "Views/Qt4/QtElementList.hpp" 36 #include "UIElements/Qt4/InstanceBoard/QtObservedInstanceBoard.hpp" 36 37 37 38 #include <iostream> … … 54 55 const char *QtElementList::COLUMNNAMES[QtElementList::COLUMNCOUNT]={"Number","Name","Symbol","Mass","Occurrence"}; 55 56 56 QtElementList::QtElementList(Q Widget * _parent) :57 QtElementList::QtElementList(QtObservedInstanceBoard *_board, QWidget * _parent) : 57 58 QTreeWidget (_parent), 58 Observer("QtElementList") 59 Observer("QtElementList"), 60 board(_board) 59 61 { 60 62 setColumnCount(COLUMNCOUNT); … … 124 126 } 125 127 126 void QtElementList::updateElement(const atom&_atom)127 { 128 const atomicNumber_t newelement = _atom .getElementNo();128 void QtElementList::updateElement(const QtObservedAtom::ptr &_atom) 129 { 130 const atomicNumber_t newelement = _atom->getAtomElement(); 129 131 atomicNumber_t oldelement = -1; 132 const atomId_t atomid = _atom->getAtomIndex(); 130 133 QTreeWidgetItem *newtreeItem = topLevelItem(newelement-1); 131 134 ASSERT( newtreeItem != NULL, … … 143 146 // insertTopLevelItem(newelement-1, newtreeItem); 144 147 // } 145 AtomElementMap_t::iterator iter = AtomElementMap.find( _atom.getId());148 AtomElementMap_t::iterator iter = AtomElementMap.find(atomid); 146 149 if (iter == AtomElementMap.end()) { 147 AtomElementMap.insert( std::make_pair( _atom.getId(), -1));148 iter = AtomElementMap.find( _atom.getId());150 AtomElementMap.insert( std::make_pair(atomid, -1)); 151 iter = AtomElementMap.find(atomid); 149 152 } else 150 153 oldelement = iter->second; … … 183 186 refill_mutex.lock(); 184 187 185 const atom * const walker = const_cast<const World &>(World::getInstance()). 186 getAtom(AtomById(_atomid)); 187 if (walker != NULL) 188 updateElement(*walker); 188 const QtObservedAtom::ptr walker = board->getObservedAtom(_atomid); 189 if (walker) 190 updateElement(walker); 189 191 else { 190 192 AtomElementMap_t::iterator iter = AtomElementMap.find(_atomid); -
src/UIElements/Views/Qt4/QtElementList.hpp
r4cac6c r5aec20 23 23 #include "types.hpp" 24 24 25 class atom; 25 #include "UIElements/Qt4/InstanceBoard/QtObservedAtom.hpp" 26 27 class QtObservedInstanceBoard; 26 28 27 29 class QtElementList: public QTreeWidget, public Observer … … 30 32 31 33 public: 32 QtElementList(Q Widget * _parent=0);34 QtElementList(QtObservedInstanceBoard *_board, QWidget * _parent=0); 33 35 virtual ~QtElementList(); 34 36 … … 40 42 41 43 void setOccurrence(QTreeWidgetItem &_item, const int count); 42 void updateElement(const atom&_atom);44 void updateElement(const QtObservedAtom::ptr &_atom); 43 45 44 46 static const int COLUMNCOUNT; … … 59 61 bool dirty; 60 62 63 //!> ptr to instance board to obtain observed atoms 64 QtObservedInstanceBoard * const board; 65 61 66 QMutex refill_mutex; 62 67 };
Note:
See TracChangeset
for help on using the changeset viewer.