public class AffineTransformer extends GeometryTransformer
[ p' ] [ p ] [ F pf ] [ ] = X [ ], X = [ ] [ 1 ] [ 1 ] [ 0 1 ]where F is a general 3 X 3 matrix and pf is an offset vector.
GeometryTransformer.Constrainer, GeometryTransformer.UndoState, GeometryTransformer.UniformScalingConstrainer
Constructor and Description |
---|
AffineTransformer(AffineTransform3d X)
Creates a new AffineTransformer from a specified affine transform.
|
Modifier and Type | Method and Description |
---|---|
void |
computeTransform(AffineTransform3d XR,
AffineTransform3d X1)
Transforms an affine transform
X1 and returns the result in
XR . |
void |
computeTransform(Matrix3d MR,
Matrix3d M1,
Vector3d r)
Transforms a general 3 X 3 matrix
M1 , located at reference
position ref , and returns the result in MR . |
void |
computeTransform(Plane pr,
Plane p1,
Vector3d r)
Transforms a plane
p1 , located at reference position
ref , and returns the result in pr . |
void |
computeTransform(RigidTransform3d TR,
RigidTransform3d T1)
Transforms a rigid transform
T1 and returns the result in
TR . |
void |
computeTransform(RotationMatrix3d RR,
RotationMatrix3d R1,
Vector3d r)
Transforms a rotation matrix
R1 , located at reference
position ref , and returns the result in RR . |
void |
computeTransformPnt(Point3d pr,
Point3d p1)
Transforms a point
p1 and returns the result in
pr . |
void |
computeTransformVec(Vector3d vr,
Vector3d v1,
Vector3d r)
Transforms a vector
v1 , and returns the result in
vr . |
AffineTransformer |
getInverse()
Returns a transformer that implements the inverse operation of this
transformer.
|
boolean |
isAffine()
Returns
true , since this transformer does implement a
linear affine transform. |
boolean |
isInvertible()
Returns
true , since this transformer is invertible. |
boolean |
isRigid()
Returns
false , since this transformer does not implement a
linear rigid transform. |
computeLocalTransform, computeRightAffineTransform, computeTransform, create, isRestoring, isSaving, popRestoreData, restoreObject, saveObject, setUndoState, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transformPnt, transformPnt, transformVec, transformVec, transformWorld, transformWorld
public AffineTransformer(AffineTransform3d X)
X
- affine transform defining the transformationpublic boolean isRigid()
false
, since this transformer does not implement a
linear rigid transform.isRigid
in class GeometryTransformer
public boolean isAffine()
true
, since this transformer does implement a
linear affine transform.isAffine
in class GeometryTransformer
public boolean isInvertible()
true
, since this transformer is invertible.isInvertible
in class GeometryTransformer
public AffineTransformer getInverse()
getInverse
in class GeometryTransformer
public void computeTransformPnt(Point3d pr, Point3d p1)
p1
and returns the result in
pr
. The transform is computed according to
pr = F p1 + pfThis method provides the low level implementation for point transformations and does not do any saving or restoring of data.
computeTransformPnt
in class GeometryTransformer
pr
- transformed pointp1
- point to be transformedpublic void computeTransformVec(Vector3d vr, Vector3d v1, Vector3d r)
v1
, and returns the result in
vr
.
The transform is computed according to
vr = F v1The reference position is ignored since affine transforms are position invariant. This method provides the low level implementation for vector transformations and does not do any saving or restoring of data.
computeTransformVec
in class GeometryTransformer
vr
- transformed vectorv1
- vector to be transformedr
- reference position of the vector (ignored)public void computeTransform(RigidTransform3d TR, RigidTransform3d T1)
T1
and returns the result in
TR
. If
[ R1 p1 ] T1 = [ ] [ 0 1 ]the transform is computed according to
[ RF R1 F p1 + pf ] TR = [ ] [ 0 1 ]where PF RF = F is the left polar decomposition of F. This method provides the low level implementation for the transformation of rigid transforms and does not do any saving or restoring of data.
computeTransform
in class GeometryTransformer
TR
- transformed transformT1
- transform to be transformedpublic void computeTransform(AffineTransform3d XR, AffineTransform3d X1)
X1
and returns the result in
XR
. If
[ A1 p1 ] X1 = [ ] [ 0 1 ]the transform is computed according to
[ F A1 F p1 + pf ] XR = [ ] [ 0 1 ]This method provides the low level implementation for the transformation of affine transforms and does not do any saving or restoring of data.
computeTransform
in class GeometryTransformer
XR
- transformed transformX1
- transform to be transformedpublic void computeTransform(RotationMatrix3d RR, RotationMatrix3d R1, Vector3d r)
R1
, located at reference
position ref
, and returns the result in RR
.
The transform is computed according to
RR = RF R1where PF RF = F is the left polar decomposition of F. The reference position is ignored since affine transforms are position invariant. This method provides the low level implementation for the transformation of rotation matrices and does not do any saving or restoring of data.
computeTransform
in class GeometryTransformer
RR
- transformed rotationR1
- rotation to be transformedr
- reference position of the rotation (ignored)public void computeTransform(Matrix3d MR, Matrix3d M1, Vector3d r)
M1
, located at reference
position ref
, and returns the result in MR
.
The transform is computed according to
MR = F M1The reference position is ignored since affine transforms are position invariant. This method provides the low level implementation for the transformation of 3 X 3 matrices and does not do any saving or restoring of data.
computeTransform
in class GeometryTransformer
MR
- transformed matrixM1
- matrix to be transformedr
- reference position of the matrix (ignored)public void computeTransform(Plane pr, Plane p1, Vector3d r)
p1
, located at reference position
ref
, and returns the result in pr
.
Assume that p1
is defined by a normal n1
and offset o1
such that all planar points x
satisfy
n1^T x = o1Then the transformed normal
nr
and offset or
are computed according to
nr = inv(F)^T n1 or = o1 + nr^T pf mag = ||nr|| nr = nr/mag, or = or/magThe reference position is ignored since affine transforms are position invariant. This method provides the low level implementation for the transformation of planes and does not do any saving or restoring of data.
computeTransform
in class GeometryTransformer
pr
- transformed planep1
- plane to be transformedr
- reference position of the plane (ignored)