Changeset 174f8b
- Timestamp:
- Oct 17, 2013, 7:24:25 AM (11 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:
- 958312
- Parents:
- 16893f
- git-author:
- Frederik Heber <heber@…> (09/28/13 09:20:46)
- git-committer:
- Frederik Heber <heber@…> (10/17/13 07:24:25)
- Location:
- src/UIElements/Views/Qt4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Views/Qt4/QtFragmentList.cpp
r16893f r174f8b 41 41 42 42 #include "CodePatterns/MemDebug.hpp" 43 44 #include "CodePatterns/Log.hpp" 43 45 44 46 #include "Descriptors/AtomIdDescriptor.hpp" … … 53 55 54 56 const int QtFragmentList::COLUMNCOUNT = COLUMNTYPES_MAX; 55 const char *QtFragmentList::COLUMNNAMES[QtFragmentList::COLUMNCOUNT]={"Number","KeySet","Formula","Energy "};57 const char *QtFragmentList::COLUMNNAMES[QtFragmentList::COLUMNCOUNT]={"Number","KeySet","Formula","Energy value","Energy contribution"}; 56 58 57 59 QtFragmentList::QtFragmentList(QWidget * _parent) : … … 65 67 setHeaderLabels(header); 66 68 67 setSelectionMode( SingleSelection );69 setSelectionMode( MultiSelection ); 68 70 69 71 dirty = true; … … 95 97 clear(); 96 98 clearing = false; 97 //emit changed();doesn't work!?!99 emit changed(); // doesn't work!?! 98 100 } 99 101 … … 112 114 const IndexSetContainer keysets(fragments.getKeySets()); 113 115 const FragmentationResultContainer::shortrangedata_t &shortrange = fragments.getShortRangeResults(); 116 const FragmentationShortRangeResults::summedshortrange_t &summedshortrange = fragments.getShortRangeSummedResults(); 114 117 IndexSetContainer::Container_t::const_iterator keyiter = keysets.getContainer().begin(); 115 118 FragmentationResultContainer::shortrangedata_t::const_iterator resultiter = shortrange.begin(); … … 131 134 ++indexiter) { 132 135 const atom *_atom = World::getInstance().getAtom(AtomById(*indexiter)); 133 formula.addElements(_atom->getElementNo(), 1); 136 if (_atom != NULL) 137 formula.addElements(_atom->getElementNo(), 1); 138 else 139 ELOG(2, "QtFragmentList::refill() - Could not find id " << *indexiter << " for formula."); 134 140 } 135 141 output << formula.toString(); 136 142 treeItem->setText(FORMULA, QString(output.str().c_str())); 137 143 } 138 { 139 std::stringstream output; 140 output << resultiter->second.energies.total; 141 treeItem->setText(ENERGY, QString(output.str().c_str())); 144 if (summedshortrange.empty()) { 145 { 146 std::stringstream output; 147 output << resultiter->second.energies.total; 148 treeItem->setText(ENERGYVALUE, QString(output.str().c_str())); 149 } 150 { 151 std::stringstream output; 152 output << ""; 153 treeItem->setText(ENERGYCONTRIBUTION, QString(output.str().c_str())); 154 } 155 } else { 156 FragmentationShortRangeResults::summedshortrange_t::const_iterator sumresiter = 157 summedshortrange.find(*keyiter); 158 ASSERT( sumresiter != summedshortrange.end(), 159 "QtFragmentList::refill() - "+toString(*keyiter)+" not present in summed results."); 160 { 161 std::stringstream output; 162 output << sumresiter->second.first.energies.total; 163 treeItem->setText(ENERGYVALUE, QString(output.str().c_str())); 164 } 165 { 166 std::stringstream output; 167 output << sumresiter->second.second.energies.total; 168 treeItem->setText(ENERGYCONTRIBUTION, QString(output.str().c_str())); 169 } 142 170 } 143 171 FragmentSelection.push_back(treeItem->isSelected()); … … 167 195 { 168 196 //std::cout << "rowSelected\n"; 197 // unselect 198 for (int i=0;i<topLevelItemCount();++i) { 199 QTreeWidgetItem *item = topLevelItem(i); 200 bool newSelection = item->isSelected(); 201 if (newSelection != FragmentSelection[i]){ 202 // get the keyset and select the specific atoms 203 if (!newSelection) 204 for (IndexSet::const_iterator iter = indexsets[i].begin(); 205 iter != indexsets[i].end(); 206 ++iter) 207 World::getInstance().unselectAtom(*iter); 208 } 209 } 210 // select all 169 211 for (int i=0;i<topLevelItemCount();++i) { 170 212 QTreeWidgetItem *item = topLevelItem(i); … … 173 215 FragmentSelection[i] = newSelection; 174 216 // get the keyset and select the specific atoms 175 for (IndexSet::const_iterator iter = indexsets[i].begin();176 iter != indexsets[i].end();177 ++iter)178 if (newSelection)217 if (newSelection) 218 for (IndexSet::const_iterator iter = indexsets[i].begin(); 219 iter != indexsets[i].end(); 220 ++iter) 179 221 World::getInstance().selectAtom(*iter); 180 else181 World::getInstance().unselectAtom(*iter);182 222 } 183 223 } -
src/UIElements/Views/Qt4/QtFragmentList.hpp
r16893f r174f8b 37 37 38 38 static const int COLUMNCOUNT; 39 enum {NUMBER,KEYSET,FORMULA,ENERGY ,COLUMNTYPES_MAX} COLUMNTYPES;39 enum {NUMBER,KEYSET,FORMULA,ENERGYVALUE,ENERGYCONTRIBUTION,COLUMNTYPES_MAX} COLUMNTYPES; 40 40 static const char *COLUMNNAMES[]; 41 41
Note:
See TracChangeset
for help on using the changeset viewer.