Index: src/UIElements/Views/Qt4/Qt3D/GLWorldScene.cpp
===================================================================
--- src/UIElements/Views/Qt4/Qt3D/GLWorldScene.cpp	(revision 07414d75db53b92f61d9d0750366a0345e86940e)
+++ src/UIElements/Views/Qt4/Qt3D/GLWorldScene.cpp	(revision 7f1b51d9ebdfbd81ece2b0afc41b3153a06c5e91)
@@ -94,4 +94,6 @@
   }
 
+  connect(this, SIGNAL(updated()), this, SLOT(update()));
+
   setSelectionMode(SelectAtom);
 
@@ -110,26 +112,69 @@
 void GLWorldScene::init()
 {
-  const std::vector<molecule*> &molecules = World::getInstance().getAllMolecules();
-
-  if (molecules.size() > 0) {
-    for (std::vector<molecule*>::const_iterator Runner = molecules.begin();
-        Runner != molecules.end();
-        Runner++) {
-
-      for (molecule::const_iterator atomiter = (*Runner)->begin();
-          atomiter != (*Runner)->end();
-          ++atomiter) {
-        // create atom objects in scene
+  const std::vector<atom*> &atoms = World::getInstance().getAllAtoms();
+
+  if (atoms.size() > 0) {
+    for (std::vector<atom*>::const_iterator atomiter = atoms.begin();
+        atomiter != atoms.end();
+        atomiter++) {
+      // create atom objects in scene
+      atomInserted((*atomiter)->getId());
+
+      // create bond objects in scene
+      const BondList &bondlist = (*atomiter)->getListOfBonds();
+      for (BondList::const_iterator bonditer = bondlist.begin();
+          bonditer != bondlist.end();
+          ++bonditer) {
+        const bond::ptr _bond = *bonditer;
+        const GLMoleculeObject_bond::SideOfBond side = (_bond->leftatom == *atomiter) ?
+            GLMoleculeObject_bond::left : GLMoleculeObject_bond::right;
+        bondInserted(_bond, side);
+      }
+    }
+  }
+}
+
+/** Update the WorldScene with molecules and atoms from World.
+ *
+ * This function should be called after e.g. WorldTime::TimeChanged was
+ * received or after another molecule has been loaded.
+ *
+ */
+void GLWorldScene::update()
+{
+  const std::vector<atom*> &atoms = World::getInstance().getAllAtoms();
+
+  if (atoms.size() > 0) {
+    for (std::vector<atom*>::const_iterator atomiter = atoms.begin();
+        atomiter != atoms.end();
+        atomiter++) {
+      // check whether atom already exists
+      const atomId_t atomid = (*atomiter)->getId();
+      const bool atom_present = AtomsinSceneMap.count(atomid);
+      if (!atom_present)
         atomInserted((*atomiter)->getId());
-
-        // create bond objects in scene
-        const BondList &bondlist = (*atomiter)->getListOfBonds();
-        for (BondList::const_iterator bonditer = bondlist.begin();
-            bonditer != bondlist.end();
-            ++bonditer) {
-          const bond::ptr _bond = *bonditer;
-          const GLMoleculeObject_bond::SideOfBond side = (_bond->leftatom == *atomiter) ?
-              GLMoleculeObject_bond::left : GLMoleculeObject_bond::right;
+      else
+        AtomsinSceneMap[atomid]->resetPosition();
+
+
+      // create bond objects in scene
+      const BondList &bondlist = (*atomiter)->getListOfBonds();
+      for (BondList::const_iterator bonditer = bondlist.begin();
+          bonditer != bondlist.end();
+          ++bonditer) {
+        const bond::ptr _bond = *bonditer;
+        const GLMoleculeObject_bond::SideOfBond side = (_bond->leftatom == *atomiter) ?
+            GLMoleculeObject_bond::left : GLMoleculeObject_bond::right;
+        bool bond_present = false;
+        const BondIds ids = getBondIds(_bond,side);
+        if (atom_present) {
+          // check whether bond is not present already
+          bond_present = BondsinSceneMap.count(ids);
+        }
+        if (!bond_present)
           bondInserted(_bond, side);
+        else {
+          BondsinSceneMap[ids]->resetPosition();
+          BondsinSceneMap[ids]->resetWidth();
         }
       }
@@ -246,16 +291,14 @@
 }
 
-/** Adds a bond to the scene.
- *
- * @param _bond bond to add
- * @param side which side of the bond (left or right)
- */
-void GLWorldScene::bondInserted(const bond::ptr _bond, const enum GLMoleculeObject_bond::SideOfBond side)
-{
-  LOG(3, "INFO: GLWorldScene::bondInserted() - Adding bond "+toString(*_bond)+".");
-  //LOG(4, "INFO: Currently present bonds " << BondsinSceneMap << ".");
-
+/** Helper function to get bond ids in the correct order for BondNodeMap.
+ *
+ * \return pair of ids in correct order.
+ */
+GLWorldScene::BondIds GLWorldScene::getBondIds(
+    const bond::ptr _bond,
+    const enum GLMoleculeObject_bond::SideOfBond _side) const
+{
   BondIds ids;
-  switch (side) {
+  switch (_side) {
     case GLMoleculeObject_bond::left:
       ids = std::make_pair(_bond->leftatom->getId(), _bond->rightatom->getId());
@@ -265,17 +308,32 @@
       break;
   }
-#ifndef NDEBUG
+  return ids;
+}
+
+/** Adds a bond to the scene.
+ *
+ * @param _bond bond to add
+ * @param side which side of the bond (left or right)
+ */
+void GLWorldScene::bondInserted(const bond::ptr _bond, const enum GLMoleculeObject_bond::SideOfBond _side)
+{
+  LOG(3, "INFO: GLWorldScene::bondInserted() - Adding bond "+toString(*_bond)+".");
+  //LOG(4, "INFO: Currently present bonds " << BondsinSceneMap << ".");
+
+  const BondIds ids = getBondIds(_bond, _side);
   BondNodeMap::iterator iter = BondsinSceneMap.find(ids);
-  ASSERT(iter == BondsinSceneMap.end(),
-      "GLWorldScene::bondAdded() - same left-sided bond "+toString(*_bond)+" added again.");
-#endif
-  GLMoleculeObject_bond * bondObject =
-      new GLMoleculeObject_bond(meshCylinder, this, _bond, side);
-  connect (
-      bondObject, SIGNAL(BondRemoved(const atomId_t, const atomId_t)),
-      this, SLOT(bondRemoved(const atomId_t, const atomId_t)));
-  connect (bondObject, SIGNAL(changed()), this, SIGNAL(changed()));
-  BondsinSceneMap.insert( make_pair(ids, bondObject) );
-//    BondIdsinSceneMap.insert( Leftids );
+  if (iter == BondsinSceneMap.end()) {
+    GLMoleculeObject_bond * bondObject =
+        new GLMoleculeObject_bond(meshCylinder, this, _bond, _side);
+    connect (
+        bondObject, SIGNAL(BondRemoved(const atomId_t, const atomId_t)),
+        this, SLOT(bondRemoved(const atomId_t, const atomId_t)));
+    connect (bondObject, SIGNAL(changed()), this, SIGNAL(changed()));
+    BondsinSceneMap.insert( make_pair(ids, bondObject) );
+  //    BondIdsinSceneMap.insert( Leftids );
+  } else {
+    iter->second->resetPosition();
+    iter->second->resetWidth();
+  }
   emit changeOccured();
 }
