chemaxon.struc
Class CTransform3D

java.lang.Object
  extended bychemaxon.struc.CTransform3D
All Implemented Interfaces:
java.io.Serializable

public class CTransform3D
extends java.lang.Object
implements java.io.Serializable

3D transformation matrix.

Version:
3.1.4, 06/09/2003
Author:
Peter Csizmadia
See Also:
Serialized Form

Field Summary
 double m00
          The m00 element of the matrix.
 double m01
          The m01 element of the matrix.
 double m02
          The m02 element of the matrix.
 double m03
          The m03 element of the matrix.
 double m10
          The m10 element of the matrix.
 double m11
          The m11 element of the matrix.
 double m12
          The m12 element of the matrix.
 double m13
          The m13 element of the matrix.
 double m20
          The m20 element of the matrix.
 double m21
          The m21 element of the matrix.
 double m22
          The m22 element of the matrix.
 double m23
          The m23 element of the matrix.
 double m30
          The m30 element of the matrix.
 double m31
          The m31 element of the matrix.
 double m32
          The m32 element of the matrix.
 double m33
          The m33 element of the matrix.
 
Constructor Summary
CTransform3D()
          Constructs an identity transformation.
CTransform3D(CTransform3D t)
          Copy constructor.
 
Method Summary
 double getScale()
          Gets the scale factor.
 void invert()
          Inverts the matrix.
 void mul(CTransform3D b)
          Multiplies by another matrix.
 void set(CTransform3D t)
          Copy.
 void setIdentity()
          Makes identity transformation.
 void setRotation(double nx, double ny, double nz, double phi)
          Sets the rotation components.
 void setRotationCenter(DPoint3 o)
          Sets the rotation center
 void setScale(double scale)
          Sets the scale factor.
 void setTranslation(double x0, double y0, double z0)
          Sets the translation components.
 void setTranslation(DPoint3 p)
          Sets the translation components.
 java.lang.String toString()
          Gets a string representation of the matrix.
 void transform(DPoint3 p)
          Transforms a point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m00

public transient double m00
The m00 element of the matrix.


m01

public transient double m01
The m01 element of the matrix.


m02

public transient double m02
The m02 element of the matrix.


m03

public transient double m03
The m03 element of the matrix.


m10

public transient double m10
The m10 element of the matrix.


m11

public transient double m11
The m11 element of the matrix.


m12

public transient double m12
The m12 element of the matrix.


m13

public transient double m13
The m13 element of the matrix.


m20

public transient double m20
The m20 element of the matrix.


m21

public transient double m21
The m21 element of the matrix.


m22

public transient double m22
The m22 element of the matrix.


m23

public transient double m23
The m23 element of the matrix.


m30

public transient double m30
The m30 element of the matrix.


m31

public transient double m31
The m31 element of the matrix.


m32

public transient double m32
The m32 element of the matrix.


m33

public transient double m33
The m33 element of the matrix.

Constructor Detail

CTransform3D

public CTransform3D(CTransform3D t)
Copy constructor.

Parameters:
t - the transformation to copy

CTransform3D

public CTransform3D()
Constructs an identity transformation.

Method Detail

set

public void set(CTransform3D t)
Copy.

Parameters:
t - target transformation

setIdentity

public final void setIdentity()
Makes identity transformation.


getScale

public final double getScale()
Gets the scale factor. The scale equals to (-1)^sgn(det(T))*|det(T)|^(1/3)

Returns:
the scale factor

setScale

public final void setScale(double scale)
Sets the scale factor.

Parameters:
scale - the scale

setRotation

public 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

setRotationCenter

public final void setRotationCenter(DPoint3 o)
Sets the rotation center

Parameters:
o - the center

setTranslation

public final void setTranslation(DPoint3 p)
Sets the translation components.

Parameters:
p - the translation

setTranslation

public final void setTranslation(double x0,
                                 double y0,
                                 double z0)
Sets the translation components.

Parameters:
x0 - x translation
y0 - y translation
z0 - z translation

transform

public final void transform(DPoint3 p)
Transforms a point.

Parameters:
p - the point

mul

public final void mul(CTransform3D b)
Multiplies by another matrix.

Parameters:
b - the other matrix

invert

public final void invert()
Inverts the matrix.


toString

public java.lang.String toString()
Gets a string representation of the matrix.

Returns:
the string representation