public abstract class BaseTransform extends java.lang.Object implements CanTransformVec3d
Modifier and Type | Class and Description |
---|---|
static class |
BaseTransform.Degree |
Modifier and Type | Field and Description |
---|---|
(package private) static double |
EPSILON_ABSOLUTE |
static BaseTransform |
IDENTITY_TRANSFORM |
static int |
TYPE_AFFINE_3D |
static int |
TYPE_AFFINE2D_MASK |
static int |
TYPE_FLIP
This flag bit indicates that the transform defined by this object
performs a mirror image flip about some axis which changes the
normally right handed coordinate system into a left handed
system in addition to the conversions indicated by other flag bits.
|
static int |
TYPE_GENERAL_ROTATION
This flag bit indicates that the transform defined by this object
performs a rotation by an arbitrary angle in addition to the
conversions indicated by other flag bits.
|
static int |
TYPE_GENERAL_SCALE
This flag bit indicates that the transform defined by this object
performs a general scale in addition to the conversions indicated
by other flag bits.
|
static int |
TYPE_GENERAL_TRANSFORM
This constant indicates that the transform defined by this object
performs an arbitrary conversion of the input coordinates.
|
static int |
TYPE_IDENTITY
This constant indicates that the transform defined by this object
is an identity transform.
|
static int |
TYPE_MASK_ROTATION
This constant is a bit mask for any of the rotation flag bits.
|
static int |
TYPE_MASK_SCALE
This constant is a bit mask for any of the scale flag bits.
|
static int |
TYPE_QUADRANT_ROTATION
This flag bit indicates that the transform defined by this object
performs a quadrant rotation by some multiple of 90 degrees in
addition to the conversions indicated by other flag bits.
|
static int |
TYPE_TRANSLATION
This flag bit indicates that the transform defined by this object
performs a translation in addition to the conversions indicated
by other flag bits.
|
static int |
TYPE_UNIFORM_SCALE
This flag bit indicates that the transform defined by this object
performs a uniform scale in addition to the conversions indicated
by other flag bits.
|
protected static int |
TYPE_UNKNOWN |
Constructor and Description |
---|
BaseTransform() |
Modifier and Type | Method and Description |
---|---|
static boolean |
almostZero(double a) |
abstract BaseTransform |
copy() |
abstract BaseTransform |
createInverse()
This function always returns a new object, unless the transform
is an identity transform in which case it might return the
Identity singleton. |
abstract Shape |
createTransformedShape(Shape s) |
(package private) static void |
degreeError(BaseTransform.Degree maxSupported) |
abstract void |
deltaTransform(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts) |
abstract void |
deltaTransform(float[] srcPts,
int srcOff,
float[] dstPts,
int dstOff,
int numPts) |
abstract Vec3d |
deltaTransform(Vec3d src,
Vec3d dst) |
abstract BaseTransform |
deriveWithConcatenation(BaseTransform tx) |
abstract BaseTransform |
deriveWithConcatenation(double mxx,
double myx,
double mxy,
double myy,
double mxt,
double myt) |
abstract BaseTransform |
deriveWithConcatenation(double mxx,
double mxy,
double mxz,
double mxt,
double myx,
double myy,
double myz,
double myt,
double mzx,
double mzy,
double mzz,
double mzt) |
abstract BaseTransform |
deriveWithNewTransform(BaseTransform tx) |
abstract BaseTransform |
deriveWithPreConcatenation(BaseTransform transform) |
abstract BaseTransform |
deriveWithPreTranslation(double mxt,
double myt) |
abstract BaseTransform |
deriveWithRotation(double theta,
double axisX,
double axisY,
double axisZ) |
abstract BaseTransform |
deriveWithScale(double mxx,
double myy,
double mzz) |
abstract BaseTransform |
deriveWithTranslation(double mxt,
double myt) |
abstract BaseTransform |
deriveWithTranslation(double mxt,
double myt,
double mzt) |
boolean |
equals(java.lang.Object obj)
Returns
true if this BaseTransform
represents the same coordinate transform as the specified
argument. |
abstract BaseTransform.Degree |
getDegree() |
abstract double |
getDeterminant() |
static BaseTransform |
getInstance(BaseTransform tx) |
static BaseTransform |
getInstance(double mxx,
double myx,
double mxy,
double myy,
double mxt,
double myt) |
static BaseTransform |
getInstance(double mxx,
double mxy,
double mxz,
double mxt,
double myx,
double myy,
double myz,
double myt,
double mzx,
double mzy,
double mzz,
double mzt) |
double |
getMxt() |
double |
getMxx() |
double |
getMxy() |
double |
getMxz() |
double |
getMyt() |
double |
getMyx() |
double |
getMyy() |
double |
getMyz() |
double |
getMzt() |
double |
getMzx() |
double |
getMzy() |
double |
getMzz() |
static BaseTransform |
getRotateInstance(double theta,
double x,
double y) |
static BaseTransform |
getScaleInstance(double mxx,
double myy) |
static BaseTransform |
getTranslateInstance(double mxt,
double myt) |
abstract int |
getType()
Retrieves the flag bits describing the conversion properties of
this transform.
|
int |
hashCode()
Returns the hashcode for this transform.
|
abstract void |
inverseDeltaTransform(float[] srcPts,
int srcOff,
float[] dstPts,
int dstOff,
int numPts) |
abstract Vec3d |
inverseDeltaTransform(Vec3d src,
Vec3d dst) |
abstract BaseBounds |
inverseTransform(BaseBounds bounds,
BaseBounds result) |
abstract void |
inverseTransform(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts) |
abstract void |
inverseTransform(float[] srcPts,
int srcOff,
float[] dstPts,
int dstOff,
int numPts) |
abstract Point2D |
inverseTransform(Point2D src,
Point2D dst) |
abstract void |
inverseTransform(Rectangle rect,
Rectangle result) |
abstract Vec3d |
inverseTransform(Vec3d src,
Vec3d dst) |
abstract void |
invert()
This function inverts the
BaseTransform in place. |
abstract boolean |
is2D() |
abstract boolean |
isIdentity() |
abstract boolean |
isTranslateOrIdentity() |
(package private) static Point2D |
makePoint(Point2D src,
Point2D dst) |
abstract void |
restoreTransform(double mxx,
double myx,
double mxy,
double myy,
double mxt,
double myt)
This function is only guaranteed to succeed if the transform is
of degree AFFINE2D or less and the matrix
parameters specified came from this same instance.
|
abstract void |
restoreTransform(double mxx,
double mxy,
double mxz,
double mxt,
double myx,
double myy,
double myz,
double myt,
double mzx,
double mzy,
double mzz,
double mzt)
This function is only guaranteed to succeed if the matrix
parameters specified came from this same instance.
|
abstract void |
setToIdentity() |
abstract void |
setTransform(BaseTransform xform) |
java.lang.String |
toString()
Returns the matrix elements and degree of this transform as a string.
|
abstract BaseBounds |
transform(BaseBounds bounds,
BaseBounds result) |
abstract void |
transform(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts) |
abstract void |
transform(double[] srcPts,
int srcOff,
float[] dstPts,
int dstOff,
int numPts) |
abstract void |
transform(float[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts) |
abstract void |
transform(float[] srcPts,
int srcOff,
float[] dstPts,
int dstOff,
int numPts) |
abstract Point2D |
transform(Point2D src,
Point2D dst) |
abstract void |
transform(Rectangle rect,
Rectangle result) |
abstract Vec3d |
transform(Vec3d src,
Vec3d dst) |
public static final BaseTransform IDENTITY_TRANSFORM
protected static final int TYPE_UNKNOWN
public static final int TYPE_IDENTITY
public static final int TYPE_TRANSLATION
public static final int TYPE_UNIFORM_SCALE
public static final int TYPE_GENERAL_SCALE
public static final int TYPE_MASK_SCALE
public static final int TYPE_FLIP
public static final int TYPE_QUADRANT_ROTATION
public static final int TYPE_GENERAL_ROTATION
public static final int TYPE_MASK_ROTATION
public static final int TYPE_GENERAL_TRANSFORM
public static final int TYPE_AFFINE2D_MASK
public static final int TYPE_AFFINE_3D
static final double EPSILON_ABSOLUTE
static void degreeError(BaseTransform.Degree maxSupported)
public static BaseTransform getInstance(BaseTransform tx)
public static BaseTransform getInstance(double mxx, double mxy, double mxz, double mxt, double myx, double myy, double myz, double myt, double mzx, double mzy, double mzz, double mzt)
public static BaseTransform getInstance(double mxx, double myx, double mxy, double myy, double mxt, double myt)
public static BaseTransform getTranslateInstance(double mxt, double myt)
public static BaseTransform getScaleInstance(double mxx, double myy)
public static BaseTransform getRotateInstance(double theta, double x, double y)
public abstract BaseTransform.Degree getDegree()
public abstract int getType()
TYPE_IDENTITY
,
TYPE_TRANSLATION
,
TYPE_UNIFORM_SCALE
,
TYPE_GENERAL_SCALE
,
TYPE_QUADRANT_ROTATION
,
TYPE_GENERAL_ROTATION
,
TYPE_GENERAL_TRANSFORM
public abstract boolean isIdentity()
public abstract boolean isTranslateOrIdentity()
public abstract boolean is2D()
public abstract double getDeterminant()
public double getMxx()
public double getMxy()
public double getMxz()
public double getMxt()
public double getMyx()
public double getMyy()
public double getMyz()
public double getMyt()
public double getMzx()
public double getMzy()
public double getMzz()
public double getMzt()
public abstract Point2D inverseTransform(Point2D src, Point2D dst) throws NoninvertibleTransformException
NoninvertibleTransformException
public abstract Vec3d transform(Vec3d src, Vec3d dst)
transform
in interface CanTransformVec3d
public abstract Vec3d inverseTransform(Vec3d src, Vec3d dst) throws NoninvertibleTransformException
NoninvertibleTransformException
public abstract Vec3d inverseDeltaTransform(Vec3d src, Vec3d dst) throws NoninvertibleTransformException
NoninvertibleTransformException
public abstract void transform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)
public abstract void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
public abstract void transform(float[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
public abstract void transform(double[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)
public abstract void deltaTransform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)
public abstract void deltaTransform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
public abstract void inverseTransform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts) throws NoninvertibleTransformException
NoninvertibleTransformException
public abstract void inverseDeltaTransform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts) throws NoninvertibleTransformException
NoninvertibleTransformException
public abstract void inverseTransform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) throws NoninvertibleTransformException
NoninvertibleTransformException
public abstract BaseBounds transform(BaseBounds bounds, BaseBounds result)
public abstract BaseBounds inverseTransform(BaseBounds bounds, BaseBounds result) throws NoninvertibleTransformException
NoninvertibleTransformException
public abstract void inverseTransform(Rectangle rect, Rectangle result) throws NoninvertibleTransformException
NoninvertibleTransformException
public abstract void setToIdentity()
public abstract void setTransform(BaseTransform xform)
public abstract void invert() throws NoninvertibleTransformException
BaseTransform
in place. All
current implementations can support their own inverted form, and
that should likely remain true in the future as well.NoninvertibleTransformException
public abstract void restoreTransform(double mxx, double myx, double mxy, double myy, double mxt, double myt)
public abstract void restoreTransform(double mxx, double mxy, double mxz, double mxt, double myx, double myy, double myz, double myt, double mzx, double mzy, double mzz, double mzt)
public abstract BaseTransform deriveWithTranslation(double mxt, double myt)
public abstract BaseTransform deriveWithTranslation(double mxt, double myt, double mzt)
public abstract BaseTransform deriveWithScale(double mxx, double myy, double mzz)
public abstract BaseTransform deriveWithRotation(double theta, double axisX, double axisY, double axisZ)
public abstract BaseTransform deriveWithPreTranslation(double mxt, double myt)
public abstract BaseTransform deriveWithConcatenation(double mxx, double myx, double mxy, double myy, double mxt, double myt)
public abstract BaseTransform deriveWithConcatenation(double mxx, double mxy, double mxz, double mxt, double myx, double myy, double myz, double myt, double mzx, double mzy, double mzz, double mzt)
public abstract BaseTransform deriveWithPreConcatenation(BaseTransform transform)
public abstract BaseTransform deriveWithConcatenation(BaseTransform tx)
public abstract BaseTransform deriveWithNewTransform(BaseTransform tx)
public abstract BaseTransform createInverse() throws NoninvertibleTransformException
Identity
singleton.NoninvertibleTransformException
public abstract BaseTransform copy()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
true
if this BaseTransform
represents the same coordinate transform as the specified
argument.equals
in class java.lang.Object
obj
- the Object
to test for equality with this
BaseTransform
true
if obj
equals this
BaseTransform
object; false
otherwise.public static boolean almostZero(double a)
public java.lang.String toString()
toString
in class java.lang.Object