Ejemplo n.º 1
0
 @Override
 protected void setSize(int size, BS bsSelected) {
   if (ms.at == null || size == 0 && ms.atomTensors == null) return;
   boolean isAll = (bsSelected == null);
   if (!isAll && selectedAtoms != null) bsSelected = selectedAtoms;
   Lst<Object> tensors = vwr.ms.getAllAtomTensors(typeSelected);
   if (tensors == null) return;
   Atom[] atoms = ms.at;
   for (int i = tensors.size(); --i >= 0; ) {
     Tensor t = (Tensor) tensors.get(i);
     if (isAll || t.isSelected(bsSelected, -1)) {
       Ellipsoid e = atomEllipsoids.get(t);
       boolean isNew = (size != 0 && e == null);
       if (isNew)
         atomEllipsoids.put(t, e = Ellipsoid.getEllipsoidForAtomTensor(t, atoms[t.atomIndex1]));
       if (e != null && (isNew || size != Integer.MAX_VALUE)) { // MAX_VALUE --> "create only"
         e.setScale(size, true);
       }
     }
   }
 }
Ejemplo n.º 2
0
 private void setProp(Ellipsoid e, int mode, Object value) {
   // "ax ce co de eq mo on op sc tr"
   //  0  1  2  3  4  5  6  7  8  9
   switch (mode) {
     case 0: // axes
       e.setTensor(
           ((Tensor) Interface.getUtil("Tensor", vwr, "script")).setFromAxes((V3[]) value));
       return;
     case 1: // center
       e.setCenter((P3) value);
       return;
     case 2: // color
       e.colix = C.getColixO(value);
       return;
     case 3: // delete
       simpleEllipsoids.remove(e.id);
       return;
     case 4: // equation
       e.setTensor(
           ((Tensor) Interface.getUtil("Tensor", vwr, "script"))
               .setFromThermalEquation((double[]) value, null));
       return;
     case 5: // modelindex
       e.tensor.modelIndex = ((Integer) value).intValue();
       return;
     case 6: // on
       e.isOn = ((Boolean) value).booleanValue();
       return;
     case 7: // options
       e.options = ((String) value).toLowerCase();
       return;
     case 8: // scale
       e.setScale(((Float) value).floatValue(), false);
       return;
     case 9: // translucency
       e.colix = C.getColixTranslucent3(e.colix, value.equals("translucent"), translucentLevel);
       return;
   }
   return;
 }