001/*
002 *                    BioJava development code
003 *
004 * This code may be freely distributed and modified under the
005 * terms of the GNU Lesser General Public Licence.  This should
006 * be distributed with the code.  If you do not have a copy,
007 * see:
008 *
009 *      http://www.gnu.org/copyleft/lesser.html
010 *
011 * Copyright for this code is held jointly by the individual
012 * authors.  These should be listed in @author doc comments.
013 *
014 * For more information on the BioJava project and its aims,
015 * or to join the biojava-l mailing list, visit the home page
016 * at:
017 *
018 *      http://www.biojava.org/
019 *
020 */
021package org.biojava.nbio.structure.symmetry.axis;
022
023import javax.vecmath.Matrix3d;
024import javax.vecmath.Matrix4d;
025import javax.vecmath.Point3d;
026import javax.vecmath.Vector3d;
027
028import org.biojava.nbio.structure.symmetry.core.QuatSymmetryResults;
029import org.biojava.nbio.structure.symmetry.core.QuatSymmetrySubunits;
030
031import java.util.List;
032
033public abstract class AxisAligner {
034
035        /**
036         * Returns an instance of AxisAligner for differnt type of QuatSymmetryResults (factory method)
037         * @param results symmetry results
038         * @return instance of AxisAligner
039         */
040        public static AxisAligner getInstance(QuatSymmetryResults results) {
041                String symmetry = results.getSymmetry();
042
043                if (symmetry.equals("H")) {
044                        return new HelixAxisAligner(results);
045                } else {
046                        return new RotationAxisAligner(results);
047                }
048        }
049
050        public abstract String getSymmetry();
051
052        public abstract Matrix4d getTransformation();
053
054        public abstract Matrix3d getRotationMatrix();
055
056        public abstract Matrix4d getReverseTransformation();
057
058        public abstract Vector3d getPrincipalRotationAxis();
059
060        public abstract Vector3d getRotationReferenceAxis();
061
062        public abstract Vector3d[] getPrincipalAxesOfInertia();
063
064        public abstract Vector3d getDimension();
065
066        /**
067         * Returns the radius for drawing polyhedra
068         * @return double radius
069         */
070        public abstract double getRadius();
071
072        /**
073         * Returns a transformation matrix transform polyhedra for Cn structures.
074         * The center in this matrix is the geometric center, rather then the centroid.
075         * In Cn structures those are usually not the same.
076         * @return
077         */
078        public abstract Matrix4d getGeometicCenterTransformation();
079
080        /**
081         * Returns the geometric center of polyhedron. In the case of the Cn
082         * point group, the centroid and geometric center are usually not
083         * identical.
084         * @return
085         */
086        public abstract Point3d getGeometricCenter();
087
088        public abstract Point3d getCentroid();
089
090        public abstract QuatSymmetrySubunits getSubunits();
091
092        public abstract List<List<Integer>> getOrbits();
093
094}