示例#1
0
文件: Hover.java 项目: mrG7/gmol
 @Override
 public String getShapeState() {
   Map<String, BitSet> temp = new Hashtable<String, BitSet>();
   if (atomFormats != null)
     for (int i = viewer.getAtomCount(); --i >= 0; )
       if (atomFormats[i] != null)
         setStateInfo(temp, i, "set hoverLabel " + Escape.escapeStr(atomFormats[i]));
   return "\n  hover "
       + Escape.escapeStr((labelFormat == null ? "" : labelFormat))
       + ";\n"
       + getShapeCommands(temp, null);
 }
示例#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();
 }
示例#3
0
 @Override
 public String getShapeState() {
   StringBuffer sb = new StringBuffer();
   sb.append("  axes scale ").append(viewer.getAxesScale()).append(";\n");
   if (fixedOrigin != null)
     sb.append("  axes center ").append(Escape.escape(fixedOrigin)).append(";\n");
   if (axisXY.z != 0)
     sb.append("  axes position [")
         .append((int) axisXY.x)
         .append(" ")
         .append((int) axisXY.y)
         .append(" ")
         .append(axisXY.z < 0 ? " %" : "")
         .append("];\n");
   if (labels != null) {
     sb.append("  axes labels ");
     for (int i = 0; i < labels.length; i++) sb.append(Escape.escape(labels[i])).append(" ");
     sb.append(";\n");
   }
   return super.getShapeState() + sb;
 }
 private void loadFiles(List<File> fileList) {
   StringBuffer sb = new StringBuffer();
   for (int i = 0; i < fileList.size(); ++i) {
     File f = fileList.get(i);
     String fname = f.getAbsolutePath();
     fname = fname.replace('\\', '/').trim();
     fname = (fname.startsWith("/") ? "file://" : "file:///") + fname;
     sb.append("load ").append(i == 0 ? "" : "APPEND ").append(Escape.escape(fname)).append(";\n");
   }
   sb.append("frame *;reset;");
   viewer.script(sb.toString());
 }
示例#5
0
 /**
  * legacy -- for some scripts with early isosurface slabbing
  *
  * @param s
  * @param isCap
  * @return slabInfo object
  */
 public static Object[] getCapSlabObject(String s, boolean isCap) {
   try {
     if (s.indexOf("array") == 0) {
       String[] pts = PT.split(s.substring(6, s.length() - 1), ",");
       return TempArray.getSlabObjectType(
           T.boundbox,
           new P3[] {
             (P3) Escape.uP(pts[0]),
             (P3) Escape.uP(pts[1]),
             (P3) Escape.uP(pts[2]),
             (P3) Escape.uP(pts[3])
           },
           isCap,
           null);
     }
     Object plane = Escape.uP(s);
     if (plane instanceof P4) return TempArray.getSlabObjectType(T.plane, plane, isCap, null);
   } catch (Exception e) {
     //
   }
   return null;
 }
示例#6
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");
   }
 }
示例#7
0
 public String getShapeState() {
   if (!isValid) return "";
   StringBuffer s = new StringBuffer();
   s.append("dipole ID ").append(thisID);
   if (haveAtoms)
     s.append(" ({")
         .append(atoms[0].getAtomIndex())
         .append(" ")
         .append(atoms[1].getAtomIndex())
         .append("})");
   else if (coords[0] == null) return "";
   else
     s.append(" ").append(Escape.escape(coords[0])).append(" ").append(Escape.escape(coords[1]));
   if (isUserValue) s.append(" value ").append(dipoleValue);
   if (mad != Dipoles.DEFAULT_MAD) s.append(" width ").append(mad / 1000f);
   if (offsetAngstroms != 0) s.append(" offset ").append(offsetAngstroms);
   else if (offsetPercent != 0) s.append(" offset ").append(offsetPercent);
   if (offsetSide != Dipoles.DEFAULT_OFFSETSIDE) s.append(" offsetSide ").append(offsetSide);
   if (noCross) s.append(" nocross");
   if (!visible) s.append(" off");
   s.append(";\n");
   return s.toString();
 }
示例#8
0
文件: JmolData.java 项目: mrG7/gmol
 public static void main(String[] args) {
   // note that -o-x are implied, but -n is not.
   // in this case -n means "no GRAPHICS" for speed
   JmolApp jmolApp = new JmolApp();
   jmolApp.isDataOnly = true;
   jmolApp.haveConsole = false;
   // jmolApp.haveDisplay = false;
   jmolApp.info.put("exit", Boolean.TRUE);
   jmolApp.parseCommandLine(args);
   if (!jmolApp.isSilent) {
     System.out.println("JmolData using command options " + Escape.escape(args));
     if (!jmolApp.info.containsKey("noGraphics"))
       System.out.println(
           "Add -n (NOGRAPHICS) for faster performance if you are not creating images.");
   }
   new JmolData(jmolApp);
 }
 protected void jvxlDecodeContourData(JvxlData jvxlData, String data) throws Exception {
   List<List<Object>> vs = new List<List<Object>>();
   SB values = new SB();
   SB colors = new SB();
   int pt = -1;
   jvxlData.vContours = null;
   if (data == null) return;
   while ((pt = data.indexOf("<jvxlContour", pt + 1)) >= 0) {
     List<Object> v = new List<Object>();
     String s = xr.getXmlData("jvxlContour", data.substring(pt), true, false);
     float value = parseFloatStr(XmlReader.getXmlAttrib(s, "value"));
     values.append(" ").appendF(value);
     int color = getColor(XmlReader.getXmlAttrib(s, "color"));
     short colix = C.getColix(color);
     colors.append(" ").append(Escape.escapeColor(color));
     String fData = JvxlCoder.jvxlDecompressString(XmlReader.getXmlAttrib(s, "data"));
     BS bs = JvxlCoder.jvxlDecodeBitSet(xr.getXmlData("jvxlContour", s, false, false));
     int n = bs.length();
     IsosurfaceMesh.setContourVector(v, n, bs, value, colix, color, SB.newS(fData));
     vs.addLast(v);
   }
   int n = vs.size();
   if (n > 0) {
     jvxlData.vContours = AU.createArrayOfArrayList(n);
     // 3D contour values and colors
     jvxlData.contourColixes = params.contourColixes = new short[n];
     jvxlData.contourValues = params.contoursDiscrete = new float[n];
     for (int i = 0; i < n; i++) {
       jvxlData.vContours[i] = vs.get(i);
       jvxlData.contourValues[i] = ((Float) jvxlData.vContours[i].get(2)).floatValue();
       jvxlData.contourColixes[i] = ((short[]) jvxlData.vContours[i].get(3))[0];
     }
     jvxlData.contourColors = C.getHexCodes(jvxlData.contourColixes);
     Logger.info("JVXL read: " + n + " discrete contours");
     Logger.info("JVXL read: contour values: " + values);
     Logger.info("JVXL read: contour colors: " + colors);
   }
 }
示例#10
0
  protected void jvxlReadSurfaceInfo() throws Exception {
    String s;
    String data = xr.getXmlData("jvxlSurfaceInfo", null, true, true);
    isXLowToHigh = XmlReader.getXmlAttrib(data, "isXLowToHigh").equals("true");
    jvxlCutoff = parseFloatStr(XmlReader.getXmlAttrib(data, "cutoff"));
    if (!Float.isNaN(jvxlCutoff)) Logger.info("JVXL read: cutoff " + jvxlCutoff);
    int nContourData = parseIntStr(XmlReader.getXmlAttrib(data, "nContourData"));
    haveContourData = (nContourData > 0);
    params.isContoured = XmlReader.getXmlAttrib(data, "contoured").equals("true");
    if (params.isContoured) {
      int nContoursRead = parseIntStr(XmlReader.getXmlAttrib(data, "nContours"));
      if (nContoursRead <= 0) {
        nContoursRead = 0;
      } else {
        s = XmlReader.getXmlAttrib(data, "contourValues");
        if (s.length() > 0) {
          jvxlData.contourValues = params.contoursDiscrete = parseFloatArrayStr(s);
          Logger.info("JVXL read: contourValues " + Escape.eAF(jvxlData.contourValues));
        }
        s = XmlReader.getXmlAttrib(data, "contourColors");
        if (s.length() > 0) {
          jvxlData.contourColixes = params.contourColixes = C.getColixArray(s);
          jvxlData.contourColors = C.getHexCodes(jvxlData.contourColixes);
          Logger.info("JVXL read: contourColixes " + C.getHexCodes(jvxlData.contourColixes));
        }
        params.contourFromZero = XmlReader.getXmlAttrib(data, "contourFromZero").equals("true");
      }
      params.nContours = (haveContourData ? nContourData : nContoursRead);
      // TODO ? params.contourFromZero = false; // MEP data to complete the plane
    }
    jvxlData.nVertexColors = parseIntStr(XmlReader.getXmlAttrib(data, "nVertexColors"));
    params.isBicolorMap = XmlReader.getXmlAttrib(data, "bicolorMap").equals("true");
    if (params.isBicolorMap) {
      // TODO -- not quite right, because
      s = XmlReader.getXmlAttrib(data, "colorPositive");
      if (s.length() > 0
          && params.colorRgb == Integer.MIN_VALUE
          && params.colorPos == Parameters.defaultColorPositive)
        params.colorPos = CU.getArgbFromString(s);
      s = XmlReader.getXmlAttrib(data, "colorNegative");
      if (s.length() > 0
          && params.colorRgb == Integer.MIN_VALUE
          && params.colorNeg == Parameters.defaultColorNegative)
        params.colorNeg = CU.getArgbFromString(s);
    }
    if (params.isBicolorMap || params.colorBySign) jvxlCutoff = 0;
    jvxlDataIsColorMapped =
        ((params.colorRgb == Integer.MIN_VALUE || params.colorRgb == Integer.MAX_VALUE)
            && (params.isBicolorMap || XmlReader.getXmlAttrib(data, "colorMapped").equals("true")));
    // isJvxlPrecisionColor is for information only -- will be superceded by encoding attribute of
    // jvxlColorData
    jvxlData.isJvxlPrecisionColor = XmlReader.getXmlAttrib(data, "precisionColor").equals("true");
    jvxlData.jvxlDataIsColorDensity =
        params.colorDensity =
            (params.colorRgb == Integer.MIN_VALUE
                && XmlReader.getXmlAttrib(data, "colorDensity").equals("true"));
    if (jvxlData.jvxlDataIsColorDensity && Float.isNaN(params.pointSize)) {
      s = XmlReader.getXmlAttrib(data, "pointSize");
      if (s.length() > 0) jvxlData.pointSize = params.pointSize = parseFloatStr(s);
    }
    s = XmlReader.getXmlAttrib(data, "allowVolumeRender");
    jvxlData.allowVolumeRender =
        params.allowVolumeRender = (s.length() == 0 || s.equalsIgnoreCase("true"));
    s = XmlReader.getXmlAttrib(data, "plane");
    if (s.indexOf("{") >= 0) {
      params.thePlane = null;
      params.mapLattice = null;
      try {
        params.thePlane = (P4) Escape.uP(s);
        s = XmlReader.getXmlAttrib(data, "maplattice");
        Logger.info("JVXL read: plane " + params.thePlane);
        if (s.indexOf("{") >= 0) {
          params.mapLattice = (P3) Escape.uP(s);
          Logger.info("JVXL read: mapLattice " + params.mapLattice);
        }
        if (params.scale3d == 0)
          params.scale3d = parseFloatStr(XmlReader.getXmlAttrib(data, "scale3d"));
        if (Float.isNaN(params.scale3d)) params.scale3d = 0;
      } catch (Exception e) {
        if (params.thePlane == null) {
          Logger.error("JVXL Error reading plane definition -- setting to 0 0 1 0  (z=0)");
          params.thePlane = P4.new4(0, 0, 1, 0);
        } else {
          Logger.error("JVXL Error reading mapLattice definition -- ignored");
        }
      }
      surfaceDataCount = 0;
      edgeDataCount = 0;
    } else {
      params.thePlane = null;
      surfaceDataCount = parseIntStr(XmlReader.getXmlAttrib(data, "nSurfaceInts"));
      edgeDataCount = parseIntStr(XmlReader.getXmlAttrib(data, "nBytesUncompressedEdgeData"));
    }
    excludedVertexCount = parseIntStr(XmlReader.getXmlAttrib(data, "nExcludedVertexes"));
    excludedTriangleCount = parseIntStr(XmlReader.getXmlAttrib(data, "nExcludedTriangles"));
    invalidatedVertexCount = parseIntStr(XmlReader.getXmlAttrib(data, "nInvalidatedVertexes"));
    s = XmlReader.getXmlAttrib(data, "slabInfo");
    if (s.length() > 0) jvxlData.slabInfo = s;
    colorDataCount =
        Math.max(0, parseIntStr(XmlReader.getXmlAttrib(data, "nBytesUncompressedColorData")));
    jvxlDataIs2dContour = (params.thePlane != null && jvxlDataIsColorMapped);

    // new Jmol 12.1.50
    jvxlData.color = XmlReader.getXmlAttrib(data, "color");
    if (jvxlData.color.length() == 0 || jvxlData.color.indexOf("null") >= 0)
      jvxlData.color = "orange";
    jvxlData.translucency = parseFloatStr(XmlReader.getXmlAttrib(data, "translucency"));
    if (Float.isNaN(jvxlData.translucency)) jvxlData.translucency = 0;
    s = XmlReader.getXmlAttrib(data, "meshColor");
    if (s.length() > 0) jvxlData.meshColor = s;
    s = XmlReader.getXmlAttrib(data, "rendering");
    if (s.length() > 0) jvxlData.rendering = s;
    jvxlData.colorScheme = XmlReader.getXmlAttrib(data, "colorScheme");
    if (jvxlData.colorScheme.length() == 0) jvxlData.colorScheme = null;
    if (jvxlData.thisSet < 0) {
      int n = parseIntStr(XmlReader.getXmlAttrib(data, "set"));
      if (n > 0) jvxlData.thisSet = n - 1;
    }
    jvxlData.slabValue = parseIntStr(XmlReader.getXmlAttrib(data, "slabValue"));
    jvxlData.isSlabbable = (XmlReader.getXmlAttrib(data, "slabbable").equalsIgnoreCase("true"));
    jvxlData.diameter = parseIntStr(XmlReader.getXmlAttrib(data, "diameter"));
    if (jvxlData.diameter == Integer.MIN_VALUE) jvxlData.diameter = 0;

    if (jvxlDataIs2dContour) params.isContoured = true;

    if (params.colorBySign) params.isBicolorMap = true;
    boolean insideOut = XmlReader.getXmlAttrib(data, "insideOut").equals("true");
    float dataMin = Float.NaN;
    float dataMax = Float.NaN;
    float red = Float.NaN;
    float blue = Float.NaN;
    if (jvxlDataIsColorMapped) {
      dataMin = parseFloatStr(XmlReader.getXmlAttrib(data, "dataMinimum"));
      dataMax = parseFloatStr(XmlReader.getXmlAttrib(data, "dataMaximum"));
      red = parseFloatStr(XmlReader.getXmlAttrib(data, "valueMappedToRed"));
      blue = parseFloatStr(XmlReader.getXmlAttrib(data, "valueMappedToBlue"));
      if (Float.isNaN(dataMin)) {
        dataMin = red = -1f;
        dataMax = blue = 1f;
      }
    }
    jvxlSetColorRanges(dataMin, dataMax, red, blue, insideOut);
  }
示例#11
0
  public boolean slabPolygons(Object[] slabObject, boolean allowCap) {
    if (polygonCount0 < 0) return false; // disabled for some surface types
    int slabType = ((Integer) slabObject[0]).intValue();
    if (slabType == T.none || slabType == T.brillouin) {
      if (bsSlabDisplay != null && (polygonCount0 != 0 || vertexCount0 != 0)) {
        pc = polygonCount0;
        vc = vertexCount0;
        polygonCount0 = vertexCount0 = 0;
        normixCount = (isTriangleSet ? pc : vc);
        bsSlabDisplay.setBits(0, (pc == 0 ? vc : pc));
        slabOptions = new SB().append(meshType + " slab none");
        bsSlabGhost = null;
        slabMeshType = T.none;
      }
      if (slabType == T.none) return false;
    }
    Object slabbingObject = slabObject[1];
    boolean andCap = ((Boolean) slabObject[2]).booleanValue() && !(slabType == T.brillouin);
    if (andCap && !allowCap) return false;
    Object[] colorData = (Object[]) slabObject[3];
    boolean isGhost = (colorData != null);
    if (bsSlabDisplay == null || polygonCount0 == 0 && vertexCount0 == 0) {
      polygonCount0 = pc;
      vertexCount0 = vc;
      bsSlabDisplay = BSUtil.setAll(pc == 0 ? vc : pc);
      bsSlabGhost = null;
      if (pc == 0 && vc == 0) return false;
    } else if (isMerged) {
      if (pc == 0) bsSlabDisplay.setBits(mergeVertexCount0, vc);
      else bsSlabDisplay.setBits(mergePolygonCount0, pc);
    }

    if (isGhost) {
      if (bsSlabGhost == null) bsSlabGhost = new BS();
      slabMeshType = ((Integer) colorData[0]).intValue();
      slabColix = ((Short) colorData[1]).shortValue();
      // if (C.isColixColorInherited(slabColix))
      // slabColix = C.copyColixTranslucency(slabColix, colix);
      andCap = false;
      colix = C.getColixTranslucent3(colix, false, 0);
    }

    SB sb = new SB();
    sb.append(andCap ? " cap " : " slab ");
    if (isGhost) {
      sb.append("translucent ").appendF(C.getColixTranslucencyFractional(slabColix)).append(" ");
      String s = C.getHexCode(slabColix);
      if (s != null) sb.append(s).append(" ");
      if (slabMeshType == T.mesh) sb.append("mesh ");
    }
    switch (slabType) {
      case T.brillouin:
        sb.append("brillouin");
        slabBrillouin((P3[]) slabbingObject);
        break;
      case T.decimal:
        getIntersection(
            0,
            null,
            null,
            null,
            null,
            (BS) slabbingObject,
            null,
            andCap,
            false,
            T.decimal,
            isGhost);
        break;
      case T.plane:
        P4 plane = (P4) slabbingObject;
        sb.append(Escape.eP4(plane));
        getIntersection(0, plane, null, null, null, null, null, andCap, false, T.plane, isGhost);
        break;
      case T.unitcell:
      case T.boundbox:
        P3[] box = (P3[]) slabbingObject;
        sb.append("within ").append(Escape.eAP(box));
        P4[] faces = BoxInfo.getFacesFromCriticalPoints(box);
        for (int i = 0; i < faces.length; i++) {
          getIntersection(
              0, faces[i], null, null, null, null, null, andCap, false, T.plane, isGhost);
        }
        break;
      case T.data:
        getIntersection(
            0,
            null,
            null,
            null,
            (float[]) slabbingObject,
            null,
            null,
            false,
            false,
            T.min,
            isGhost);
        break;
      case T.within:
      case T.range:
      case T.mesh:
        Object[] o = (Object[]) slabbingObject;
        float distance = ((Float) o[0]).floatValue();
        switch (slabType) {
          case T.within:
            P3[] points = (P3[]) o[1];
            BS bs = (BS) o[2];
            sb.append("within ")
                .appendF(distance)
                .append(bs == null ? Escape.e(points) : Escape.e(bs));
            getIntersection(
                distance,
                null,
                points,
                null,
                null,
                null,
                null,
                andCap,
                false,
                (distance > 0 ? T.distance : T.sphere),
                isGhost);
            break;
          case T.range:
            // isosurface slab within range x.x y.y
            // if y.y < x.x then this effectively means "NOT within range y.y x.x"
            if (vvs == null) return false;
            float distanceMax = ((Float) o[1]).floatValue();
            sb.append("within range ").appendF(distance).append(" ").appendF(distanceMax);
            bs = (distanceMax < distance ? BSUtil.copy(bsSlabDisplay) : null);
            getIntersection(
                distance, null, null, null, null, null, null, andCap, false, T.min, isGhost);
            BS bsA = (bs == null ? null : BSUtil.copy(bsSlabDisplay));
            BSUtil.copy2(bs, bsSlabDisplay);
            getIntersection(
                distanceMax, null, null, null, null, null, null, andCap, false, T.max, isGhost);
            if (bsA != null) bsSlabDisplay.or(bsA);
            break;
          case T.mesh:
            // NOT IMPLEMENTED
            MeshSurface mesh = (MeshSurface) o[1];
            // distance = -1;
            getIntersection(
                0,
                null,
                null,
                null,
                null,
                null,
                mesh,
                andCap,
                false,
                distance < 0 ? T.min : T.max,
                isGhost);
            // TODO: unresolved how exactly to store this in the state
            // -- must indicate exact set of triangles to slab and how!
            break;
        }
        break;
    }
    String newOptions = sb.toString();
    if (slabOptions == null) slabOptions = new SB();
    if (slabOptions.indexOf(newOptions) < 0)
      slabOptions.append(slabOptions.length() > 0 ? "; " : "").append(meshType).append(newOptions);
    return true;
  }
示例#12
0
  boolean createIsosurface(boolean justForPlane) {
    resetIsosurface();
    jvxlData.cutoff = Float.NaN;
    if (!readAndSetVolumeParameters(justForPlane)) return false;
    if (!justForPlane && !Float.isNaN(params.sigma) && !allowSigma) {
      if (params.sigma > 0)
        Logger.error("Reader does not support SIGMA option -- using cutoff 1.6");
      params.cutoff = 1.6f;
    }
    // negative sigma just ignores the error message
    // and means it was inserted by Jmol as a default option
    if (params.sigma < 0) params.sigma = -params.sigma;
    nPointsX = voxelCounts[0];
    nPointsY = voxelCounts[1];
    nPointsZ = voxelCounts[2];
    jvxlData.isSlabbable = ((params.dataType & Parameters.IS_SLABBABLE) != 0);
    jvxlData.insideOut = params.insideOut;
    jvxlData.dataXYReversed = params.dataXYReversed;
    jvxlData.isBicolorMap = params.isBicolorMap;
    jvxlData.nPointsX = nPointsX;
    jvxlData.nPointsY = nPointsY;
    jvxlData.nPointsZ = nPointsZ;
    jvxlData.jvxlVolumeDataXml = volumeData.xmlData;
    jvxlData.voxelVolume = volumeData.voxelVolume;
    if (justForPlane) {
      // float[][][] voxelDataTemp =  volumeData.voxelData;
      volumeData.setMappingPlane(params.thePlane);
      // volumeData.setDataDistanceToPlane(params.thePlane);
      if (meshDataServer != null)
        meshDataServer.fillMeshData(meshData, MeshData.MODE_GET_VERTICES, null);
      params.setMapRanges(this, false);
      generateSurfaceData();
      volumeData.setMappingPlane(null);

      // if (volumeData != null)
      //  volumeData.voxelData = voxelDataTemp;
    } else {
      if (!readVolumeData(false)) return false;
      generateSurfaceData();
    }
    if (jvxlFileHeaderBuffer != null) {
      String s = jvxlFileHeaderBuffer.toString();
      int i = s.indexOf('\n', s.indexOf('\n', s.indexOf('\n') + 1) + 1) + 1;
      jvxlData.jvxlFileTitle = s.substring(0, i);
    }
    if (params.contactPair == null) setBoundingBox();
    if (!params.isSilent)
      Logger.info("boundbox corners " + Escape.escape(xyzMin) + " " + Escape.escape(xyzMax));
    jvxlData.boundingBox = new Point3f[] {xyzMin, xyzMax};
    jvxlData.dataMin = dataMin;
    jvxlData.dataMax = dataMax;
    jvxlData.cutoff = (isJvxl ? jvxlCutoff : params.cutoff);
    jvxlData.isCutoffAbsolute = params.isCutoffAbsolute;
    jvxlData.pointsPerAngstrom = 1f / volumeData.volumetricVectorLengths[0];
    jvxlData.jvxlColorData = "";
    jvxlData.jvxlPlane = params.thePlane;
    jvxlData.jvxlEdgeData = edgeData;
    jvxlData.isBicolorMap = params.isBicolorMap;
    jvxlData.isContoured = params.isContoured;
    jvxlData.colorDensity = params.colorDensity;
    if (jvxlData.vContours != null) params.nContours = jvxlData.vContours.length;
    jvxlData.nContours = (params.contourFromZero ? params.nContours : -1 - params.nContours);
    jvxlData.nEdges = edgeCount;
    jvxlData.edgeFractionBase = edgeFractionBase;
    jvxlData.edgeFractionRange = edgeFractionRange;
    jvxlData.colorFractionBase = colorFractionBase;
    jvxlData.colorFractionRange = colorFractionRange;
    jvxlData.jvxlDataIs2dContour = jvxlDataIs2dContour;
    jvxlData.jvxlDataIsColorMapped = jvxlDataIsColorMapped;
    jvxlData.jvxlDataIsColorDensity = jvxlDataIsColorDensity;
    jvxlData.isXLowToHigh = isXLowToHigh;
    jvxlData.vertexDataOnly = vertexDataOnly;
    jvxlData.saveVertexCount = 0;

    if (jvxlDataIsColorMapped || jvxlData.nVertexColors > 0) {
      if (meshDataServer != null) {
        meshDataServer.fillMeshData(meshData, MeshData.MODE_GET_VERTICES, null);
        meshDataServer.fillMeshData(meshData, MeshData.MODE_GET_COLOR_INDEXES, null);
      }
      jvxlData.jvxlColorData = readColorData();
      updateSurfaceData();
      if (meshDataServer != null) meshDataServer.notifySurfaceMappingCompleted();
    }
    return true;
  }