Index: trunk/packages/vizservers/vtkvis/Molecule.cpp
===================================================================
--- trunk/packages/vizservers/vtkvis/Molecule.cpp	(revision 3778)
+++ trunk/packages/vizservers/vtkvis/Molecule.cpp	(revision 3795)
@@ -29,4 +29,5 @@
 #include <vtkLabelPlacementMapper.h>
 #include <vtkTextProperty.h>
+#include <vtkTransformPolyDataFilter.h>
 
 #include "Molecule.h"
@@ -108,4 +109,6 @@
         _atomProp->GetProperty()->SetOpacity(_opacity);
         _atomProp->GetProperty()->SetAmbient(.2);
+        _atomProp->GetProperty()->SetSpecular(.2);
+        _atomProp->GetProperty()->SetSpecularPower(80.0);
         if (!_lighting)
             _atomProp->GetProperty()->LightingOff();
@@ -121,4 +124,6 @@
         _bondProp->GetProperty()->SetOpacity(_opacity);
         _bondProp->GetProperty()->SetAmbient(.2);
+        _bondProp->GetProperty()->SetSpecular(.2);
+        _bondProp->GetProperty()->SetSpecularPower(80.0);
         if (!_lighting)
             _bondProp->GetProperty()->LightingOff();
@@ -231,9 +236,15 @@
                 _labelHierarchy = vtkSmartPointer<vtkPointSetToLabelHierarchy>::New();
             }
-#ifdef USE_VTK6
-            _labelHierarchy->SetInputData(pd);
+            if (_labelTransform == NULL) {
+                _labelTransform = vtkSmartPointer<vtkTransform>::New();
+            }
+            vtkSmartPointer<vtkTransformPolyDataFilter> transformFilter = vtkSmartPointer<vtkTransformPolyDataFilter>::New();
+#ifdef USE_VTK6              
+            transformFilter->SetInputData(pd);
 #else
-            _labelHierarchy->SetInput(pd);
+            transformFilter->SetInput(pd);
 #endif
+            transformFilter->SetTransform(_labelTransform);
+            _labelHierarchy->SetInputConnection(transformFilter->GetOutputPort());
             _labelHierarchy->SetLabelArrayName("_atom_labels");
             _labelHierarchy->GetTextProperty()->SetColor(0, 0, 0);
@@ -255,13 +266,7 @@
             _atomMapper->SetInputConnection(pd->GetProducerPort());
 #endif
-            if (ds->GetPointData() != NULL &&
-                ds->GetPointData()->GetVectors() != NULL) {
-                _atomMapper->SetScaleArray(vtkDataSetAttributes::VECTORS);
-                _atomMapper->SetScaleModeToScaleByMagnitude();
-                _atomMapper->ScalingOn();
-            } else {
-                _atomMapper->SetScaleModeToNoDataScaling();
-                _atomMapper->ScalingOff();
-            }
+            _atomMapper->SetScaleArray("_radii");
+            _atomMapper->SetScaleModeToScaleByMagnitude();
+            _atomMapper->ScalingOn();
             _atomMapper->OrientOff();
 
@@ -283,4 +288,11 @@
     if (pd->GetNumberOfLines() > 0) {
         _bondMapper->Update();
+    }
+}
+
+void Molecule::updateLabelTransform()
+{
+    if (_labelTransform != NULL && getAssembly() != NULL) {
+        _labelTransform->SetMatrix(getAssembly()->GetMatrix());
     }
 }
@@ -797,7 +809,7 @@
         if (_atomMapper != NULL) {
              assert(ds->GetPointData() != NULL &&
-                    ds->GetPointData()->GetVectors() != NULL);
+                    ds->GetPointData()->GetArray("_radii") != NULL);
             _atomMapper->SetScaleModeToScaleByMagnitude();
-            _atomMapper->SetScaleArray(vtkDataSetAttributes::VECTORS);
+            _atomMapper->SetScaleArray("_radii");
             _atomMapper->ScalingOn();
         }
@@ -984,7 +996,4 @@
         ;
     }
-    vtkSmartPointer<vtkFloatArray> radii = vtkSmartPointer<vtkFloatArray>::New();
-    radii->SetName("_radii");
-    radii->SetNumberOfComponents(3);
     vtkPolyData *pd = vtkPolyData::SafeDownCast(dataSet);
     if (pd == NULL) {
@@ -992,16 +1001,29 @@
         return;
     }
+    vtkDataArray *array = dataSet->GetPointData()->GetArray("_radii");
+    vtkSmartPointer<vtkFloatArray> radii;
+    if (array == NULL) {
+        radii = vtkSmartPointer<vtkFloatArray>::New();
+        radii->SetName("_radii");
+        radii->SetNumberOfComponents(1);
+        radii->SetNumberOfValues(pd->GetNumberOfPoints());
+    } else {
+        radii = vtkFloatArray::SafeDownCast(array);
+        assert(radii != NULL);
+    }
     for (int i = 0; i < pd->GetNumberOfPoints(); i++) {
-        float tuple[3];
-        tuple[1] = tuple[2] = 0;
+        float value;
         if (elements != NULL && radiusSource != NULL) {
             int elt = (int)elements->GetComponent(i, 0);
-            tuple[0] = radiusSource[elt] * scaleFactor;
+            value = radiusSource[elt] * scaleFactor;
         } else {
-            tuple[0] = scaleFactor;
-        }
-        radii->InsertNextTupleValue(tuple);
-    }
-    dataSet->GetPointData()->SetVectors(radii);
+            value = scaleFactor;
+        }
+        radii->SetValue(i, value);
+    }
+    radii->Modified();
+    if (array == NULL) {
+        dataSet->GetPointData()->AddArray(radii);
+    }
 }
 
Index: trunk/packages/vizservers/vtkvis/Molecule.h
===================================================================
--- trunk/packages/vizservers/vtkvis/Molecule.h	(revision 3778)
+++ trunk/packages/vizservers/vtkvis/Molecule.h	(revision 3795)
@@ -22,4 +22,5 @@
 #include <vtkPointSetToLabelHierarchy.h>
 #include <vtkLabelPlacementMapper.h>
+#include <vtkTransform.h>
 
 #include "ColorMap.h"
@@ -78,4 +79,46 @@
     }
 
+    virtual void setTransform(vtkMatrix4x4 *matrix)
+    {
+        GraphicsObject::setTransform(matrix);
+        updateLabelTransform();
+    }
+
+    virtual void setOrigin(double origin[3])
+    {
+        GraphicsObject::setOrigin(origin);
+        updateLabelTransform();
+    }
+
+    virtual void setOrientation(double quat[4])
+    {
+        GraphicsObject::setOrientation(quat);
+        updateLabelTransform();
+    }
+
+    virtual void setOrientation(double angle, double axis[3])
+    {
+        GraphicsObject::setOrientation(angle, axis);
+        updateLabelTransform();
+    }
+
+    virtual void setPosition(double pos[3])
+    {
+        GraphicsObject::setPosition(pos);
+        updateLabelTransform();
+    }
+
+    virtual void setAspect(double aspect)
+    {
+        GraphicsObject::setAspect(aspect);
+        updateLabelTransform();
+    }
+
+    virtual void setScale(double scale[3])
+    {
+        GraphicsObject::setScale(scale);
+        updateLabelTransform();
+    }
+
     virtual void setDataSet(DataSet *dataSet,
                             Renderer *renderer);
@@ -140,4 +183,6 @@
 
     void setupBondPolyData();
+
+    void updateLabelTransform();
 
     static void addLabelArray(vtkDataSet *dataSet);
@@ -171,4 +216,5 @@
     vtkSmartPointer<vtkPointSetToLabelHierarchy> _labelHierarchy;
     vtkSmartPointer<vtkLabelPlacementMapper> _labelMapper;
+    vtkSmartPointer<vtkTransform> _labelTransform;
 };
 
