Exemplo n.º 1
0
 private void getStateAtoms(SB sb) {
   BS bsDone = new BS();
   Map<String, BS> temp = new Hashtable<String, BS>();
   Map<String, BS> temp2 = new Hashtable<String, BS>();
   for (Ellipsoid e : atomEllipsoids.values()) {
     int iType = e.tensor.iType;
     if (bsDone.get(iType + 1)) continue;
     bsDone.set(iType + 1);
     boolean isADP = (e.tensor.iType == Tensor.TYPE_ADP);
     String cmd = (isADP ? null : "Ellipsoids set " + PT.esc(e.tensor.type));
     for (Ellipsoid e2 : atomEllipsoids.values()) {
       if (e2.tensor.iType != iType || isADP && !e2.isOn) continue;
       int i = e2.tensor.atomIndex1;
       //
       BSUtil.setMapBitSet(
           temp,
           i,
           i,
           (isADP
               ? "Ellipsoids " + e2.percent
               : cmd
                   + " scale "
                   + e2.scale
                   + (e2.options == null ? "" : " options " + PT.esc(e2.options))
                   + (e2.isOn ? " ON" : " OFF")));
       if (e2.colix != C.INHERIT_ALL)
         BSUtil.setMapBitSet(
             temp2, i, i, getColorCommand(cmd, e2.pid, e2.colix, translucentAllowed));
     }
   }
   sb.append(vwr.getCommands(temp, temp2, "select"));
 }
Exemplo n.º 2
0
 private String getMoState(int modelIndex) {
   strID = getId(modelIndex);
   if (!getSettings(strID)) return "";
   SB s = new SB();
   int modelCount = vwr.getModelCount();
   if (modelCount > 1) appendCmd(s, "frame " + vwr.getModelNumberDotted(modelIndex));
   if (moCutoff != null)
     appendCmd(s, "mo cutoff " + (sg.getIsPositiveOnly() ? "+" : "") + moCutoff);
   if (moScale != null) appendCmd(s, "mo scale " + moScale);
   if (moMonteCarloCount != null)
     appendCmd(s, "mo points " + moMonteCarloCount + " " + moRandomSeed);
   if (moResolution != null) appendCmd(s, "mo resolution " + moResolution);
   if (moPlane != null)
     appendCmd(
         s, "mo plane {" + moPlane.x + " " + moPlane.y + " " + moPlane.z + " " + moPlane.w + "}");
   if (moTitleFormat != null) appendCmd(s, "mo titleFormat " + PT.esc(moTitleFormat));
   // the following is a correct object==object test
   if (moColorNeg != null)
     appendCmd(
         s,
         "mo color "
             + Escape.escapeColor(moColorNeg.intValue())
             + (moColorNeg.equals(moColorPos)
                 ? ""
                 : " " + Escape.escapeColor(moColorPos.intValue())));
   if (moSlab != null) {
     if (thisMesh.slabOptions != null) appendCmd(s, thisMesh.slabOptions.toString());
     if (thisMesh.jvxlData.slabValue != Integer.MIN_VALUE)
       appendCmd(s, "mo slab " + thisMesh.jvxlData.slabValue);
   }
   if (moLinearCombination == null) {
     appendCmd(s, "mo " + (moSquareData == Boolean.TRUE ? "squared " : "") + moNumber);
   } else {
     appendCmd(
         s,
         "mo "
             + QS.getMOString(moLinearCombination)
             + (moSquareLinear == Boolean.TRUE ? " squared" : ""));
   }
   if (moTranslucency != null) appendCmd(s, "mo translucent " + moTranslucentLevel);
   appendCmd(s, ((IsosurfaceMesh) thisModel.get("mesh")).getState("mo"));
   return s.toString();
 }
Exemplo n.º 3
0
 private void getStateID(SB sb) {
   V3 v1 = new V3();
   for (Ellipsoid ellipsoid : simpleEllipsoids.values()) {
     Tensor t = ellipsoid.tensor;
     if (!ellipsoid.isValid || t == null) continue;
     sb.append("  Ellipsoid ID ")
         .append(ellipsoid.id)
         .append(" modelIndex ")
         .appendI(t.modelIndex)
         .append(" center ")
         .append(Escape.eP(ellipsoid.center))
         .append(" axes");
     for (int i = 0; i < 3; i++) {
       v1.setT(t.eigenVectors[i]);
       v1.scale(ellipsoid.lengths[i]);
       sb.append(" ").append(Escape.eP(v1));
     }
     sb.append(" " + getColorCommandUnk("", ellipsoid.colix, translucentAllowed));
     if (ellipsoid.options != null) sb.append(" options ").append(PT.esc(ellipsoid.options));
     if (!ellipsoid.isOn) sb.append(" off");
     sb.append(";\n");
   }
 }