Ignore:
Timestamp:
Feb 12, 2016, 11:15:39 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:
deb5ee
Parents:
1b6415a
git-author:
Frederik Heber <heber@…> (10/29/15 22:21:30)
git-committer:
Frederik Heber <heber@…> (02/12/16 23:15:39)
Message:

All QtMoleculeItem now heed QtObservedMolecule and QtMoleculeList takes InstanceBoard.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/Views/Qt4/MoleculeList/QtMoleculeList.hpp

    r1b6415a rca1535  
    2525#include <string>
    2626
    27 #include "CodePatterns/Observer/Observer.hpp"
    28 
    2927#include "UIElements/Views/Qt4/MoleculeList/QtMoleculeItem.hpp"
     28#include "UIElements/Qt4/InstanceBoard/QtObservedMolecule.hpp"
    3029
    3130#include "types.hpp"
    3231
    33 class molecule;
    3432class QtMoleculeItem;
    3533class QtMoleculeListView;
     34class QtObservedInstanceBoard;
    3635
    37 class QtMoleculeList : public QStandardItemModel, public Observer
     36class QtMoleculeList : public QStandardItemModel
    3837{
    3938  Q_OBJECT
    4039
    4140public:
    42   QtMoleculeList();
     41  QtMoleculeList(QtObservedInstanceBoard *_board);
    4342  virtual ~QtMoleculeList();
    4443
    45 protected:
    46   virtual void update(Observable *publisher);
    47   virtual void recieveNotification(Observable *publisher, Notification_ptr notification);
    48   virtual void subjectKilled(Observable *publisher);
    49 
    50   void refill();
     44  void resetUpdateTimer();
    5145
    5246  QVariant headerData(int section, Qt::Orientation orientation, int role) const;
     
    7064  bool ChangingChildrensVisibility;
    7165
     66private slots:
     67  void moleculeInserted(const moleculeId_t _id);
     68  void moleculeRemoved(const moleculeId_t _id);
     69  void moleculeIndexChanged(const moleculeId_t _oldid, const moleculeId_t _newid);
     70
     71private:
    7272  mutable boost::recursive_mutex listAccessing_mutex;
    7373  mutable boost::recursive_mutex refill_mutex;
     
    9797      const enum QtMoleculeItem::COLUMNTYPES _type) const;
    9898
    99   std::string addMolecule(const molecule * const _mol);
    100   void addGroupItem(QStandardItem *&mainitem, const std::string &_molecule_formula);
    101   QList<QStandardItem *> createMoleculeItems(const moleculeId_t _molid, std::string &molecule_formula);
     99  std::string addMolecule(
     100      QtObservedMolecule::ptr &_ObservedMolecule);
     101  void addGroupItem(
     102      QStandardItem *&mainitem,
     103      const std::string &_molecule_formula);
     104  QList<QStandardItem *> createMoleculeItems(
     105      QtObservedMolecule::ptr &_ObservedMolecule,
     106      std::string &molecule_formula);
    102107  void removeMoleculeItem(QtMoleculeItem * const _item);
    103108  int setOccurrence(QStandardItem * const _groupitem);
     
    111116      const QtMoleculeItem::MoveTypes _movetype);
    112117
    113   void receiveSubjectKilled(const moleculeId_t _id);
     118  void updateItemStates();
    114119
    115   void updateItemStates();
     120  //!> reference to InstanceBoard
     121  QtObservedInstanceBoard *board;
    116122
    117123  typedef std::map<std::string, unsigned int> FormulaVisibilityCountMap_t;
     
    132138  const QtMoleculeItem::emitDirtyState_t callback_DirtyItems;
    133139
    134   //!> callback function to hand over to items that inform about called subjectKilled()
    135   const QtMoleculeItem::emitSubjectKilledState_t callback_subjectKilledItems;
    136 
    137140  typedef std::map<moleculeId_t, unsigned int> KilledItemsPerMolecule_t;
    138141  //!> takes note of how many items have already been killed for a specific row/molecule
     
    142145  typedef std::set< std::pair<moleculeId_t, QtMoleculeItem::COLUMNTYPES> > list_of_molecule_items_t;
    143146  typedef std::set< std::pair<std::string, QtMoleculeItem::COLUMNTYPES> > list_of_group_items_t;
     147
    144148  //!> list of molecule items that need an update
    145149  list_of_molecule_items_t dirtyMolItems;
     
    151155  list_of_group_items_t visibilityGroupItems;
    152156  //!> list of new molecules which need to be added
    153   std::vector<moleculeId_t> newMolecules;
     157  std::vector<QtObservedMolecule::ptr> newMolecules;
    154158  //!> list of molecules that have been removed
    155159  std::vector<moleculeId_t> removedMolecules;
Note: See TracChangeset for help on using the changeset viewer.