public class RigidTransformer extends GeometryTransformer
[ p' ] [ p ] [ RF pf ] [ ] = T [ ], T = [ ] [ 1 ] [ 1 ] [ 0 1 ]where R is a 3 X 3 rotation matrix and pf is an offset vector.
GeometryTransformer.Constrainer, GeometryTransformer.UndoState, GeometryTransformer.UniformScalingConstrainer
Constructor and Description |
---|
RigidTransformer(RigidTransform3d T)
Creates a new RigidTransformer from a specified rigid transform.
|
Modifier and Type | Method and Description |
---|---|
void |
computeLocalTransforms(Matrix3d PL,
Vector3d Ndiag,
RigidTransform3d T)
Computes the matrices
PL and N that transform
points xl local to a coordinate frame T after
that frame is itself transformed. |
void |
computeTransform(AffineTransform3d XR,
AffineTransform3d X)
Transforms an affine transform
X and returns the result in
XR . |
void |
computeTransform(Matrix3d MR,
Matrix3d M,
Vector3d r)
Transforms a general 3 X 3 matrix
M ,
and returns the result in MR . |
void |
computeTransform(Plane pr,
Plane p,
Vector3d r)
Transforms a plane
p and returns the result in
pr . |
void |
computeTransform(RigidTransform3d TR,
RigidTransform3d T)
Transforms a rigid transform
T and returns the result in
TR . |
void |
computeTransform(RotationMatrix3d RR,
Vector3d Ndiag,
RotationMatrix3d R,
Vector3d r)
Transforms a rotation matrix
R and returns the result in
RR . |
void |
computeTransformNormal(Vector3d nr,
Vector3d n,
Vector3d r)
Transforms a normal vector
n , and returns the result in
nr . |
void |
computeTransformPnt(Point3d pr,
Point3d p)
Transforms a point
p and returns the result in
pr . |
void |
computeTransformVec(Vector3d vr,
Vector3d v,
Vector3d r)
Transforms a vector
v , and returns the result in
vr . |
RigidTransformer |
getInverse()
Returns a transformer that implements the inverse operation of this
transformer.
|
boolean |
isAffine()
Returns
true , since a rigid transform is a special case of
an affine transform. |
boolean |
isInvertible()
Returns
true , since this transformer is invertible. |
boolean |
isReflecting()
Returns
false , since a rigid transform cannot be
reflecting. |
boolean |
isRigid()
Returns
true , since this transformer does implement a linear
rigid transform. |
computeLinearizedTransform, computeLocalAffineTransform, computeTransform, create, getUndoDataSize, isRestoring, isSaving, popRestoreData, restoreObject, saveObject, setUndoState, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transformNormal, transformNormal, transformPnt, transformPnt, transformVec, transformVec, transformWorld, transformWorld
public RigidTransformer(RigidTransform3d T)
T
- rigid transform defining the transformationpublic boolean isRigid()
true
, since this transformer does implement a linear
rigid transform.isRigid
in class GeometryTransformer
public boolean isAffine()
true
, since a rigid transform is a special case of
an affine transform.isAffine
in class GeometryTransformer
public boolean isInvertible()
true
, since this transformer is invertible.isInvertible
in class GeometryTransformer
public boolean isReflecting()
false
, since a rigid transform cannot be
reflecting.isReflecting
in class GeometryTransformer
public RigidTransformer getInverse()
getInverse
in class GeometryTransformer
public void computeTransformPnt(Point3d pr, Point3d p)
p
and returns the result in
pr
. The transform is computed according to
pr = RF p + 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 pointp
- point to be transformedpublic void computeTransformVec(Vector3d vr, Vector3d v, Vector3d r)
v
, and returns the result in
vr
.
The reference position r
is ignored since rigid transforms
are position invariant.
The transform is computed according to
vr = RF vThis 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 vectorv
- vector to be transformedr
- reference position of the vector (ignored)public void computeLocalTransforms(Matrix3d PL, Vector3d Ndiag, RigidTransform3d T)
PL
and N
that transform
points xl
local to a coordinate frame T
after
that frame is itself transformed. For rigid transforms, N
is always the identity, and the updated local coordinates are
given by
xl' = PL xlwhere
PL
is symmetric positive definite. See the
documentation for GeometryTransformer.computeLocalTransforms(maspack.matrix.Matrix3d, maspack.matrix.Vector3d, maspack.matrix.RigidTransform3d)
.computeLocalTransforms
in class GeometryTransformer
PL
- primary transformation matrixNdiag
- if non-null, returns the diagonal components of N
(which will be all ones)T
- rigid transform for which the local transforms are computedpublic void computeTransformNormal(Vector3d nr, Vector3d n, Vector3d r)
n
, and returns the result in
nr
.
The reference position r
is ignored since rigid transforms
are position invariant.
The transform is computed according to
nr = RF nThis method provides the low level implementation for normal transformations and does not do any saving or restoring of data.
computeTransformNormal
in class GeometryTransformer
nr
- transformed normaln
- normal to be transformedr
- reference position of the normal (ignored)public void computeTransform(RigidTransform3d TR, RigidTransform3d T)
T
and returns the result in
TR
. This provides the low level implementation for the
transformation of rigid transforms and does not do any saving or
restoring of data.TR
- transformed transformT
- transform to be transformedpublic void computeTransform(AffineTransform3d XR, AffineTransform3d X)
X
and returns the result in
XR
. If
[ A p ] X = [ ] [ 0 1 ]the transform is computed according to
[ RF A RF p + 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 transformX
- transform to be transformedpublic void computeTransform(RotationMatrix3d RR, Vector3d Ndiag, RotationMatrix3d R, Vector3d r)
R
and returns the result in
RR
.
The reference position r
is ignored since rigid transforms
are position invariant.
The transform is computed according to
RR = RF RThis 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 rotationR
- rotation to be transformedr
- reference position of the rotation (ignored)Ndiag
- if non-null, returns the diagonal elements of the
matrix N
public void computeTransform(Matrix3d MR, Matrix3d M, Vector3d r)
M
,
and returns the result in MR
.
The reference position r
is ignored since rigid transforms
are position invariant.
The transform is computed according to
MR = RF MThis 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 matrixM
- matrix to be transformedr
- reference position of the matrix (ignored)public void computeTransform(Plane pr, Plane p, Vector3d r)
p
and returns the result in
pr
.
The reference position r
is ignored since rigid transforms
are position invariant.
Assume that p
is defined by a normal n
and offset o
such that all planar points x
satisfy
n^T x = oThen the transformed normal
nr
and offset or
are computed according to
nr = RF n or = o + nr^T pfThis 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 planep
- plane to be transformedr
- reference position of the plane (ignored)