Changeset 5aec20 for src/UIElements


Ignore:
Timestamp:
Feb 14, 2016, 12:34:27 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:
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)
Message:

QtElementList must not use atom but only QtObservedAtom.

Location:
src/UIElements
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/Qt4/QtMainWindow.cpp

    r4cac6c r5aec20  
    109109  moleculeListView->setModel(moleculeList);
    110110
    111   elementList = new QtElementList(worldTab);
     111  elementList = new QtElementList(InstanceBoard, worldTab);
    112112  homologyList = new QtHomologyList(worldTab);
    113113  fragmentList = new QtFragmentList(worldTab);
  • src/UIElements/Views/Qt4/QtElementList.cpp

    r4cac6c r5aec20  
    3434
    3535#include "Views/Qt4/QtElementList.hpp"
     36#include "UIElements/Qt4/InstanceBoard/QtObservedInstanceBoard.hpp"
    3637
    3738#include <iostream>
     
    5455const char *QtElementList::COLUMNNAMES[QtElementList::COLUMNCOUNT]={"Number","Name","Symbol","Mass","Occurrence"};
    5556
    56 QtElementList::QtElementList(QWidget * _parent) :
     57QtElementList::QtElementList(QtObservedInstanceBoard *_board, QWidget * _parent) :
    5758    QTreeWidget (_parent),
    58     Observer("QtElementList")
     59    Observer("QtElementList"),
     60    board(_board)
    5961{
    6062  setColumnCount(COLUMNCOUNT);
     
    124126}
    125127
    126 void QtElementList::updateElement(const atom &_atom)
    127 {
    128   const atomicNumber_t newelement = _atom.getElementNo();
     128void QtElementList::updateElement(const QtObservedAtom::ptr &_atom)
     129{
     130  const atomicNumber_t newelement = _atom->getAtomElement();
    129131  atomicNumber_t oldelement = -1;
     132  const atomId_t atomid = _atom->getAtomIndex();
    130133  QTreeWidgetItem *newtreeItem = topLevelItem(newelement-1);
    131134  ASSERT( newtreeItem != NULL,
     
    143146//    insertTopLevelItem(newelement-1, newtreeItem);
    144147//  }
    145   AtomElementMap_t::iterator iter = AtomElementMap.find(_atom.getId());
     148  AtomElementMap_t::iterator iter = AtomElementMap.find(atomid);
    146149  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);
    149152  } else
    150153    oldelement = iter->second;
     
    183186  refill_mutex.lock();
    184187
    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);
    189191  else {
    190192    AtomElementMap_t::iterator iter = AtomElementMap.find(_atomid);
  • src/UIElements/Views/Qt4/QtElementList.hpp

    r4cac6c r5aec20  
    2323#include "types.hpp"
    2424
    25 class atom;
     25#include "UIElements/Qt4/InstanceBoard/QtObservedAtom.hpp"
     26
     27class QtObservedInstanceBoard;
    2628
    2729class QtElementList: public QTreeWidget, public Observer
     
    3032
    3133public:
    32   QtElementList(QWidget * _parent=0);
     34  QtElementList(QtObservedInstanceBoard *_board, QWidget * _parent=0);
    3335  virtual ~QtElementList();
    3436
     
    4042
    4143  void setOccurrence(QTreeWidgetItem &_item, const int count);
    42   void updateElement(const atom &_atom);
     44  void updateElement(const QtObservedAtom::ptr &_atom);
    4345
    4446  static const int COLUMNCOUNT;
     
    5961  bool dirty;
    6062
     63  //!> ptr to instance board to obtain observed atoms
     64  QtObservedInstanceBoard * const board;
     65
    6166  QMutex refill_mutex;
    6267};
Note: See TracChangeset for help on using the changeset viewer.