Class UnitCell

  • All Implemented Interfaces:
    Cloneable

    class UnitCell
    extends SimpleUnitCell
    implements Cloneable
    a class private to the org.jmol.symmetry package to be accessed 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 Detail

      • vertices

        private javajs.util.P3[] vertices
      • fractionalOffset

        private javajs.util.P3 fractionalOffset
      • allFractionalRelative

        private boolean allFractionalRelative
        this flag TRUE causes an update of matrixCtoFNoOffset each time an offset is changed so that it is updated and the two stay the same; set true only for JmolData, tensors, and isosurfaceMesh it is no longer clear to me exactly why this is necessary, and perhaps it is not for some of these
      • cartesianOffset

        protected final javajs.util.P3 cartesianOffset
      • unitCellMultiplier

        protected javajs.util.T3 unitCellMultiplier
      • moreInfo

        public javajs.util.Lst<String> moreInfo
      • unitVectors

        private static final javajs.util.V3[] unitVectors
    • Constructor Detail

      • UnitCell

        private UnitCell()
    • Method Detail

      • fromOABC

        static UnitCell fromOABC​(javajs.util.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)
        Parameters:
        params -
        setRelative - only set true for JmolData and tensors
        Returns:
        a new unit cell
      • initOrientation

        void initOrientation​(javajs.util.M3 mat)
      • toUnitCell

        final void toUnitCell​(javajs.util.T3 pt,
                              javajs.util.T3 offset)
        when offset is null, use the current cell, otherwise use the original unit cell
        Parameters:
        pt -
        offset -
      • unitize

        public void unitize​(javajs.util.T3 pt)
        returns [0,1)
        Parameters:
        pt -
      • reset

        public void reset()
      • setOffset

        void setOffset​(javajs.util.T3 pt)
      • setCartesianOffset

        private void setCartesianOffset​(javajs.util.T3 origin)
      • dumpInfo

        String dumpInfo​(boolean isFull)
      • getVertices

        javajs.util.P3[] getVertices()
      • getCartesianOffset

        javajs.util.P3 getCartesianOffset()
      • getFractionalOffset

        javajs.util.P3 getFractionalOffset()
      • getTensor

        Tensor getTensor​(Viewer vwr,
                         float[] parBorU)
      • getCanonicalCopy

        javajs.util.P3[] getCanonicalCopy​(float scale,
                                          boolean withOffset)
        Parameters:
        scale -
        withOffset -
        Returns:
        points in Triangulator order
      • toFractionalX

        private static float toFractionalX​(float x)
      • initUnitcellVertices

        private void initUnitcellVertices()
      • checkDistance

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

        public javajs.util.T3 getUnitCellMultiplier()
      • getUnitCellVectors

        public javajs.util.P3[] getUnitCellVectors()
      • fix

        private float fix​(float x)
      • isSameAs

        public boolean isSameAs​(UnitCell uc)
      • hasOffset

        public boolean hasOffset()
      • getState

        public String getState()
      • getQuaternionRotation

        public javajs.util.Quat getQuaternionRotation​(String abc)
        Returns a quaternion that will take the standard frame to a view down a particular axis, expressed as its counterparts.
        Parameters:
        abc - ab bc ca
        Returns:
        quaternion
      • getV0abc

        public javajs.util.T3[] getV0abc​(Object def)
        Parameters:
        def - String "abc;offset" or M3 or M4 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"
        Returns:
        [origin va vb vc]
      • toFromPrimitive

        public boolean toFromPrimitive​(boolean toPrimitive,
                                       char type,
                                       javajs.util.T3[] uc,
                                       javajs.util.M3 primitiveToCrystal)
        Parameters:
        toPrimitive - or assumed conventional
        type - P, R, A, B, C, I(BCC), or F(FCC)
        uc - either [origin, va, vb, vc] or just [va, vb, vc]
        primitiveToCrystal -
        Returns:
        true if successful
      • getConventionalUnitCell

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