private static Matrix4d flipZ() { Matrix4d rot = new Matrix4d(); rot.m00 = -1; rot.m11 = -1; rot.m22 = 1; rot.m33 = 1; return rot; }
private static Matrix4d flipX() { Matrix4d rot = new Matrix4d(); rot.m00 = 1; rot.m11 = -1; rot.m22 = -1; rot.m33 = 1; return rot; }
/** * Default Constructor */ public BiologicalAssemblyTransformation() { // we initialize to identity so that setting rotation and translation work properly transformation = new Matrix4d(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1); }
private static Matrix4d flipY() { Matrix4d rot = new Matrix4d(); rot.m00 = -1; rot.m11 = 1; rot.m22 = -1; rot.m33 = 1; return rot; }
private static Matrix4d flipZ() { Matrix4d rot = new Matrix4d(); rot.m00 = -1; rot.m11 = -1; rot.m22 = 1; rot.m33 = 1; return rot; }
private static Matrix4d flipX() { Matrix4d rot = new Matrix4d(); rot.m00 = 1; rot.m11 = -1; rot.m22 = -1; rot.m33 = 1; return rot; }
private static Matrix4d flipY() { Matrix4d rot = new Matrix4d(); rot.m00 = -1; rot.m11 = 1; rot.m22 = -1; rot.m33 = 1; return rot; }
/** * Copy constructor * @param transform */ public CrystalTransform(CrystalTransform transform) { this.sg = transform.sg; this.transformId = transform.transformId; this.matTransform = new Matrix4d(transform.matTransform); this.crystalTranslation = new Point3i(transform.crystalTranslation); }
/** * Tells whether this transformation is in identity. * @return */ public boolean isIdentity() { return transformation.epsilonEquals(new Matrix4d(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1), 0.00000000001); }
public static Matrix4d parseMatrix4d(Node node) { Matrix4d m = new Matrix4d(); NamedNodeMap atts = node.getAttributes(); for (int x=0; x<4; x++){ for (int y=0; y<4; y++){ String key = "mat"+(x+1)+(y+1); String value = atts.getNamedItem(key).getTextContent(); m.setElement(x, y, new Double(value)); } } return m; }
public void scale(double x, double y, double z) { Matrix4d matrix = this.matrixStack.peek(); Matrix4d scale = new Matrix4d(); scale.m00 = x; scale.m11 = y; scale.m22 = z; scale.m33 = 1; matrix.mul(scale); }
/** * Copy Constructor * * @param src */ public BiologicalAssemblyTransformation(final BiologicalAssemblyTransformation src) { this.transformation = new Matrix4d(src.transformation); this.id = src.getId(); this.chainId = src.getChainId(); }
public void translate(double x, double y, double z) { Matrix4d matrix = this.matrixStack.peek(); Matrix4d translation = new Matrix4d(); translation.setIdentity(); translation.setTranslation(new Vector3d(x, y, z)); matrix.mul(translation); }
private Matrix4d reorientHelix(int index) { Matrix4d matrix = new Matrix4d(); matrix.setIdentity(); matrix.setRotation(new AxisAngle4d(1,0,0,Math.PI/2*(index+1))); matrix.mul(transformationMatrix); return matrix; }
@Override public Matrix4d getGeometicCenterTransformation() { run(); Matrix4d geometricCentered = new Matrix4d(reverseTransformationMatrix); geometricCentered.setTranslation(new Vector3d(getGeometricCenter())); return geometricCentered; }
/** * Returns a transformation matrix transform polyhedra for Cn structures. * The center in this matrix is the geometric center, rather then the centroid. * In Cn structures those are usually not the same. * @return */ @Override public Matrix4d getGeometicCenterTransformation() { run(); Matrix4d geometricCentered = new Matrix4d(reverseTransformationMatrix); geometricCentered.setTranslation(new Vector3d(getGeometricCenter())); return geometricCentered; }
private void addEOperation() { List<Integer> permutation = Arrays.asList(new Integer[]{0,1}); Matrix4d transformation = new Matrix4d(); transformation.setIdentity(); combineWithTranslation(transformation); AxisAngle4d axisAngle = new AxisAngle4d(); QuatSymmetryScores scores = new QuatSymmetryScores(); int fold = 1; // ?? Rotation rotation = createSymmetryOperation(permutation, transformation, axisAngle, fold, scores); rotations.addRotation(rotation); }
private Rotation createSymmetryOperation(List<Integer> permutation, Matrix4d transformation, AxisAngle4d axisAngle, int fold, QuatSymmetryScores scores) { Rotation s = new Rotation(); s.setPermutation(new ArrayList<Integer>(permutation)); s.setTransformation(new Matrix4d(transformation)); s.setAxisAngle(new AxisAngle4d(axisAngle)); s.setFold(fold); s.setScores(scores); return s; }
private Rotation createSymmetryOperation(List<Integer> permutation, Matrix4d transformation, AxisAngle4d axisAngle, int fold, QuatSymmetryScores scores) { Rotation s = new Rotation(); s.setPermutation(new ArrayList<Integer>(permutation)); s.setTransformation(new Matrix4d(transformation)); s.setAxisAngle(new AxisAngle4d(axisAngle)); s.setFold(fold); s.setScores(scores); return s; }
private static Rotation createSymmetryOperation(List<Integer> permutation, Matrix4d transformation, AxisAngle4d axisAngle, int fold, QuatSymmetryScores scores) { Rotation s = new Rotation(); s.setPermutation(new ArrayList<Integer>(permutation)); s.setTransformation(new Matrix4d(transformation)); s.setAxisAngle(new AxisAngle4d(axisAngle)); s.setFold(fold); s.setScores(scores); return s; }