1 #ifndef SimTK_SimTKCOMMON_TRANSFORM_H
2 #define SimTK_SimTKCOMMON_TRANSFORM_H
140 { p_BF += offset_B;
return *
this; }
146 { p_BF -= offset_B;
return *
this; }
181 return Transform_( R_BF * X_FY.
R(), p_BF + R_BF * X_FY.
p() );
276 tmp.template updSubMat<3,4>(0,0) =
asMat34();
306 class InverseTransform_ {
348 return Transform_<P>( ~R_FB * X_FY.R(), ~R_FB *(X_FY.p() - p_FB) );
408 template <
class P,
int S>
inline Vec<3,P>
411 template <
class P,
int S>
inline Vec<3,P>
413 {
return X_BF.shiftFrameStationToBase(s_F); }
414 template <
class P,
int S>
inline Vec<3,P>
417 template <
class P,
int S>
inline Vec<3,P>
423 template <
class P,
int S>
inline Transform_<P>
444 template <
class P,
int S>
inline Vec<4,P>
446 assert(a_F[3]==0 || a_F[3]==1);
455 template <
class P,
int S>
inline Vec<4,P>
457 assert(a_F[3]==0 || a_F[3]==1);
461 if( a_F[3] == 0 ) {
Vec<3,P>::updAs(&out[0]) = X_BF.xformFrameVecToBase(v_F); out[3] = 0; }
462 else {
Vec<3,P>::updAs(&out[0]) = X_BF.shiftFrameStationToBase(v_F); out[3] = 1; }
465 template <
class P,
int S>
inline Vec<4,P>
467 template <
class P,
int S>
inline Vec<4,P>
474 template <
class P,
class E>
inline Vector_<E>
477 for (
int i = 0; i < v.
size(); ++i)
484 for (
int i = 0; i < v.
size(); ++i)
488 template <
class P,
class E>
inline RowVector_<E>
491 for (
int i = 0; i < v.
size(); ++i)
495 template <
class P,
class E>
inline RowVector_<E>
498 for (
int i = 0; i < v.
size(); ++i)
502 template <
class P,
class E>
inline Matrix_<E>
505 for (
int i = 0; i < v.
nrow(); ++i)
506 for (
int j = 0; j < v.
ncol(); ++j)
507 result(i, j) = X*v(i, j);
510 template <
class P,
class E>
inline Matrix_<E>
513 for (
int i = 0; i < v.
nrow(); ++i)
514 for (
int j = 0; j < v.
ncol(); ++j)
515 result(i, j) = X*v(i, j);
518 template <
class P,
int N,
class E,
int S>
inline Vec<N,E>
521 for (
int i = 0; i < N; ++i)
525 template <
class P,
int N,
class E,
int S>
inline Vec<N,E>
528 for (
int i = 0; i < N; ++i)
532 template <
class P,
int N,
class E,
int S>
inline Row<N,E>
535 for (
int i = 0; i < N; ++i)
539 template <
class P,
int N,
class E,
int S>
inline Row<N,E>
542 for (
int i = 0; i < N; ++i)
546 template <
class P,
int M,
int N,
class E,
int CS,
int RS>
inline Mat<M,N,E>
549 for (
int i = 0; i < M; ++i)
550 for (
int j = 0; j < N; ++j)
551 result(i, j) = X*v(i, j);
554 template <
class P,
int M,
int N,
class E,
int CS,
int RS>
inline Mat<M,N,E>
557 for (
int i = 0; i < M; ++i)
558 for (
int j = 0; j < N; ++j)
559 result(i, j) = X*v(i, j);
565 template <
class P>
inline Transform_<P>&
576 return Transform_<P>( R_BF * X_FY.R(), p_BF + R_BF * X_FY.p() );
586 template <
class P>
inline Transform_<P>
588 template <
class P>
inline Transform_<P>
594 template <
class P>
inline bool
596 template <
class P>
inline bool
598 template <
class P>
inline bool
600 template <
class P>
inline bool
606 operator<<(std::ostream&, const Transform_<P>&);
610 operator<<(std::ostream&, const InverseTransform_<P>&);
618 #endif // SimTK_SimTKCOMMON_TRANSFORM_H
#define SimTK_SimTKCOMMON_EXPORT
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:202
----------------------------------------------------------------------------- This InverseRotation cl...
Definition: Rotation.h:47
This file defines the client side of the SimTK::Matrix classes, which hold medium to large...
This is the Vector class intended to appear in user code.
Definition: BigMatrix.h:186
This class is a Vec3 plus an ironclad guarantee either that:
Definition: UnitVec.h:40
This is a dataless rehash of the MatrixBase class to specialize it for RowVectors.
Definition: BigMatrix.h:177
static Vec & updAs(ELT *p)
Recast a writable ordinary C++ array E[] to a writable Vec<M,E,S>; assumes compatible length...
Definition: Vec.h:853
static const Mat & getAs(const ELT *p)
Definition: Mat.h:1033
The Rotation class is a Mat33 that guarantees that the matrix is a legitimate 3x3 array associated wi...
Definition: Quaternion.h:40
int size() const
Definition: BigMatrix.h:1411
negator<N>, where N is a number type (real, complex, conjugate), is represented in memory identically...
Definition: String.h:44
bool operator==(const PhiMatrix &p1, const PhiMatrix &p2)
Definition: SpatialAlgebra.h:774
Declares and defines the UnitVec and UnitRow classes.
int nrow() const
Return the number of rows m in the logical shape of this matrix.
Definition: BigMatrix.h:288
void setToNaN()
Set every scalar in this Vec to NaN; this is the default initial value in Debug builds, but not in Release.
Definition: Vec.h:757
Matrix_< E > operator*(const MatrixBase< E > &l, const typename CNT< E >::StdNumber &r)
Definition: BigMatrix.h:2685
This file is the user-includeable header to be included in user programs to provide fixed-length Vec ...
int size() const
Definition: BigMatrix.h:1690
This is the Matrix class intended to appear in user code.
Definition: BigMatrix.h:181
Generic Row.
Definition: Row.h:118
Transform_< double > dTransform
Definition: Transform.h:48
This is a dataless rehash of the MatrixBase class to specialize it for Vectors.
Definition: BigMatrix.h:176
RowVectors are much less common than Vectors.
Definition: BigMatrix.h:191
This class represents a small matrix whose size is known at compile time, containing elements of any ...
Definition: Mat.h:51
Variable-size 2d matrix of Composite Numerical Type (ELT) elements.
Definition: BigMatrix.h:175
int ncol() const
Return the number of columns n in the logical shape of this matrix.
Definition: BigMatrix.h:290
Transform_< float > fTransform
Definition: Transform.h:47
Transform_< Real > Transform
Definition: Transform.h:44
static const Vec & getAs(const ELT *p)
Recast an ordinary C++ array E[] to a const Vec<M,E,S>; assumes compatible length, stride, and packing.
Definition: Vec.h:849