Package chemaxon.struc
Class CTransform3D
java.lang.Object
chemaxon.struc.CTransform3D
- All Implemented Interfaces:
- Externalizable,- Serializable,- Cloneable
3D transformation matrix.
- Since:
- Marvin 2.7, 02/05/2001
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptiondoubleThe m00 element of the matrix.doubleThe m01 element of the matrix.doubleThe m02 element of the matrix.doubleThe m03 element of the matrix.doubleThe m10 element of the matrix.doubleThe m11 element of the matrix.doubleThe m12 element of the matrix.doubleThe m13 element of the matrix.doubleThe m20 element of the matrix.doubleThe m21 element of the matrix.doubleThe m22 element of the matrix.doubleThe m23 element of the matrix.doubleThe m30 element of the matrix.doubleThe m31 element of the matrix.doubleThe m32 element of the matrix.doubleThe m33 element of the matrix.
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs an identity transformation.Copy constructor.
- 
Method SummaryModifier and TypeMethodDescriptionclone()final doubleComputes the determinant of the matrix.final doubleComputes the determinant of the 2D matrix.booleanequals(CTransform3D ct, double epsylon) booleanfinal double[]getEuler()Gets the Euler angles from the rotation transformation.final doublegetScale()Gets the scale factor.inthashCode()final voidinvert()Inverts the matrix.booleanis3d()Tests whether the transformation is 3D.booleanfinal voidMultiplies by another matrix from left.final voidmul(CTransform3D b) Multiplies by another matrix from right.final voidReads the 4x4 matrix components as double precision floating point numbers.final voidReads the 4x4 matrix components as single precision floating point numbers.voidDeserializes a transformation matrix.voidset(CTransform3D t) Copy.final voidsetEuler(double psi, double theta, double phi) Sets the rotational component using the Euler angles provided.final voidMakes identity transformation.final voidsetRotation(double nx, double ny, double nz, double phi) Sets the rotation components.final voidSets the rotation center.final voidsetScale(double scale) Sets the scale factor.final voidsetTranslation(double x0, double y0, double z0) final voidfinal voidsetZero()Sets all components to zero.toString()Gets a string representation of the matrix.final voidTransforms a point.final voidWrites the 4x4 matrix components as double precision floating point numbers.final voidWrites the 4x4 matrix components as single precision floating point numbers.voidSerializes a transformation matrix.
- 
Field Details- 
m00public transient double m00The m00 element of the matrix.
- 
m01public transient double m01The m01 element of the matrix.
- 
m02public transient double m02The m02 element of the matrix.
- 
m03public transient double m03The m03 element of the matrix.
- 
m10public transient double m10The m10 element of the matrix.
- 
m11public transient double m11The m11 element of the matrix.
- 
m12public transient double m12The m12 element of the matrix.
- 
m13public transient double m13The m13 element of the matrix.
- 
m20public transient double m20The m20 element of the matrix.
- 
m21public transient double m21The m21 element of the matrix.
- 
m22public transient double m22The m22 element of the matrix.
- 
m23public transient double m23The m23 element of the matrix.
- 
m30public transient double m30The m30 element of the matrix.
- 
m31public transient double m31The m31 element of the matrix.
- 
m32public transient double m32The m32 element of the matrix.
- 
m33public transient double m33The m33 element of the matrix.
 
- 
- 
Constructor Details- 
CTransform3DCopy constructor.- Parameters:
- t- the transformation to copy
 
- 
CTransform3Dpublic CTransform3D()Constructs an identity transformation.
 
- 
- 
Method Details- 
setCopy.- Parameters:
- t- target transformation
 
- 
setZeropublic final void setZero()Sets all components to zero.- Since:
- Marvin 4.1, 01/23/2006
 
- 
setIdentitypublic final void setIdentity()Makes identity transformation.
- 
getEulerpublic final double[] getEuler()Gets the Euler angles from the rotation transformation.- Returns:
- array consisting of the 3 rotation angles about X, Y, Z
- Since:
- Marvin 4.1, 01/30/2006
 
- 
setEulerpublic final void setEuler(double psi, double theta, double phi) Sets the rotational component using the Euler angles provided. The other non-rotational elements are set as if this were an identity matrix. The euler parameters are three rotation angles applied first about the X, then Y, then Z axis.- Parameters:
- psi- rotation angle about X axis
- theta- rotation angle about Y axis
- phi- rotation angle about Z axis
- Since:
- Marvin 4.1, 01/30/2006
 
- 
getScalepublic final double getScale()Gets the scale factor. The scale equals to (-1)^sgn(det(T))*|det(T)|^(1/3)- Returns:
- the scale factor
 
- 
setScalepublic final void setScale(double scale) Sets the scale factor.- Parameters:
- scale- the scale
 
- 
determinantpublic final double determinant()Computes the determinant of the matrix.- Returns:
- the determinant
- Since:
- Marvin 4.1, 01/12/2006
 
- 
determinant2Dpublic final double determinant2D()Computes the determinant of the 2D matrix.- Returns:
- the determinant of the 2D matrix
- Since:
- Marvin 4.1, 01/12/2006
 
- 
setRotationpublic final void setRotation(double nx, double ny, double nz, double phi) Sets the rotation components.- Parameters:
- nx- normal vector x
- ny- normal vector y
- nz- normal vector z
- phi- angle
 
- 
setRotationCenterSets the rotation center. This method can be called aftersetRotation(order is important!) if a point other than the origin is meant to be the rotation center. It sets the translation vector in the fourth column (m03,m13andm23) in such a way that pointowill be the center of rotation specified by the upper left 3x3 components.- Parameters:
- o- the center
 
- 
setTranslation- Parameters:
- p- the translation
 
- 
setTranslationpublic final void setTranslation(double x0, double y0, double z0) - Parameters:
- x0- x translation
- y0- y translation
- z0- z translation
 
- 
transformTransforms a point.- Parameters:
- p- the point
 
- 
mulMultiplies by another matrix from right.- Parameters:
- b- the other matrix
 
- 
leftMulMultiplies by another matrix from left.- Parameters:
- b- the other matrix
 
- 
is3dpublic boolean is3d()Tests whether the transformation is 3D.- Returns:
- true if the transformation is 3D, false otherwise
- Since:
- Marvin 4.0.2, 11/04/2005
 
- 
invertpublic final void invert()Inverts the matrix.
- 
toStringGets a string representation of the matrix.
- 
writeExternalSerializes a transformation matrix.- Specified by:
- writeExternalin interface- Externalizable
- Parameters:
- out- the object output stream
- Throws:
- IOException
- Since:
- 3.5, 11/02/2004
 
- 
readExternalDeserializes a transformation matrix.- Specified by:
- readExternalin interface- Externalizable
- Parameters:
- in- the object input stream
- Throws:
- IOException
- Since:
- 3.5, 11/02/2004
 
- 
write16doublesWrites the 4x4 matrix components as double precision floating point numbers.- Parameters:
- out- the object output stream
- Throws:
- IOException
- Since:
- 3.5, 11/03/2004
 
- 
read16doublesReads the 4x4 matrix components as double precision floating point numbers.- Parameters:
- in- the object input stream
- Throws:
- IOException
- Since:
- 3.5, 11/03/2004
 
- 
write16floatsWrites the 4x4 matrix components as single precision floating point numbers.- Parameters:
- out- the object output stream
- Throws:
- IOException
- Since:
- 3.5, 11/03/2004
 
- 
read16floatsReads the 4x4 matrix components as single precision floating point numbers.- Parameters:
- in- the object input stream
- Throws:
- IOException
- Since:
- 3.5, 11/03/2004
 
- 
isIdentitypublic boolean isIdentity()
- 
equals
- 
equals
- 
hashCodepublic int hashCode()
- 
clone
 
-