Package org.jmol.api

Examples of org.jmol.api.SymmetryInterface


      iAtom = bs.nextSetBit(0);
    }
    Object obj = viewer.getShapeProperty(JmolConstants.SHAPE_VECTORS, "mad", iAtom);
    boolean haveVibration = (obj != null && ((Integer) obj).intValue() != 0 || viewer
        .isVibrationOn());
    SymmetryInterface symmetry = (SymmetryInterface) Interface
        .getOptionInterface("symmetry.Symmetry");
    pointGroup = symmetry.setPointGroup(pointGroup, atoms, bs, haveVibration,
        viewer.getPointGroupTolerance(0), viewer.getPointGroupTolerance(1));
    if (!doAll && !asInfo)
      return pointGroup.getPointGroupName();
    Object ret = pointGroup.getPointGroupInfo(modelIndex, asDraw, asInfo, type,
        index, scale);
View Full Code Here


      data = BoxInfo.getCriticalPoints(viewer.getBoundBoxVertices(),
          null);
      iToken = i + 1;
      break;
    case Token.unitcell:
      SymmetryInterface unitCell = viewer.getCurrentUnitCell();
      if (unitCell == null)
        error(ERROR_invalidArgument);
      Point3f[] pts = BoxInfo.getCriticalPoints(unitCell.getUnitCellVertices(),
          unitCell.getCartesianOffset());
      int iType = (int) unitCell.getUnitCellAsArray(JmolConstants.INFO_DIMENSIONS);
      Vector3f v1 = null;
      Vector3f v2 = null;
      switch(iType) {
      case 3:
        break;
View Full Code Here

  public List getPlaneIntersection(int type, Point4f plane, float scale,
                                     int flags, int modelIndex) {
    Point3f[] pts = null;
    switch (type) {
    case Token.unitcell:
      SymmetryInterface uc = getUnitCell(modelIndex);
      if (uc == null)
        return null;
      pts = uc.getCanonicalCopy(scale);
      break;
    case Token.boundbox:
      pts = boxInfo.getCanonicalCopy(scale);
      break;
    }
View Full Code Here

      bs.or(elementsPresent[i]);
    return bs;
  }

  private String getSymmetryInfoAsString(int modelIndex) {
    SymmetryInterface unitCell = getUnitCell(modelIndex);
    return (unitCell == null ? "no symmetry information"
        : unitCell.getSymmetryInfoString());
  }
View Full Code Here

              atomCount)
              : bsSymmetry);
    case Token.unitcell:
      // select UNITCELL (a relative quantity)
      bs = new BitSet();
      SymmetryInterface unitcell = viewer.getCurrentUnitCell();
      if (unitcell == null)
        return bs;
      Point3f cell = new Point3f(1, 1, 1);
      pt = new Point3f();
      for (int i = atomCount; --i >= 0;)
View Full Code Here

    // this is the one method that allows for an absolute fractional cell business
    // but it is always called with isAbsolute FALSE.
    // so then it is determining values for select UNITCELL and the like.
   
    int iModel = atoms[i].modelIndex;
    SymmetryInterface uc = getUnitCell(iModel);
    if (uc == null)
      return false;
    pt.set(atoms[i]);
    uc.toFractional(pt, isAbsolute);
    float slop = 0.02f;
    // {1 1 1} here is the original cell
    if (pt.x < cell.x - 1f - slop || pt.x > cell.x + slop)
      return false;
    if (pt.y < cell.y - 1f - slop || pt.y > cell.y + slop)
View Full Code Here

  public Hashtable getSpaceGroupInfo(int modelIndex, String spaceGroup,
                                     int symOp, Point3f pt1, Point3f pt2, String drawID) {
    String strOperations = null;
    Hashtable info = null;
    SymmetryInterface cellInfo = null;
    Object[][] infolist = null;
    if (spaceGroup == null) {
      if (modelIndex <= 0)
        modelIndex = (pt1 instanceof Atom ? ((Atom) pt1).modelIndex
            : viewer.getCurrentModelIndex());
      if (modelIndex < 0)
        strOperations = "no single current model";
      else if (unitCells == null || unitCells[modelIndex] == null)
        strOperations = "not applicable";
      if (strOperations != null) {
        info = new Hashtable();
        info.put("spaceGroupInfo", strOperations);
        info.put("symmetryInfo", "");
        return info;
      }
      if (pt1 == null && drawID == null && symOp != 0)
        info = (Hashtable) getModelAuxiliaryInfo(modelIndex, "spaceGroupInfo");
      if (info != null)
        return info;
      info = new Hashtable();
      if (pt1 == null && drawID == null && symOp == 0)
        setModelAuxiliaryInfo(modelIndex, "spaceGroupInfo", info);
      cellInfo = unitCells[modelIndex];
      spaceGroup = cellInfo.getSpaceGroupName();
      String[] list = unitCells[modelIndex].getSymmetryOperations();
      if (list == null) {
        strOperations = "\n no symmetry operations employed";
      } else {
        getSymTemp(true);
View Full Code Here

    }
    int iAtom = bsAtoms.nextSetBit(0);
    if (iAtom < 0)
      return "";
    iModel = atoms[iAtom].modelIndex;
    SymmetryInterface uc = getUnitCell(iModel);
    if (uc == null)
      return "";
    if (pt2 != null)
      return getSymmetryOperation(iModel, null, op, pt, pt2,
          (id == null ? "sym" : id), type == Token.label);
    if (xyz == null) {
      String[] ops = uc.getSymmetryOperations();
      if (ops == null || op == 0 || Math.abs(op) > ops.length)
        return "";
      if (op > 0) {
        xyz = ops[op - 1 ];
      } else {
        xyz = ops[-1 - op];
      }
    } else {
      op = 0;
    }
    getSymTemp(false);
    symTemp.setSpaceGroup(false);
    int iSym = symTemp.addSpaceGroupOperation((op < 0 ? "!" : "=") + xyz, Math.abs(op));
    if (iSym < 0)
      return "";
    symTemp.setUnitCell(uc.getNotionalUnitCell());
    Object[] info;
    pt = new Point3f(pt == null ? atoms[iAtom] : pt);
    if (type == Token.point) {
      uc.toFractional(pt, false);
      if (Float.isNaN(pt.x))
        return "";
      Point3f sympt = new Point3f();
      symTemp.newSpaceGroupPoint(iSym, pt, sympt, 0, 0, 0);
      symTemp.toCartesian(sympt, false);
View Full Code Here

    doLocalize = viewer.getUseNumberLocalization();
    render1(mad);
  }

  void render1(int mad) {
    SymmetryInterface symmetry = viewer.getCurrentUnitCell();
    if (symmetry == null || !symmetry.haveUnitCell())
      return;
    isPolymer = symmetry.isPolymer();
    isSlab = symmetry.isSlab();
    Point3f[] vertices = symmetry.getUnitCellVertices();
    Point3f offset = symmetry.getCartesianOffset();
    for (int i = 8; --i >= 0;)
      verticesT[i].add(vertices[i], offset);
    Point3f[] axisPoints = viewer.getAxisPoints();
    boolean drawAllLines = (viewer.getObjectMad(StateManager.OBJ_AXIS1) == 0
        || viewer.getAxesScale() < 2 || axisPoints == null);
   
    render(mad, verticesT, axisPoints, drawAllLines ? 0 : 3);
    if (viewer.getDisplayCellParameters() && !viewer.isPreviewOnly() && !symmetry.isPeriodic())
      renderInfo(symmetry);
  }
View Full Code Here

      originPoint.set(0, 0, 0);
    else
      originPoint.set(fixedOrigin);
    if (axesMode == JmolConstants.AXES_MODE_UNITCELL
        && modelSet.getCellInfos() != null) {
      SymmetryInterface unitcell = viewer.getCurrentUnitCell();
      if (unitcell != null && unitcell.haveUnitCell()) {
        Point3f[] vectors = unitcell.getUnitCellVertices();
        Point3f offset = unitcell.getCartesianOffset();
        if (fixedOrigin == null) {
          originPoint.set(offset);
        } else {
          offset = fixedOrigin;
        }
View Full Code Here

TOP

Related Classes of org.jmol.api.SymmetryInterface

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.