Class UnitCell

All Implemented Interfaces:
Cloneable

public class UnitCell extends SimpleUnitCell implements Cloneable
a class pseudoprivate to the org.jmol.symmetry and org.jmol.applet.smarter.FileSymmetry to be accessed generally only through the SymmetryInterface API adds vertices and offsets orientation, and a variety of additional calculations that in principle could be put in SimpleUnitCell if desired, but for now are in this optional package.
  • Field Details

  • Method Details

    • fromOABC

      public static UnitCell fromOABC(T3[] oabc, boolean setRelative)
      A special constructor for spacially defined unit cells. Not used by readers.
      Parameters:
      oabc - [origin, Va, Vb, Vc]
      setRelative - a flag only set true for IsosurfaceMesh
      Returns:
      new unit cell
    • fromParams

      public static UnitCell fromParams(float[] params, boolean setRelative, float slop)
      Parameters:
      params -
      setRelative - only set true for JmolData and tensors
      slop -
      Returns:
      a new unit cell
    • checkDistance

      public boolean checkDistance(P3 f1, P3 f2, float distance, float dx, int iRange, int jRange, int kRange, P3 ptOffset)
      Parameters:
      f1 -
      f2 -
      distance -
      dx -
      iRange -
      jRange -
      kRange -
      ptOffset - TODO
      Returns:
      TRUE if pt has been set.
    • getCanonicalCopyTrimmed

      public P3[] getCanonicalCopyTrimmed(P3 frac, float scale)
    • getConventionalUnitCell

      public T3[] getConventionalUnitCell(String latticeType, M3 primitiveToCrystal)
      return a conventional lattice from a primitive
      Parameters:
      latticeType - "A" "B" "C" "R" etc.
      primitiveToCrystal -
      Returns:
      [origin va vb vc]
    • getTensor

      public Tensor getTensor(Viewer vwr, float[] parBorU)
    • toTrm

      public static M4 toTrm(String transform, M4 trm)
    • getMatrixAndUnitCell

      public static T3[] getMatrixAndUnitCell(SimpleUnitCell uc, Object def, M4 retMatrix)
      Parameters:
      uc - generally this or null
      def - String "abc;offset" or M3d or M4d to origin; if String, can be preceded by ! for "reverse of". For example, "!a-b,-5a-5b,-c;7/8,0,1/8" offset is optional, and can be a definition such as "a=3.40,b=4.30,c=5.02,alpha=90,beta=90,gamma=129"
      retMatrix - if a string, return the 4x4 matrix corresponding to this definition; may be null to ignore
      Returns:
      [origin va vb vc]
    • getF2C

      public float[][] getF2C()
    • toUnitCellRnd

      public final void toUnitCellRnd(T3 pt, T3 offset)
      when offset is null, use the current cell, otherwise use the original unit cell
      Parameters:
      pt -
      offset -
    • createCompatibleUnitCell

      public static boolean createCompatibleUnitCell(SpaceGroup sg, float[] params, float[] newParams, boolean allowSame)
      Create a unit cell compatible with
      Parameters:
      sg -
      params -
      newParams -
      allowSame - true to allow same-distance a,b,c for lower-symmetry sg
      Returns:
      true if changes have occurred
    • isHexagonalSG

      public static boolean isHexagonalSG(int n, float[] params)
    • isMonoclinicSG

      public static boolean isMonoclinicSG(int n)
    • isTetragonalSG

      public static boolean isTetragonalSG(int n)
    • isPolarSG

      public static boolean isPolarSG(int n)