|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object Transform2D
public class Transform2D
Transform2D wraps a Matrix2D object and provides,
Nested Class Summary | |
---|---|
static class |
Transform2D.Type
ZERO can be used to construct a Transform2D object defining the zero matrix. |
Constructor Summary | |
---|---|
Transform2D()
Constructs a Transform2D object encapsulating the ZERO matrix. |
|
Transform2D(Matrix2D matrix2D)
Constructs a Transform2D object by duplicating the elements of the Matrix2D parameter |
|
Transform2D(Transform2D.Type kind)
Constructs a Transform2D object encapsulating either, ZERO - a Matrix2D whose elements are all 0s IDENTITY - a Matrix2D object consisting of 1s on the principal diagonal and 0s elsewhere |
|
Transform2D(Transform2D transform2D)
Constructs a Transform2D object by duplicating the elements of the Matrix2D object encapsulated by the Transform2D parameter |
Method Summary | |
---|---|
Transform2D |
add(Transform2D other)
Returns the sum of the matrix elements of this Transform2D object (augend) and the parameter (addend) by calling Matrix2D's add method. |
Matrix2D |
getTransform2D()
Accessor method that return the elements of matrix transform |
Transform2D |
mul(Transform2D other)
Returns the product of the matrix elements of this Transform2D object (multiplicand) and the parameter (multiplier) by calling Matrix2D's mul method. |
void |
setRotation(double a)
Modifier method that sets the matrix transform required to rotate the preimage around the origin: cos a -sin a 0 / sin a cos a 0 / 0 0 1 |
void |
setScale(double s)
Modifier method that sets the matrix transform to s 0 0 / 0 s 0 / 0 0 1 |
void |
setTransform2D(Matrix2D matrix2D)
Modifier method that sets the elements of matrix transform to the elements of the matrix parameter. |
void |
setTranslation(Point2D p)
Modifier method that sets the matrix transform to 1 0 p.x / 0 1 p.y / 0 0 1 |
Transform2D |
sub(Transform2D other)
Returns the difference of the matrix elements of this Transform2D object (minuend) and the parameter (subtrahend) by calling Matrix2D's sub method. |
java.lang.String |
toString()
Relays a call to Matrix2D.toString() back to the client |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Transform2D()
public Transform2D(Transform2D.Type kind)
public Transform2D(Matrix2D matrix2D)
public Transform2D(Transform2D transform2D)
Method Detail |
---|
public void setTransform2D(Matrix2D matrix2D)
matrix2D
- the matrix containing the new elements of the transformpublic Matrix2D getTransform2D()
public void setTranslation(Point2D p)
p
- the (p.x,p.y) translationpublic void setScale(double s)
s
- the scale factorpublic void setRotation(double a)
a
- the angle of rotationpublic Transform2D add(Transform2D other)
other
- the addendpublic Transform2D sub(Transform2D other)
other
- the subtrahendpublic Transform2D mul(Transform2D other)
other
- the multiplierpublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |