Class CTransform3D

    • 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
      • setZero

        public final void setZero()
        Sets all components to zero.
        Since:
        Marvin 4.1, 01/23/2006
      • setIdentity

        public final void setIdentity()
        Makes identity transformation.
      • getEuler

        public 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
      • setEuler

        public 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
      • 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
      • determinant

        public final double determinant()
        Computes the determinant of the matrix.
        Returns:
        the determinant
        Since:
        Marvin 4.1, 01/12/2006
      • determinant2D

        public final double determinant2D()
        Computes the determinant of the 2D matrix.
        Returns:
        the determinant of the 2D matrix
        Since:
        Marvin 4.1, 01/12/2006
      • 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. This method can be called after setRotation (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, m13 and m23) in such a way that point o will be the center of rotation specified by the upper left 3x3 components.
        Parameters:
        o - the center
      • setTranslation

        public final void setTranslation​(DPoint3 p)
        Sets the translation components (m03, m13 and m23).
        Parameters:
        p - the translation
      • setTranslation

        public final void setTranslation​(double x0,
                                         double y0,
                                         double z0)
        Sets the translation components (m03, m13 and m23).
        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 from right.
        Parameters:
        b - the other matrix
      • leftMul

        public final void leftMul​(CTransform3D b)
        Multiplies by another matrix from left.
        Parameters:
        b - the other matrix
      • is3d

        public 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
      • invert

        public final void invert()
        Inverts the matrix.
      • toString

        public String toString()
        Gets a string representation of the matrix.
        Overrides:
        toString in class Object
        Returns:
        the string representation
      • write16doubles

        public final void write16doubles​(ObjectOutput out)
                                  throws IOException
        Writes the 4x4 matrix components as double precision floating point numbers.
        Parameters:
        out - the object output stream
        Throws:
        IOException
        Since:
        3.5, 11/03/2004
      • read16doubles

        public final void read16doubles​(ObjectInput in)
                                 throws IOException
        Reads the 4x4 matrix components as double precision floating point numbers.
        Parameters:
        in - the object input stream
        Throws:
        IOException
        Since:
        3.5, 11/03/2004
      • write16floats

        public final void write16floats​(ObjectOutput out)
                                 throws IOException
        Writes the 4x4 matrix components as single precision floating point numbers.
        Parameters:
        out - the object output stream
        Throws:
        IOException
        Since:
        3.5, 11/03/2004
      • read16floats

        public final void read16floats​(ObjectInput in)
                                throws IOException
        Reads the 4x4 matrix components as single precision floating point numbers.
        Parameters:
        in - the object input stream
        Throws:
        IOException
        Since:
        3.5, 11/03/2004
      • isIdentity

        public boolean isIdentity()
      • equals

        public boolean equals​(CTransform3D ct,
                              double epsylon)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object