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.core;
022
023import javax.vecmath.Matrix3d;
024import javax.vecmath.Matrix4d;
025import javax.vecmath.Point3d;
026import javax.vecmath.Vector3d;
027import java.util.List;
028
029public abstract class AxisAligner {
030
031        /**
032         * Returns an instance of AxisAligner for differnt type of QuatSymmetryResults (factory method)
033         * @param results symmetry results
034         * @return instance of AxisAligner
035         */
036        public static AxisAligner getInstance(QuatSymmetryResults results) {
037                String symmetry = results.getSymmetry();
038
039                if (symmetry.equals("H")) {
040                        return new HelixAxisAligner(results);
041                } else {
042                        return new RotationAxisAligner(results);
043                }
044        }
045
046        public abstract String getSymmetry();
047
048        public abstract Matrix4d getTransformation();
049
050        public abstract Matrix3d getRotationMatrix();
051
052        public abstract Matrix4d getReverseTransformation();
053
054        public abstract Vector3d getPrincipalRotationAxis();
055
056        public abstract Vector3d getRotationReferenceAxis();
057
058        public abstract Vector3d[] getPrincipalAxesOfInertia();
059
060        public abstract Vector3d getDimension();
061
062        /**
063         * Returns the radius for drawing polyhedra
064         * @return double radius
065         */
066        public abstract double getRadius();
067
068        /**
069         * Returns a transformation matrix transform polyhedra for Cn structures.
070         * The center in this matrix is the geometric center, rather then the centroid.
071         * In Cn structures those are usually not the same.
072         * @return
073         */
074        public abstract Matrix4d getGeometicCenterTransformation();
075
076        /**
077         * Returns the geometric center of polyhedron. In the case of the Cn
078         * point group, the centroid and geometric center are usually not
079         * identical.
080         * @return
081         */
082        public abstract Point3d getGeometricCenter();
083
084        public abstract Point3d getCentroid();
085
086        public abstract Subunits getSubunits();
087
088        public abstract List<List<Integer>> getOrbits();
089
090}