Index: src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject.cpp
===================================================================
--- src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject.cpp	(revision c6751895e249ac3b8b055b048e09886c9e6b6faf)
+++ src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject.cpp	(revision 3b229e53114d9aef7a92da804468aee8149f13a5)
@@ -41,4 +41,8 @@
 
 #include "CodePatterns/MemDebug.hpp"
+
+QGLMaterial *GLMoleculeObject::m_hoverMaterial = NULL;
+QGLMaterial *GLMoleculeObject::m_selectionMaterial = NULL;
+QGLMaterial *GLMoleculeObject::m_selectionBoxMaterial = NULL;
 
 
@@ -55,6 +59,5 @@
    m_selected = false;
    m_material = 0;
-   m_hoverMaterial = 0;
-   m_selectionMaterial = 0;
+   initStaticMaterials();
 }
 
@@ -72,6 +75,5 @@
    m_selected = false;
    m_material = 0;
-   m_hoverMaterial = 0;
-   m_selectionMaterial = 0;
+   initStaticMaterials();
 }
 
@@ -107,4 +109,7 @@
    else
        material = m_material;
+
+   ASSERT(material, "GLMoleculeObject::draw: chosen material is NULL");
+
    painter->setColor(material->diffuseColor());
    painter->setFaceMaterial(QGL::AllFaces, material);
@@ -123,4 +128,5 @@
 
    if (m_selected){
+     painter->setFaceMaterial(QGL::AllFaces, m_selectionBoxMaterial);
      QVector3DArray array;
      qreal radius = 0.3f;
@@ -190,5 +196,5 @@
 QGLMaterial* GLMoleculeObject::getMaterial(size_t no)
 {
-  ASSERT( (no >= 0) && (no < MAX_ELEMENTS) || (no == 65536),
+  ASSERT( (no > 0) && (no < MAX_ELEMENTS),
       "GLMoleculeView::getMaterial() - Element no "+toString(no)+" is invalid.");
   if (ElementNoMaterialMap.find(no) != ElementNoMaterialMap.end()){
@@ -200,17 +206,12 @@
     QGLMaterial *newmaterial = new QGLMaterial(NULL);
 
-    if (no == 0) { // create hover material
-      newmaterial->setAmbientColor( QColor(0, 128, 128) );
-    } else if (no == 65536) { // create selection material
-      newmaterial->setAmbientColor( QColor(255, 50, 50) );
-    } else { // create material for element
-      periodentafel *periode = World::getInstance().getPeriode();
-      const element *desiredelement = periode->FindElement(no);
-      ASSERT(desiredelement != NULL,
-          "GLMoleculeView::getMaterial() - desired element "+toString(no)+" not present in periodentafel.");
-      const unsigned char* color = desiredelement->getColor();
-      LOG(1, "Creating new material with color " << (int)color[0] << "," << (int)color[1] << "," << (int)color[2] << ".");
-      newmaterial->setAmbientColor( QColor((int)color[0], (int)color[1], (int)color[2]) );
-    }
+    // create material for element
+    periodentafel *periode = World::getInstance().getPeriode();
+    const element *desiredelement = periode->FindElement(no);
+    ASSERT(desiredelement != NULL,
+        "GLMoleculeView::getMaterial() - desired element "+toString(no)+" not present in periodentafel.");
+    const unsigned char* color = desiredelement->getColor();
+    LOG(1, "Creating new material with color " << (int)color[0] << "," << (int)color[1] << "," << (int)color[2] << ".");
+    newmaterial->setAmbientColor( QColor((int)color[0], (int)color[1], (int)color[2]) );
     newmaterial->setSpecularColor( QColor(60, 60, 60) );
     newmaterial->setShininess( 128 );
@@ -218,4 +219,29 @@
 
     return newmaterial;
+  }
+}
+
+/** Create the 3 materials shared by all objects.
+ *
+ */
+void GLMoleculeObject::initStaticMaterials()
+{
+  if (!m_hoverMaterial){
+    m_hoverMaterial = new QGLMaterial(NULL);
+    m_hoverMaterial->setAmbientColor( QColor(0, 128, 128) );
+    m_hoverMaterial->setSpecularColor( QColor(60, 60, 60) );
+    m_hoverMaterial->setShininess( 128 );
+  }
+  if (!m_selectionMaterial){
+    m_selectionMaterial = new QGLMaterial(NULL);
+    m_selectionMaterial->setAmbientColor( QColor(255, 50, 50) );
+    m_selectionMaterial->setSpecularColor( QColor(60, 60, 60) );
+    m_selectionMaterial->setShininess( 128 );
+  }
+  if (!m_selectionBoxMaterial){
+    m_selectionBoxMaterial = new QGLMaterial(NULL);
+    m_selectionBoxMaterial->setAmbientColor( QColor(0, 0, 0) );
+    m_selectionBoxMaterial->setDiffuseColor( QColor(0, 0, 0) );
+    m_selectionBoxMaterial->setEmittedLight( QColor(155, 50, 50) );
   }
 }
Index: src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject.hpp
===================================================================
--- src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject.hpp	(revision c6751895e249ac3b8b055b048e09886c9e6b6faf)
+++ src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject.hpp	(revision 3b229e53114d9aef7a92da804468aee8149f13a5)
@@ -57,12 +57,5 @@
 
    QGLMaterial *material() const { return m_material; }
-   void setMaterial(QGLMaterial *value)
-       { m_material = value; m_hoverMaterial = value; }
-
-   QGLMaterial *hoverMaterial() const { return m_hoverMaterial; }
-   void setHoverMaterial(QGLMaterial *value) { m_hoverMaterial = value; }
-
-   QGLMaterial *selectionMaterial() const { return m_selectionMaterial; }
-   void setSelectionMaterial(QGLMaterial *value) { m_selectionMaterial = value; }
+   void setMaterial(QGLMaterial *value) { m_material = value; }
 
    QGLAbstractEffect *effect() const { return m_effect; }
@@ -75,4 +68,5 @@
    void setSelected(bool value);
 
+   void initStaticMaterials();
    void initialize(QGLView *view, QGLPainter *painter);
    void draw(QGLPainter *painter);
@@ -106,6 +100,7 @@
    QVector3D m_rotationVector;
    QGLMaterial *m_material;
-   QGLMaterial *m_hoverMaterial;
-   QGLMaterial *m_selectionMaterial;
+   static QGLMaterial *m_hoverMaterial;
+   static QGLMaterial *m_selectionMaterial;
+   static QGLMaterial *m_selectionBoxMaterial;
    QGLAbstractEffect *m_effect;
    int m_objectId;
Index: src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_atom.cpp
===================================================================
--- src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_atom.cpp	(revision c6751895e249ac3b8b055b048e09886c9e6b6faf)
+++ src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_atom.cpp	(revision 3b229e53114d9aef7a92da804468aee8149f13a5)
@@ -106,12 +106,4 @@
       "GLMoleculeObject_atom::GLMoleculeObject_atom() - QGLMaterial ref from getter function is NULL.");
   setMaterial(elementmaterial);
-  QGLMaterial *hovermaterial = getMaterial(0); // 0 is the hover material
-  ASSERT(hovermaterial != NULL,
-      "GLMoleculeObject_atom::GLMoleculeObject_atom() - QGLMaterial ref from getter function for hover is NULL.");
-  setHoverMaterial(hovermaterial);
-  QGLMaterial *selectionmaterial = getMaterial(65536); // 65536 is the selection material
-  ASSERT(selectionmaterial != NULL,
-      "GLMoleculeObject_atom::GLMoleculeObject_atom() - QGLMaterial ref from getter function for selection is NULL.");
-  setSelectionMaterial(selectionmaterial);
 
   // set scale
Index: src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_molecule.cpp
===================================================================
--- src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_molecule.cpp	(revision c6751895e249ac3b8b055b048e09886c9e6b6faf)
+++ src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_molecule.cpp	(revision 3b229e53114d9aef7a92da804468aee8149f13a5)
@@ -63,7 +63,5 @@
   setPosition(QVector3D(0,0,0));
   setScale(5.0f);
-  QGLMaterial *selectionmaterial = getMaterial(65536); // 65536 is the selection material
-  setMaterial(selectionmaterial);
-  setSelectionMaterial(selectionmaterial);
+  setMaterial(getMaterial(1));
 }
 
