math.geom2d.transform
Class GenericAffineTransform2D

java.lang.Object
  extended by math.geom2d.transform.AbstractAffineTransform2D
      extended by math.geom2d.transform.GenericAffineTransform2D
All Implemented Interfaces:
AffineTransform2D, Bijection2D, Transform2D
Direct Known Subclasses:
AbstractAffineTransform2D.Identity2D

public class GenericAffineTransform2D
extends AbstractAffineTransform2D

An implementation of IAffineTransform2D which uses an internal matrix for storing transform parameters.
Behavior of this class will be similar to java.awt.geom.AffineTransform.


Nested Class Summary
 
Nested classes/interfaces inherited from class math.geom2d.transform.AbstractAffineTransform2D
AbstractAffineTransform2D.Identity2D
 
Field Summary
protected  double m00
           
protected  double m01
           
protected  double m02
           
protected  double m10
           
protected  double m11
           
protected  double m12
           
 
Constructor Summary
GenericAffineTransform2D()
          Main constructor
GenericAffineTransform2D(java.awt.geom.AffineTransform trans)
           
GenericAffineTransform2D(AffineTransform2D trans)
          constructor by copy of an existing transform
GenericAffineTransform2D(double[] coefs)
           
GenericAffineTransform2D(double xx, double yx, double xy, double yy)
           
GenericAffineTransform2D(double xx, double yx, double tx, double xy, double yy, double ty)
           
 
Method Summary
 GenericAffineTransform2D compose(AffineTransform2D that)
          Return the composition of this affine transform with the given affine transform.
 double[][] getAffineMatrix()
          return matrix of the transform coefficients.
 double[] getCoefficients()
          return coefficients of the transform.
 AffineTransform2D getInverseTransform()
           
 void preConcatenate(GenericAffineTransform2D trans)
          Combine this transform with another AffineTransform.
 void setToIdentity()
           
 void setTransform(double n00, double n01, double n02, double n10, double n11, double n12)
           
 void setTransform(GenericAffineTransform2D trans)
           
 Point2D[] transform(java.awt.geom.Point2D[] src, Point2D[] dst)
          Transforms an array of points, and returns the transformed points.
 Point2D transform(java.awt.geom.Point2D src, Point2D dst)
          Transforms a point, share memory
 
Methods inherited from class math.geom2d.transform.AbstractAffineTransform2D
createRotation, createRotation, createRotation, createScaling, createScaling, createTranslation, createTranslation, equals, isDirect, isDirect, isIdentity, isIdentity, isIsometry, isIsometry, isMotion, isMotion, isSimilarity, isSimilarity, transform
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m00

protected double m00

m01

protected double m01

m02

protected double m02

m10

protected double m10

m11

protected double m11

m12

protected double m12
Constructor Detail

GenericAffineTransform2D

public GenericAffineTransform2D()
Main constructor


GenericAffineTransform2D

public GenericAffineTransform2D(AffineTransform2D trans)
constructor by copy of an existing transform


GenericAffineTransform2D

public GenericAffineTransform2D(double[] coefs)

GenericAffineTransform2D

public GenericAffineTransform2D(double xx,
                                double yx,
                                double tx,
                                double xy,
                                double yy,
                                double ty)

GenericAffineTransform2D

public GenericAffineTransform2D(double xx,
                                double yx,
                                double xy,
                                double yy)

GenericAffineTransform2D

public GenericAffineTransform2D(java.awt.geom.AffineTransform trans)
Method Detail

getCoefficients

public double[] getCoefficients()
return coefficients of the transform. Result is an array of 6 double.


getAffineMatrix

public double[][] getAffineMatrix()
Description copied from interface: AffineTransform2D
return matrix of the transform coefficients. Result is a 2x3 array of double.


getInverseTransform

public AffineTransform2D getInverseTransform()

compose

public GenericAffineTransform2D compose(AffineTransform2D that)
Description copied from interface: AffineTransform2D
Return the composition of this affine transform with the given affine transform. If transforms are represented by matrices this and that, the result can be represented by matrix this*that.

Specified by:
compose in interface AffineTransform2D
Overrides:
compose in class AbstractAffineTransform2D
Parameters:
that - the transform to compose with
Returns:
the composition of this transform with the given transform

setTransform

public void setTransform(double n00,
                         double n01,
                         double n02,
                         double n10,
                         double n11,
                         double n12)

setTransform

public void setTransform(GenericAffineTransform2D trans)

setToIdentity

public void setToIdentity()

preConcatenate

public void preConcatenate(GenericAffineTransform2D trans)
Combine this transform with another AffineTransform.


transform

public Point2D[] transform(java.awt.geom.Point2D[] src,
                           Point2D[] dst)
Description copied from interface: Transform2D
Transforms an array of points, and returns the transformed points.

Specified by:
transform in interface Transform2D
Overrides:
transform in class AbstractAffineTransform2D

transform

public Point2D transform(java.awt.geom.Point2D src,
                         Point2D dst)
Description copied from interface: Transform2D
Transforms a point, share memory

Specified by:
transform in interface Transform2D
Overrides:
transform in class AbstractAffineTransform2D