Class ConcatenatedTransform

    • Field Detail

      • transform1

        public final MathTransform transform1
        The first math transform.
      • transform2

        public final MathTransform transform2
        The second math transform.
    • Method Detail

      • create

        public static MathTransform create​(MathTransform tr1,
                                           MathTransform tr2)
        Constructs a concatenated transform. This factory method checks for step transforms dimension. The returned transform will implements MathTransform2D if source and target dimensions are equal to 2. Likewise, it will implements MathTransform1D if source and target dimensions are equal to 1. MathTransform implementations are available in two version: direct and non-direct. The "non-direct" version use an intermediate buffer when performing transformations; they are slower and consume more memory. They are used only as a fallback when a "direct" version can't be created.
        Parameters:
        tr1 - The first math transform.
        tr2 - The second math transform.
        Returns:
        The concatenated transform.
      • getStepCount

        public final int getStepCount()
        Returns the number of math transform steps performed by this concatenated transform.
        Returns:
        The number of transform steps.
        Since:
        2.5
      • transform

        public Position transform​(Position ptSrc,
                                  Position ptDst)
                           throws TransformException
        Transforms the specified ptSrc and stores the result in ptDst.
        Specified by:
        transform in interface MathTransform
        Overrides:
        transform in class AbstractMathTransform
        Parameters:
        ptSrc - the specified coordinate point to be transformed.
        ptDst - the specified coordinate point that stores the result of transforming ptSrc, or null.
        Returns:
        the coordinate point after transforming ptSrc and storing the result in ptDst, or a newly created point if ptDst was null.
        Throws:
        TransformException - if the point can't be transformed.
      • transform

        public void transform​(double[] srcPts,
                              int srcOff,
                              double[] dstPts,
                              int dstOff,
                              int numPts)
                       throws TransformException
        Transforms a list of coordinate point ordinal values. The source points are first transformed by transform1, then the intermediate points are transformed by transform2. The transformations are performed without intermediate buffer if it can be avoided.
        Specified by:
        transform in interface MathTransform
        Parameters:
        srcPts - the array containing the source point coordinates.
        srcOff - the offset to the first point to be transformed in the source array.
        dstPts - the array into which the transformed point coordinates are returned. May be the same than srcPts.
        dstOff - the offset to the location of the first transformed point that is stored in the destination array.
        numPts - the number of point objects to be transformed.
        Throws:
        TransformException - if a point can't be transformed. Some implementations will stop at the first failure, wile some other implementations will fill the untransformable points with NaN values, continue and throw the exception only at end. Implementations that fall in the later case should set the last completed transform to this.
      • transform

        public void transform​(float[] srcPts,
                              int srcOff,
                              float[] dstPts,
                              int dstOff,
                              int numPts)
                       throws TransformException
        Transforms a list of coordinate point ordinal values. The source points are first copied in a temporary array of type double[], transformed by transform1 first, then by transform2 and finally the result is casted to float primitive type and stored in the destination array. The use of double primitive type for intermediate results is necesssary for reducing rounding errors.
        Specified by:
        transform in interface MathTransform
        Overrides:
        transform in class AbstractMathTransform
        Parameters:
        srcPts - the array containing the source point coordinates.
        srcOff - the offset to the first point to be transformed in the source array.
        dstPts - the array into which the transformed point coordinates are returned. May be the same than srcPts.
        dstOff - the offset to the location of the first transformed point that is stored in the destination array.
        numPts - the number of point objects to be transformed.
        Throws:
        TransformException - if a point can't be transformed. Some implementations will stop at the first failure, wile some other implementations will fill the untransformable points with NaN values, continue and throw the exception only at end. Implementations that fall in the later case should set the last completed transform to this.
      • isIdentity

        public final boolean isIdentity()
        Tests whether this transform does not move any points. Default implementation check if the two transforms are identity.
        Specified by:
        isIdentity in interface MathTransform
        Overrides:
        isIdentity in class AbstractMathTransform
        Returns:
        true if this MathTransform is an identity transform; false otherwise.
      • equals

        public final boolean equals​(Object object)
        Compares the specified object with this math transform for equality.
        Overrides:
        equals in class AbstractMathTransform
        Parameters:
        object - The object to compare with this transform.
        Returns:
        true if the given object is a transform of the same class and if, given identical source position, the transformed position would be the equals.