org.biojava.bio.structure.quaternary
Class ModelTransformationMatrix

java.lang.Object
  extended by org.biojava.bio.structure.quaternary.ModelTransformationMatrix
All Implemented Interfaces:
java.lang.Cloneable

public class ModelTransformationMatrix
extends java.lang.Object
implements java.lang.Cloneable

Isolation issue - The original version of this (renamed as GLTransformationMatrix) uses FloatBuffer objects obtained from GL to store and operate on the matrices - doing so destroys the ability to isolate the model, because the loaders use this to generate and store biological unit and non-crystallographic transformations. This version is a reimplementation that uses a simple array of floats. These are almost always stored in lists - note GLTransformationList has a utility to return a list of FloatBuffer objects for use in gl rendering. TODO: re-implement this as a subclass of Matrix3x and remove redundant functionality. Revert the array implementation to a Vector3x/Point3x implementation. All of the vertices and points should be carried consistently. 24-Nov-08 - rickb

Author:
rickb
See Also:
org.rcsb.mbt.glscene.jogl.GLTransformationMatrix, org.rcsb.vf.glscene.jogl.GLTransformationList, org.rcsb.mbt.model.geometry.ModelTransformationList

Field Summary
 java.lang.String code
           
static java.util.regex.Pattern commaSpaces
           
 java.lang.String id
           
 java.lang.String ndbChainId
           
static java.util.regex.Pattern slash
           
static java.util.regex.Pattern spaces
           
 java.lang.String symmetryShorthand
           
 float[] values
           
 
Constructor Summary
ModelTransformationMatrix()
          Default Constructor
ModelTransformationMatrix(ModelTransformationMatrix src)
          Copy Constructor
 
Method Summary
 ModelTransformationMatrix clone()
           
static java.util.List<ModelTransformationMatrix> fromMultiXML(java.lang.String xml)
           
static ModelTransformationMatrix fromXML(java.lang.String xml)
           
 java.lang.String getCode()
           
 java.lang.String getId()
           
 Matrix getMatrix()
           
 java.lang.String getNdbChainId()
           
 java.lang.String getSymmetryShorthand()
           
 double[] getVector()
           
 void init()
           
 ModelTransformationMatrix inverse3()
           
static ModelTransformationMatrix multiply4square_x_4square2(ModelTransformationMatrix leftMat, ModelTransformationMatrix rightMat)
           
 void printMatrix(java.lang.String fullSymmetryOperation)
           
 void setCode(java.lang.String code)
           
 void setFullSymmetryOperation(java.lang.String fullSymmetryOperation_)
           
 void setId(java.lang.String id)
           
 void setIdentity()
           
 void setMatrix(Matrix m)
           
 void setNdbChainId(java.lang.String ndbChainId)
           
 void setSymmetryShorthand(java.lang.String symmetryShorthand)
           
 void setTransformationMatrix(float m00, float m01, float m02, float m10, float m11, float m12, float m20, float m21, float m22, float v0, float v1, float v2)
          The provided rotation matrix is: m00 m01 m02 m10 m11 m12 m20 m21 m22 And the provided translation vector is
 void setTransformationMatrix(Matrix matrix, double[] vector)
           
 void setVector(double[] v)
           
 java.lang.String toString()
           
 java.lang.String toXML()
           
 void toXML(PrettyXMLWriter xml)
           
 void transformPoint(double[] point, double[] result)
          This function will change the contents of result, but will not change point.
 void updateFullSymmetryDataWithInverseFractionalTransform(ModelTransformationMatrix fractional, ModelTransformationMatrix fractionalInverse)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

public java.lang.String id

ndbChainId

public java.lang.String ndbChainId

symmetryShorthand

public java.lang.String symmetryShorthand

code

public java.lang.String code

values

public float[] values

spaces

public static final java.util.regex.Pattern spaces

commaSpaces

public static final java.util.regex.Pattern commaSpaces

slash

public static final java.util.regex.Pattern slash
Constructor Detail

ModelTransformationMatrix

public ModelTransformationMatrix()
Default Constructor


ModelTransformationMatrix

public ModelTransformationMatrix(ModelTransformationMatrix src)
Copy Constructor

Parameters:
src -
Method Detail

setTransformationMatrix

public void setTransformationMatrix(Matrix matrix,
                                    double[] vector)

transformPoint

public void transformPoint(double[] point,
                           double[] result)
This function will change the contents of result, but will not change point.


setTransformationMatrix

public void setTransformationMatrix(float m00,
                                    float m01,
                                    float m02,
                                    float m10,
                                    float m11,
                                    float m12,
                                    float m20,
                                    float m21,
                                    float m22,
                                    float v0,
                                    float v1,
                                    float v2)
The provided rotation matrix is: m00 m01 m02 m10 m11 m12 m20 m21 m22 And the provided translation vector is


setIdentity

public void setIdentity()

inverse3

public ModelTransformationMatrix inverse3()

updateFullSymmetryDataWithInverseFractionalTransform

public void updateFullSymmetryDataWithInverseFractionalTransform(ModelTransformationMatrix fractional,
                                                                 ModelTransformationMatrix fractionalInverse)

multiply4square_x_4square2

public static ModelTransformationMatrix multiply4square_x_4square2(ModelTransformationMatrix leftMat,
                                                                   ModelTransformationMatrix rightMat)

setFullSymmetryOperation

public void setFullSymmetryOperation(java.lang.String fullSymmetryOperation_)

printMatrix

public void printMatrix(java.lang.String fullSymmetryOperation)

init

public void init()

getMatrix

public Matrix getMatrix()

setMatrix

public void setMatrix(Matrix m)

getVector

public double[] getVector()

setVector

public void setVector(double[] v)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toXML

public java.lang.String toXML()
                       throws java.io.IOException
Throws:
java.io.IOException

toXML

public void toXML(PrettyXMLWriter xml)
           throws java.io.IOException
Throws:
java.io.IOException

fromXML

public static ModelTransformationMatrix fromXML(java.lang.String xml)
                                         throws org.xml.sax.SAXException,
                                                java.io.IOException,
                                                javax.xml.parsers.ParserConfigurationException
Throws:
org.xml.sax.SAXException
java.io.IOException
javax.xml.parsers.ParserConfigurationException

fromMultiXML

public static java.util.List<ModelTransformationMatrix> fromMultiXML(java.lang.String xml)
                                                              throws javax.xml.parsers.ParserConfigurationException,
                                                                     org.xml.sax.SAXException,
                                                                     java.io.IOException
Throws:
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException

getId

public java.lang.String getId()

setId

public void setId(java.lang.String id)

getNdbChainId

public java.lang.String getNdbChainId()

setNdbChainId

public void setNdbChainId(java.lang.String ndbChainId)

getSymmetryShorthand

public java.lang.String getSymmetryShorthand()

setSymmetryShorthand

public void setSymmetryShorthand(java.lang.String symmetryShorthand)

getCode

public java.lang.String getCode()

setCode

public void setCode(java.lang.String code)

clone

public ModelTransformationMatrix clone()
Overrides:
clone in class java.lang.Object