Ignore:
Timestamp:
Feb 12, 2016, 11:15:23 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:
494478
Parents:
41e287
git-author:
Frederik Heber <heber@…> (10/29/15 10:46:45)
git-committer:
Frederik Heber <heber@…> (02/12/16 23:15:23)
Message:

Extracted all ObservedValue functionality out of GLMoleculeObject_atom.

  • i.e. GLMoleculeObject_atom is reduced to simple displaying, updated via Qt signals. These signals are connected to a QtObservedAtom which in turn now contains all the ObservedValue functionality.
  • this is preparatory for having a single (Observed)Atom as representer of its associated World's atom in the QtGui part of the code.
Location:
src/UIElements/Qt4/InstanceBoard
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/Qt4/InstanceBoard/ObservedValuesContainer.hpp

    r41e287 r65c323  
    3333   *
    3434   * \param _name name used in debugging and prints
     35   * \param _board ref to InstanceBoard
    3536   */
    36   ObservedValuesContainer(const std::string _name) :
    37     NameOfType(_name)
    38   {}
    39 
    40   /** Dstor of class ObservedValuesContainer.
    41    *
    42    */
    43   ~ObservedValuesContainer()
    44   {}
     37  ObservedValuesContainer(
     38      const std::string _name,
     39      QtObservedInstanceBoard &_board);
    4540
    4641  /** Delivers the set of Observed value for the instance identified by \a _id.
     
    6964  //!> name used in describing the instance type
    7065  const std::string NameOfType;
     66
     67  //!> reference to InstanceBoard for callbacks on subjectKilled()
     68  QtObservedInstanceBoard &board;
    7169
    7270private:
  • src/UIElements/Qt4/InstanceBoard/ObservedValuesContainer_impl.hpp

    r41e287 r65c323  
    2020
    2121template <class T, typename id>
     22ObservedValuesContainer<T,id>::ObservedValuesContainer(
     23    const std::string _name,
     24    QtObservedInstanceBoard &_board) :
     25  NameOfType(_name),
     26  board(_board)
     27{}
     28
     29template <class T, typename id>
    2230typename T::ptr ObservedValuesContainer<T,id>::get(const id _id)
    2331{
     
    2937  // increase refcount
    3038  ++(iter->second.second);
    31   typename T::ptr _molecule(new T(obsvalues));
     39  typename T::ptr _molecule(new T(obsvalues, board));
     40
     41  return _molecule;
     42}
     43
     44template <>
     45typename QtObservedMolecule::ptr
     46ObservedValuesContainer<QtObservedMolecule,moleculeId_t>::get(const moleculeId_t _id)
     47{
     48  typename CountedObservedValues_t::iterator iter = ObservedValues.find(_id);
     49  ASSERT( iter != ObservedValues.end(),
     50      "ObservedValuesContainer::getObservedValues() - no observed values present for "
     51      +NameOfType+" "+toString(_id));
     52  const ObservedValues_t &obsvalues = iter->second.first;
     53  // increase refcount
     54  ++(iter->second.second);
     55  typename QtObservedMolecule::ptr _molecule(new QtObservedMolecule(obsvalues));
    3256
    3357  return _molecule;
  • src/UIElements/Qt4/InstanceBoard/QtObservedAtom.cpp

    r41e287 r65c323  
    3636#include "QtObservedAtom.hpp"
    3737
     38#include "UIElements/Qt4/InstanceBoard/QtObservedInstanceBoard.hpp"
     39
    3840#include "CodePatterns/MemDebug.hpp"
    3941
     42#include <boost/assign.hpp>
     43
     44#include "Atom/atom.hpp"
     45#include "Bond/bond.hpp"
     46#include "Descriptors/AtomIdDescriptor.hpp"
     47#include "Element/element.hpp"
     48#include "World.hpp"
     49
     50#include "UIElements/Views/Qt4/Qt3D/ObservedValue_wCallback.hpp"
     51
     52using namespace boost::assign;
     53
     54static const Observable::channels_t getAtomBondsChannels()
     55{
     56  Observable::channels_t channels;
     57  channels += AtomObservable::BondsAdded, AtomObservable::BondsRemoved;
     58  return channels;
     59}
     60
     61static const Observable::channels_t getAllObservedChannels()
     62{
     63  Observable::channels_t channels;
     64  channels +=
     65      AtomObservable::IndexChanged,
     66      AtomObservable::PositionChanged,
     67      AtomObservable::ElementChanged,
     68      AtomObservable::BondsAdded,
     69      AtomObservable::BondsRemoved;
     70  return channels;
     71}
     72
     73// static entities
     74const Observable::channels_t
     75QtObservedAtom::AtomIndexChannels(1, AtomObservable::IndexChanged);
     76const Observable::channels_t
     77QtObservedAtom::AtomPositionChannels(1, AtomObservable::PositionChanged);
     78const Observable::channels_t
     79QtObservedAtom::AtomElementChannels(1, AtomObservable::ElementChanged);
     80const Observable::channels_t
     81QtObservedAtom::AtomBondsChannels(getAtomBondsChannels());
     82
    4083QtObservedAtom::QtObservedAtom(
    41     const ObservedValues_t &_obsvalues,
     84    const ObservedValues_t &_ObservedValues,
     85    QtObservedInstanceBoard &_board,
    4286    QWidget * _parent) :
    4387  QWidget(_parent),
    4488  Observer("QtObservedAtom"),
    45   obsvalues(_obsvalues)
    46 {}
     89  subjectKilledCount(0),
     90  AllsignedOnChannels(getAllObservedChannels().size()),
     91  signedOffChannels(0),
     92  owner(NULL),
     93  board(_board),
     94  ObservedValues(_ObservedValues)
     95{
     96  activateObserver();
     97}
    4798
    4899QtObservedAtom::~QtObservedAtom()
    49 {}
     100{
     101  deactivateObserver();
     102}
     103
     104const atom * const QtObservedAtom::getAtomConst(const atomId_t _id)
     105{
     106  const atom * const _atom = const_cast<const World &>(World::getInstance()).
     107      getAtom(AtomById(_id));
     108  return _atom;
     109}
     110
     111atom * const QtObservedAtom::getAtom(const atomId_t _id)
     112{
     113  atom * const _atom = World::getInstance().getAtom(AtomById(_id));
     114  return _atom;
     115}
     116
     117atomId_t QtObservedAtom::updateIndex()
     118{
     119  return const_cast<const World &>(World::getInstance()).lastChangedAtomId();
     120}
     121
     122Vector QtObservedAtom::updatePosition(
     123    const boost::function<const atomId_t ()> &_getAtomIndex)
     124{
     125  const atom * const _atom = getAtomConst(_getAtomIndex());
     126  if (_atom != NULL) {
     127    return _atom->getPosition();
     128  } else {
     129    return zeroVec;
     130  }
     131}
     132
     133atomicNumber_t QtObservedAtom::updateElement(
     134    const boost::function<const atomId_t ()> &_getAtomIndex)
     135{
     136  const atom * const _atom = getAtomConst(_getAtomIndex());
     137  if (_atom != NULL) {
     138    return _atom->getElementNo();
     139  } else {
     140    return (atomicNumber_t)-1;
     141  }
     142}
     143
     144QtObservedAtom::ListOfBonds_t QtObservedAtom::updateBonds(
     145    const boost::function<const atomId_t ()> &_getAtomIndex)
     146{
     147  ListOfBonds_t ListOfBonds;
     148  const atom * const _atom = getAtomConst(_getAtomIndex());
     149  if (_atom != NULL) {
     150    // make sure bonds is up-to-date
     151    const BondList ListBonds = _atom->getListOfBonds();
     152    for (BondList::const_iterator iter = ListBonds.begin();
     153        iter != ListBonds.end();
     154        ++iter)
     155      ListOfBonds.insert( ListOfBonds.end(), std::make_pair(
     156          (*iter)->leftatom->getId(),
     157          (*iter)->rightatom->getId()) );
     158  }
     159  return ListOfBonds;
     160}
    50161
    51162void QtObservedAtom::update(Observable *publisher)
    52 {}
     163{
     164  ASSERT(0, "QtObservedAtom::update() - we are not signed on for global updates.");
     165}
    53166
    54167void QtObservedAtom::subjectKilled(Observable *publisher)
    55 {}
     168{
     169  ++signedOffChannels;
     170
     171  if (signedOffChannels == AllsignedOnChannels) {
     172    // remove owner: no more signOff needed
     173    owner = NULL;
     174
     175    board.atomcountsubjectKilled(getAtomIndex());
     176  }
     177}
    56178
    57179void QtObservedAtom::recieveNotification(Observable *publisher, Notification_ptr notification)
    58 {}
     180{
     181  // ObservedValues have been updated before, hence convert updates to Qt's signals
     182  switch (notification->getChannelNo()) {
     183    case AtomObservable::IndexChanged:
     184      emit indexChanged();
     185      break;
     186    case AtomObservable::PositionChanged:
     187      emit positionChanged();
     188      break;
     189    case AtomObservable::ElementChanged:
     190      emit elementChanged();
     191      break;
     192    case AtomObservable::BondsAdded:
     193    case AtomObservable::BondsRemoved:
     194      emit bondsChanged();
     195      break;
     196    default:
     197      ASSERT(0, "QtObservedAtom::recieveNotification() - we are not signed on to channel "
     198          +toString(notification->getChannelNo())+" of the atom.");
     199      break;
     200  }
     201}
     202
     203void QtObservedAtom::activateObserver()
     204{
     205  atom * atomref = getAtom(getAtomIndex());
     206  if (atomref != NULL) {
     207    Observable::channels_t channels = getAllObservedChannels();
     208    owner = static_cast<const Observable *>(atomref);
     209    for (Observable::channels_t::const_iterator iter = channels.begin();
     210        iter != channels.end(); ++iter)
     211      owner->signOn(this, *iter);
     212  } else
     213    signedOffChannels = getAllObservedChannels().size();
     214}
     215
     216void QtObservedAtom::deactivateObserver()
     217{
     218  // sign Off
     219  if (owner != NULL) {
     220    Observable::channels_t channels = getAllObservedChannels();
     221    for (Observable::channels_t::const_iterator iter = channels.begin();
     222        iter != channels.end(); ++iter)
     223      owner->signOff(this, *iter);
     224    owner = NULL;
     225    signedOffChannels = AllsignedOnChannels;
     226  }
     227}
     228
     229void QtObservedAtom::initObservedValues(
     230    ObservedValues_t &_ObservedValues,
     231    const atomId_t _id,
     232    const atom * const _atomref,
     233    const boost::function<void(const atomId_t)> &_subjectKilled)
     234{
     235  /* This is an old note from when the code was still part of cstor's initializer body.
     236   * TODO: Probably does not apply anymore but has not yet been tested.
     237   *
     238   * We must not use boost::cref(this) as "this" has not been properly constructed and seemingly
     239   * boost::cref tries to do some magic to grasp the inheritance hierarchy which fails because
     240   * the class has not been fully constructed yet. "This" itself seems to be working fine.
     241   */
     242
     243  ASSERT( _ObservedValues.size() == MAX_ObservedTypes,
     244      "QtObservedAtom::initObservedValues() - given ObservedValues has not correct size.");
     245
     246  // fill ObservedValues: index first
     247  const boost::function<atomId_t ()> AtomIndexUpdater(
     248      boost::bind(&QtObservedAtom::updateIndex));
     249
     250  ObservedValue_wCallback<atomId_t> * const IndexObservable =
     251      new ObservedValue_wCallback<atomId_t>(
     252          _atomref,
     253          boost::bind(&QtObservedAtom::updateIndex),
     254          "AtomIndex_"+toString(_id),
     255          _id,
     256          AtomIndexChannels,
     257          _subjectKilled);
     258  _ObservedValues[AtomIndex] = IndexObservable;
     259
     260  const boost::function<const atomId_t ()> AtomIndexGetter =
     261      boost::bind(&ObservedValue_wCallback<atomId_t>::get,
     262          IndexObservable);
     263
     264  // fill ObservedValues: then all the other that need index
     265  const boost::function<Vector ()> AtomPositionUpdater(
     266      boost::bind(&QtObservedAtom::updatePosition, AtomIndexGetter));
     267  const boost::function<atomicNumber_t ()> AtomElementUpdater(
     268      boost::bind(&QtObservedAtom::updateElement, AtomIndexGetter));
     269  const boost::function<ListOfBonds_t ()> AtomBondsUpdater(
     270      boost::bind(&QtObservedAtom::updateBonds, AtomIndexGetter));
     271
     272  _ObservedValues[AtomPosition] = new ObservedValue_wCallback<Vector, atomId_t>(
     273      _atomref,
     274      AtomPositionUpdater,
     275      "AtomPosition_"+toString(_id),
     276      AtomPositionUpdater(),
     277      AtomPositionChannels,
     278      _subjectKilled,
     279      AtomIndexGetter);
     280  _ObservedValues[AtomElement] = new ObservedValue_wCallback<atomicNumber_t, atomId_t>(
     281      _atomref,
     282      AtomElementUpdater,
     283      "AtomElement"+toString(_id),
     284      AtomElementUpdater(),
     285      AtomElementChannels,
     286      _subjectKilled,
     287      AtomIndexGetter);
     288  _ObservedValues[AtomBonds] = new ObservedValue_wCallback<ListOfBonds_t, atomId_t>(
     289      _atomref,
     290      AtomBondsUpdater,
     291      "AtomBonds_"+toString(_id),
     292      AtomBondsUpdater(),
     293      AtomBondsChannels,
     294      _subjectKilled,
     295      AtomIndexGetter);
     296}
     297
     298void QtObservedAtom::destroyObservedValues(
     299    std::vector<boost::any> &_ObservedValues)
     300{
     301  delete boost::any_cast<ObservedValue_wCallback<atomId_t> *>(_ObservedValues[AtomIndex]);
     302  delete boost::any_cast<ObservedValue_wCallback<Vector, atomId_t> *>(_ObservedValues[AtomPosition]);
     303  delete boost::any_cast<ObservedValue_wCallback<atomicNumber_t, atomId_t> *>(_ObservedValues[AtomElement]);
     304  delete boost::any_cast<ObservedValue_wCallback<ListOfBonds_t, atomId_t> *>(_ObservedValues[AtomBonds]);
     305  _ObservedValues.clear();
     306}
     307
     308atomId_t QtObservedAtom::getAtomIndex() const
     309{
     310  return boost::any_cast<ObservedValue_wCallback<atomId_t> *>(ObservedValues[AtomIndex])->get();
     311}
     312
     313Vector QtObservedAtom::getAtomPosition() const
     314{
     315  return boost::any_cast<ObservedValue_wCallback<Vector, atomId_t> *>(ObservedValues[AtomPosition])->get();
     316}
     317
     318atomicNumber_t QtObservedAtom::getAtomElement() const
     319{
     320  return boost::any_cast<ObservedValue_wCallback<atomicNumber_t, atomId_t> *>(ObservedValues[AtomElement])->get();
     321}
     322
     323QtObservedAtom::ListOfBonds_t QtObservedAtom::getAtomBonds() const
     324{
     325  return boost::any_cast<ObservedValue_wCallback<ListOfBonds_t, atomId_t> *>(ObservedValues[AtomBonds])->get();
     326}
  • src/UIElements/Qt4/InstanceBoard/QtObservedAtom.hpp

    r41e287 r65c323  
    1717#include <QtGui/QWidget>
    1818
    19 
     19#include <boost/function.hpp>
    2020#include <boost/shared_ptr.hpp>
    2121
     22#include "CodePatterns/Observer/Observable.hpp"
    2223#include "CodePatterns/Observer/Observer.hpp"
     24
     25#include "LinearAlgebra/Vector.hpp"
    2326
    2427#include "UIElements/Qt4/InstanceBoard/ObservedValue_types.hpp"
     
    2629#include "types.hpp"
    2730
     31class atom;
    2832class QtObservedInstanceBoard;
    2933
     
    3741 *
    3842 * This is the instance for information about a particular atom.
     43 *
     44 * Essentially, this is the interface between molecuilder's World (and a
     45 * particular atom) and the QtGui part of the code.
    3946 */
    4047class QtObservedAtom : public QWidget, public Observer
     
    4249  Q_OBJECT
    4350
     51public:
     52
     53  //!> typedef for instance wrapped in shared ptr
     54  typedef boost::shared_ptr<QtObservedAtom> ptr;
     55
     56private:
    4457  //!> ObservedValuesContainer needs to access private cstor and dstor
    4558  friend class ObservedValuesContainer<QtObservedAtom, atomId_t>;
     
    4760  friend class QtObservedInstanceBoard;
    4861
    49   //!> typedef for instance wrapped in shared ptr
    50   typedef boost::shared_ptr<QtObservedAtom> ptr;
    51 
    5262  /** Cstor of QtObservedAtom.
    5363   *
    54    * \param _obsvalues ref to set of observed values for this instance
     64   * \param _ObservedValues ref to set of observed values for this instance
     65   * \param _board ref to InstanceBoard for callbacks on occasion of subjectKilled()
    5566   * \param _parent Qt parent to automatically destroy when parent is destroyed
    5667   */
    5768  QtObservedAtom(
    58       const ObservedValues_t &_obsvalues,
     69      const ObservedValues_t &_ObservedValues,
     70      QtObservedInstanceBoard &_board,
    5971      QWidget * _parent=0);
    6072
     
    7183  void recieveNotification(Observable *publisher, Notification_ptr notification);
    7284
     85  /** Getter to atom index contained in \a ObservedValues.
     86   *
     87   * \return atom's index
     88   */
     89  atomId_t getAtomIndex() const;
     90
     91  /** Getter to atom position contained in \a ObservedValues.
     92   *
     93   * \return atom's position
     94   */
     95  Vector getAtomPosition() const;
     96
     97  /** Getter to atom element contained in \a ObservedValues.
     98   *
     99   * \return atom's elemnt
     100   */
     101  atomicNumber_t getAtomElement() const;
     102
     103  //!> typedef for list of bonds, defined by pairs of atom ids
     104  typedef std::vector< std::pair<atomId_t, atomId_t> > ListOfBonds_t;
     105
     106  /** Getter to atom bonds contained in \a ObservedValues.
     107   *
     108   * \return atom's bonds
     109   */
     110  ListOfBonds_t getAtomBonds() const;
     111
    73112signals:
    74 
    75 private slots:
    76 
    77 
    78 private:
     113  void indexChanged();
     114  void positionChanged();
     115  void elementChanged();
     116  void bondsChanged();
     117
     118//private slots:
     119
     120private:
     121  void activateObserver();
     122  void deactivateObserver();
     123
     124  static const atom * const getAtomConst(const atomId_t _id);
     125  static atom * const getAtom(const atomId_t _id);
     126
     127private:
     128  static atomId_t updateIndex();
     129  static Vector updatePosition(
     130      const boost::function<const atomId_t ()> &_getAtomIndex);
     131  static atomicNumber_t updateElement(
     132      const boost::function<const atomId_t ()> &_getAtomIndex);
     133  static ListOfBonds_t updateBonds(
     134      const boost::function<const atomId_t ()> &_getAtomIndex);
     135
     136  //!> enumeration of observed values to match with entries in ObservedValues
     137  enum ObservedTypes {
     138    //!> contains the current atom index
     139    AtomIndex,
     140    //!> contains the current atom position
     141    AtomPosition,
     142    //!> contains the current atom element
     143    AtomElement,
     144    //!> contains the current set of bonds atoms fort the atom
     145    AtomBonds,
     146    //!> gives the size of the enumeration
     147    MAX_ObservedTypes
     148  };
     149
     150  /** Initializes all \a ObservedValues entries.
     151   *
     152   * \param _ObservedValues vector of ObservedValue to be filled
     153   * \param _id atom id
     154   * \param _atomref reference to atom
     155   * \param _subjectKilled ref to function to call on subjectKilled()
     156   */
     157  static void initObservedValues(
     158      ObservedValues_t &_ObservedValues,
     159      const atomId_t _id,
     160      const atom * const _atomref,
     161      const boost::function<void(const atomId_t)> &_subjectKilled);
     162
     163  /** Destroys all \a ObservedValues entries.
     164   *
     165   * \param _ObservedValues vector of ObservedValue to be destroyed
     166   */
     167  static void destroyObservedValues(
     168      std::vector<boost::any> &_ObservedValues);
     169
     170  //!> counts how many ObservedValues have already been subjectKilled()
     171  mutable size_t subjectKilledCount;
     172
     173private:
     174
     175  //!> list of channels when index needs to update
     176  static const Observable::channels_t AtomIndexChannels;
     177  //!> list of channels when position needs to update
     178  static const Observable::channels_t AtomPositionChannels;
     179  //!> list of channels when element needs to update
     180  static const Observable::channels_t AtomElementChannels;
     181  //!> list of channels when bonds needs to update
     182  static const Observable::channels_t AtomBondsChannels;
     183
     184  //!> we get multiple subjectKilled(), count and call callback() only on last
     185  const unsigned int AllsignedOnChannels;
     186  unsigned int signedOffChannels;
     187
     188  //!> the Observable we are signed on, also indicates whether we are sign on (not NULL)
     189  const Observable *owner;
     190
     191private:
     192
     193  //!> reference to InstanceBoard for callbacks on subjectKilled()
     194  QtObservedInstanceBoard & board;
     195
    79196  //!> internal reference to ObservedValues held by QtObservedInstanceBoard
    80   const ObservedValues_t &obsvalues;
     197  ObservedValues_t ObservedValues;
    81198};
    82199
  • src/UIElements/Qt4/InstanceBoard/QtObservedInstanceBoard.cpp

    r41e287 r65c323  
    3636#include "QtObservedInstanceBoard.hpp"
    3737
    38 #include "UIElements/Views/Qt4/Qt3D/GLMoleculeObject_atom.hpp"
    3938#include "UIElements/Views/Qt4/Qt3D/GLMoleculeObject_molecule.hpp"
     39#include "UIElements/Qt4/InstanceBoard/QtObservedAtom.hpp"
    4040
    4141#include "CodePatterns/MemDebug.hpp"
     
    5454  Observer("QtObservedInstanceBoard"),
    5555  WorldSignedOn(false),
    56   atomObservedValues("atom"),
    57   moleculeObservedValues("molecule"),
     56  atomObservedValues("atom", *this),
     57  moleculeObservedValues("molecule", *this),
    5858  atomSubjectKilled(
    5959      boost::bind(&QtObservedInstanceBoard::atomcountsubjectKilled, this, _1)),
     
    181181            getAtom(AtomById(_id));
    182182        if (_atom!= NULL) {
    183           ObservedValues_t ObservedValues(GLMoleculeObject_atom::MAX_ObservedTypes);
     183          ObservedValues_t ObservedValues(QtObservedAtom::MAX_ObservedTypes);
    184184          LOG(3, "DEBUG: InformationBoard initializes ObservedValues for atom " << _id);
    185           GLMoleculeObject_atom::initObservedValues(
     185          QtObservedAtom::initObservedValues(
    186186              ObservedValues,
    187187              _id,
     
    303303  ++(iter->second);
    304304
    305   if (iter->second > GLMoleculeObject_atom::MAX_ObservedTypes) {
     305  if (iter->second > QtObservedAtom::MAX_ObservedTypes) {
    306306    ASSERT( atomObservedValues.getRefCount(_atomid) == 0,
    307307        "QtObservedInstanceBoard::atomcountsubjectKilled() - observed Values for atom "
  • src/UIElements/Qt4/InstanceBoard/QtObservedInstanceBoard.hpp

    r41e287 r65c323  
    3030
    3131class GLWorldScene;
    32 class GLMoleculeObject_atom;
    3332class GLMoleculeObject_bond;
    3433class GLMoleculeObject_molecule;
     
    101100private:
    102101  friend class GLWorldScene;
    103   friend class GLMoleculeObject_atom;
    104102  friend class GLMoleculeObject_bond;
    105103  friend class GLMoleculeObject_molecule;
     104  friend class QtObservedAtom;
    106105
    107106  //!> indicating whether we are still signedOn to World or not
Note: See TracChangeset for help on using the changeset viewer.