Index: src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_bond.cpp
===================================================================
--- src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_bond.cpp	(revision 099f67dcc87a9df01ccc2248c45c7116c48065cb)
+++ src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_bond.cpp	(revision 15c8a9b3bc531ef54d3a92deddc382002414247c)
@@ -89,8 +89,58 @@
   rightobservable_enabled(false)
 {
-  boost::function<void()> subjectKilled =
-      boost::bind(&GLMoleculeObject_bond::countsubjectKilled, this);
-  initObservedValues(ObservedValues, bondIds.first, bondIds.second, leftowner, rightowner, bondowner, subjectKilled);
-
+  boost::function<void(const atomId_t &)> leftsubjectKilled =
+      boost::bind(
+          static_cast<void (GLMoleculeObject_bond::*) (const atomId_t &)>(
+              &GLMoleculeObject_bond::countsubjectKilled),
+          this, _1);
+  boost::function<void(const atomId_t &)> rightsubjectKilled =
+      boost::bind(
+          static_cast<void (GLMoleculeObject_bond::*) (const atomId_t &)>(
+              &GLMoleculeObject_bond::countsubjectKilled)
+              , this, _1);
+  boost::function<void(const bondIds_t &)> bondsubjectKilled =
+      boost::bind(
+          static_cast<void (GLMoleculeObject_bond::*) (const bondIds_t &)>(
+              &GLMoleculeObject_bond::countsubjectKilled)
+              , this, _1);
+  initObservedValues(
+      ObservedValues,
+      bondIds.first,
+      bondIds.second,
+      leftowner,
+      rightowner,
+      bondowner,
+      leftsubjectKilled,
+      rightsubjectKilled,
+      bondsubjectKilled);
+
+  init();
+}
+
+GLMoleculeObject_bond::GLMoleculeObject_bond(
+    QGLSceneNode *mesh[],
+    QObject *parent,
+    const bondIds_t bondIds,
+    const enum SideOfBond side,
+    std::vector<boost::any> &_ObservedValues) :
+  GLMoleculeObject(mesh, parent),
+  Observer(std::string("GLMoleculeObject_bond")
+      +toString(bondIds.first)
+      +std::string("-")
+      +toString(bondIds.second)),
+  leftowner(getAtomConst(bondIds.first)),
+  rightowner(getAtomConst(bondIds.second)),
+  bondowner(getAtomConst(bondIds.first)->getBond(getAtomConst(bondIds.second)).get()),
+  BondSide(side),
+  ObservedValues(_ObservedValues),
+  subjectKilledCount(0),
+  leftobservable_enabled(false),
+  rightobservable_enabled(false)
+{
+  init();
+}
+
+void GLMoleculeObject_bond::init()
+{
   // sign on as observer (obtain non-const instance before)
   bondowner->signOn(this, BondObservable::BondRemoved);
@@ -159,5 +209,5 @@
   removeChannels();
   // check whether we should be removed
-  countsubjectKilled();
+  countsubjectKilled(std::make_pair(getleftIndex(), getrightIndex()));
 }
 
@@ -339,4 +389,11 @@
 }
 
+static GLMoleculeObject_bond::bondIds_t getBondIdsForIds(
+    const boost::function<const atomId_t ()> _left,
+    const boost::function<const atomId_t ()> _right)
+{
+  return std::make_pair( _left(), _right());
+}
+
 void GLMoleculeObject_bond::initObservedValues(
     std::vector<boost::any> &_ObservedValues,
@@ -346,5 +403,7 @@
     const Observable * const _rightowner,
     const Observable * const _bondowner,
-    const boost::function<void()> &_subjectKilled)
+    const boost::function<void(const atomId_t &)> &_leftsubjectKilled,
+    const boost::function<void(const atomId_t &)> &_rightsubjectKilled,
+    const boost::function<void(const bondIds_t &)> &_bondsubjectKilled)
 {
   /* This is an old note from when the code was still part of cstor's initializer body.
@@ -372,5 +431,5 @@
         _leftatomId,
         IndexChannels,
-        _subjectKilled);
+        _leftsubjectKilled);
   _ObservedValues[leftIndex] = LeftIndexObservable;
   ObservedValue_wCallback<atomId_t> * const RightIndexObservable =
@@ -381,5 +440,5 @@
         _rightatomId,
         IndexChannels,
-        _subjectKilled);
+        _rightsubjectKilled);
   _ObservedValues[rightIndex] = RightIndexObservable;
 
@@ -402,6 +461,8 @@
   const boost::function<int ()> DegreeUpdater(
       boost::bind(&GLMoleculeObject_bond::updateDegree, LeftIndexGetter, RightIndexGetter));
-
-  _ObservedValues[leftPosition] = new ObservedValue_wCallback<Vector>(
+  const boost::function<bondIds_t ()> BondIdGetter(
+      boost::bind(&getBondIdsForIds, LeftIndexGetter, RightIndexGetter));
+
+  _ObservedValues[leftPosition] = new ObservedValue_wCallback<Vector, atomId_t>(
       _leftowner,
       LeftPositionUpdater,
@@ -409,6 +470,7 @@
       LeftPositionUpdater(),
       BondPositionChannels,
-      _subjectKilled);
-  _ObservedValues[rightPosition] = new ObservedValue_wCallback<Vector>(
+      _leftsubjectKilled,
+      LeftIndexGetter);
+  _ObservedValues[rightPosition] = new ObservedValue_wCallback<Vector, atomId_t>(
       _rightowner,
       RightPositionUpdater,
@@ -416,6 +478,7 @@
       RightPositionUpdater(),
       BondPositionChannels,
-      _subjectKilled);
-  _ObservedValues[leftElement] = new ObservedValue_wCallback<atomicNumber_t>(
+      _rightsubjectKilled,
+      RightIndexGetter);
+  _ObservedValues[leftElement] = new ObservedValue_wCallback<atomicNumber_t, atomId_t>(
       _leftowner,
       LeftElementUpdater,
@@ -423,6 +486,7 @@
       LeftElementUpdater(),
       BondElementChannels,
-      _subjectKilled);
-  _ObservedValues[rightElement] = new ObservedValue_wCallback<atomicNumber_t>(
+      _leftsubjectKilled,
+      LeftIndexGetter);
+  _ObservedValues[rightElement] = new ObservedValue_wCallback<atomicNumber_t, atomId_t>(
       _rightowner,
       RightElementUpdater,
@@ -430,6 +494,7 @@
       RightElementUpdater(),
       BondElementChannels,
-      _subjectKilled);
-  _ObservedValues[Degree] = new ObservedValue_wCallback<int>(
+      _rightsubjectKilled,
+      RightIndexGetter);
+  _ObservedValues[Degree] = new ObservedValue_wCallback<int, bondIds_t>(
       _bondowner,
       DegreeUpdater,
@@ -437,5 +502,6 @@
       DegreeUpdater(),
       BondDegreeChannels,
-      _subjectKilled);
+      _bondsubjectKilled,
+      BondIdGetter);
 }
 
@@ -445,9 +511,9 @@
   delete boost::any_cast<ObservedValue_wCallback<atomId_t> *>(_ObservedValues[leftIndex]);
   delete boost::any_cast<ObservedValue_wCallback<atomId_t> *>(_ObservedValues[rightIndex]);
-  delete boost::any_cast<ObservedValue_wCallback<Vector> *>(_ObservedValues[leftPosition]);
-  delete boost::any_cast<ObservedValue_wCallback<Vector> *>(_ObservedValues[rightPosition]);
-  delete boost::any_cast<ObservedValue_wCallback<atomicNumber_t> *>(_ObservedValues[leftElement]);
-  delete boost::any_cast<ObservedValue_wCallback<atomicNumber_t> *>(_ObservedValues[rightElement]);
-  delete boost::any_cast<ObservedValue_wCallback<int> *>(_ObservedValues[Degree]);
+  delete boost::any_cast<ObservedValue_wCallback<Vector,atomId_t> *>(_ObservedValues[leftPosition]);
+  delete boost::any_cast<ObservedValue_wCallback<Vector,atomId_t> *>(_ObservedValues[rightPosition]);
+  delete boost::any_cast<ObservedValue_wCallback<atomicNumber_t,atomId_t> *>(_ObservedValues[leftElement]);
+  delete boost::any_cast<ObservedValue_wCallback<atomicNumber_t,atomId_t> *>(_ObservedValues[rightElement]);
+  delete boost::any_cast<ObservedValue_wCallback<int, bondIds_t> *>(_ObservedValues[Degree]);
   _ObservedValues.clear();
 }
@@ -465,24 +531,24 @@
 Vector GLMoleculeObject_bond::getleftPosition() const
 {
-  return boost::any_cast<ObservedValue_wCallback<Vector> *>(ObservedValues[leftPosition])->get();
+  return boost::any_cast<ObservedValue_wCallback<Vector,atomId_t> *>(ObservedValues[leftPosition])->get();
 }
 
 Vector GLMoleculeObject_bond::getrightPosition() const
 {
-  return boost::any_cast<ObservedValue_wCallback<Vector> *>(ObservedValues[rightPosition])->get();
+  return boost::any_cast<ObservedValue_wCallback<Vector, atomId_t> *>(ObservedValues[rightPosition])->get();
 }
 
 atomicNumber_t GLMoleculeObject_bond::getleftElement() const
 {
-  return boost::any_cast<ObservedValue_wCallback<atomicNumber_t> *>(ObservedValues[leftElement])->get();
+  return boost::any_cast<ObservedValue_wCallback<atomicNumber_t, atomId_t> *>(ObservedValues[leftElement])->get();
 }
 
 atomicNumber_t GLMoleculeObject_bond::getrightElement() const
 {
-  return boost::any_cast<ObservedValue_wCallback<atomicNumber_t> *>(ObservedValues[rightElement])->get();
+  return boost::any_cast<ObservedValue_wCallback<atomicNumber_t, atomId_t> *>(ObservedValues[rightElement])->get();
 }
 
 int GLMoleculeObject_bond::getDegree() const
 {
-  return boost::any_cast<ObservedValue_wCallback<int> *>(ObservedValues[Degree])->get();
-}
+  return boost::any_cast<ObservedValue_wCallback<int, bondIds_t> *>(ObservedValues[Degree])->get();
+}
