OpenLexocad  27.1
Base::Matrix4D Class Reference

#include <Matrix.h>

Public Member Functions

 Matrix4D (void)
 Default constructor. More...
 
 Matrix4D (float a11, float a12, float a13, float a14, float a21, float a22, float a23, float a24, float a31, float a32, float a33, float a34, float a41, float a42, float a43, float a44)
 Construction. More...
 
 Matrix4D (double a11, double a12, double a13, double a14, double a21, double a22, double a23, double a24, double a31, double a32, double a33, double a34, double a41, double a42, double a43, double a44)
 Construction. More...
 
 Matrix4D (const Matrix4D &rclMtrx)
 Construction. More...
 
 Matrix4D (const Vector3f &rclBase, const Vector3f &rclDir, float fAngle)
 Construction with an Axis. More...
 
 Matrix4D (const Vector3d &rclBase, const Vector3d &rclDir, double fAngle)
 
 ~Matrix4D ()
 Destruction. More...
 
void getMatrix (double dMtrx[16]) const
 
void setMatrix (const double dMtrx[16])
 
void getGLMatrix (double dMtrx[16]) const
 get the matrix in OpenGL style More...
 
void setGLMatrix (const double dMtrx[16])
 set the matrix in OpenGL style More...
 
unsigned long getMemSpace (void)
 
void Print (void) const
 
std::string toString (void) const
 write the 16 double of the matrix into a string More...
 
void fromString (const std::string &str)
 read the 16 double of the matrix from a string More...
 
Operators
Matrix4D operator+ (const Matrix4D &rclMtrx) const
 Matrix addition. More...
 
Matrix4Doperator+= (const Matrix4D &rclMtrx)
 
Matrix4D operator - (const Matrix4D &rclMtrx) const
 Matrix subtraction. More...
 
Matrix4Doperator -= (const Matrix4D &rclMtrx)
 
Matrix4Doperator *= (const Matrix4D &rclMtrx)
 Matrix multiplication. More...
 
Matrix4Doperator= (const Matrix4D &rclMtrx)
 Assignment. More...
 
Matrix4D operator * (const Matrix4D &rclMtrx) const
 Matrix multiplication. More...
 
Vector3f operator * (const Vector3f &rclVct) const
 Multiplication matrix with vector. More...
 
Vector3d operator * (const Vector3d &rclVct) const
 
void multVec (const Vector3d &src, Vector3d &dst) const
 
void multVec (const Vector3f &src, Vector3f &dst) const
 
bool operator != (const Matrix4D &rclMtrx) const
 Comparison. More...
 
bool operator== (const Matrix4D &rclMtrx) const
 Comparison. More...
 
double * operator [] (unsigned short usNdx)
 Index operator. More...
 
const double * operator[] (unsigned short usNdx) const
 Index operator. More...
 
double determinant () const
 Compute the determinant of the matrix. More...
 
std::string analyse (void) const
 Analyse the transformation. More...
 
Matrix4DOuter (const Vector3f &rV1, const Vector3f &rV2)
 Outer product (Dyadic product) More...
 
Matrix4DOuter (const Vector3d &rV1, const Vector3d &rV2)
 
Matrix4DHat (const Vector3f &rV)
 Hat operator (skew symmetric) More...
 
Matrix4DHat (const Vector3d &rV)
 
Manipulation
void setToUnity (void)
 Makes unity matrix. More...
 
void nullify (void)
 Makes a null matrix. More...
 
void move (float x, float y, float z)
 moves the coordinatesystem for the x,y,z value More...
 
void move (double x, double y, double z)
 
void move (const Vector3f &rclVct)
 moves the coordinatesystem for the vector More...
 
void move (const Vector3d &rclVct)
 
void scale (float x, float y, float z)
 scale for the vector More...
 
void scale (double x, double y, double z)
 
void scale (const Vector3f &rclVct)
 scale for the x,y,z value More...
 
void scale (const Vector3d &rclVct)
 
int hasScale (double tol=0.0) const
 Check for scaling factor, 0: not scale, 1: uniform scale, or else -1. More...
 
void rotX (double fAngle)
 Rotate around the X axis (in transformed space) for the given value in radians. More...
 
void rotY (double fAngle)
 Rotate around the Y axis (in transformed space) for the given value in radians. More...
 
void rotZ (double fAngle)
 Rotate around the Z axis (in transformed space) for the given value in radians. More...
 
void rotLine (const Vector3f &rclVct, float fAngle)
 Rotate around an arbitrary axis passing the origin in radians. More...
 
void rotLine (const Vector3d &rclVct, double fAngle)
 Rotate around an arbitrary axis passing the origin in radians. More...
 
void rotLine (const Vector3f &rclBase, const Vector3f &rclDir, float fAngle)
 Rotate around an arbitrary axis that needn't necessarily pass the origin in radians. More...
 
void rotLine (const Vector3d &rclBase, const Vector3d &rclDir, double fAngle)
 Rotate around an arbitrary axis that needn't necessarily pass the origin in radians. More...
 
bool toAxisAngle (Vector3f &rclBase, Vector3f &rclDir, float &fAngle, float &fTranslation) const
 Extract the rotation axis and angle. Therefore the 3x3 submatrix must be orthogonal. More...
 
bool toAxisAngle (Vector3d &rclBase, Vector3d &rclDir, double &fAngle, double &fTranslation) const
 
void transform (const Vector3f &rclVct, const Matrix4D &rclMtrx)
 transform (move,scale,rotate) around a point More...
 
void transform (const Vector3d &rclVct, const Matrix4D &rclMtrx)
 
void inverse (void)
 Matrix is expected to have a 3x3 rotation submatrix. More...
 
void inverseOrthogonal (void)
 Matrix is expected to have a 3x3 rotation submatrix. More...
 
void inverseGauss (void)
 Arbitrary, non-singular matrix. More...
 
void transpose (void)
 

Detailed Description

The Matrix4D class.

Constructor & Destructor Documentation

◆ Matrix4D() [1/6]

Base::Matrix4D::Matrix4D ( void  )

Default constructor.

Initialises to an identity matrix

◆ Matrix4D() [2/6]

Base::Matrix4D::Matrix4D ( float  a11,
float  a12,
float  a13,
float  a14,
float  a21,
float  a22,
float  a23,
float  a24,
float  a31,
float  a32,
float  a33,
float  a34,
float  a41,
float  a42,
float  a43,
float  a44 
)

Construction.

◆ Matrix4D() [3/6]

Base::Matrix4D::Matrix4D ( double  a11,
double  a12,
double  a13,
double  a14,
double  a21,
double  a22,
double  a23,
double  a24,
double  a31,
double  a32,
double  a33,
double  a34,
double  a41,
double  a42,
double  a43,
double  a44 
)

Construction.

◆ Matrix4D() [4/6]

Base::Matrix4D::Matrix4D ( const Matrix4D rclMtrx)

Construction.

◆ Matrix4D() [5/6]

Base::Matrix4D::Matrix4D ( const Vector3f rclBase,
const Vector3f rclDir,
float  fAngle 
)

Construction with an Axis.

◆ Matrix4D() [6/6]

Base::Matrix4D::Matrix4D ( const Vector3d rclBase,
const Vector3d rclDir,
double  fAngle 
)

◆ ~Matrix4D()

Base::Matrix4D::~Matrix4D ( )
inline

Destruction.

Member Function Documentation

◆ analyse()

std::string Base::Matrix4D::analyse ( void  ) const

Analyse the transformation.

◆ determinant()

double Base::Matrix4D::determinant ( ) const

Compute the determinant of the matrix.

◆ fromString()

void Base::Matrix4D::fromString ( const std::string &  str)

read the 16 double of the matrix from a string

◆ getGLMatrix()

void Base::Matrix4D::getGLMatrix ( double  dMtrx[16]) const

get the matrix in OpenGL style

◆ getMatrix()

void Base::Matrix4D::getMatrix ( double  dMtrx[16]) const

◆ getMemSpace()

unsigned long Base::Matrix4D::getMemSpace ( void  )

◆ hasScale()

int Base::Matrix4D::hasScale ( double  tol = 0.0) const

Check for scaling factor, 0: not scale, 1: uniform scale, or else -1.

◆ Hat() [1/2]

Matrix4D& Base::Matrix4D::Hat ( const Vector3f rV)

Hat operator (skew symmetric)

◆ Hat() [2/2]

Matrix4D& Base::Matrix4D::Hat ( const Vector3d rV)

◆ inverse()

void Base::Matrix4D::inverse ( void  )

Matrix is expected to have a 3x3 rotation submatrix.

◆ inverseGauss()

void Base::Matrix4D::inverseGauss ( void  )

Arbitrary, non-singular matrix.

◆ inverseOrthogonal()

void Base::Matrix4D::inverseOrthogonal ( void  )

Matrix is expected to have a 3x3 rotation submatrix.

◆ move() [1/4]

void Base::Matrix4D::move ( float  x,
float  y,
float  z 
)
inline

moves the coordinatesystem for the x,y,z value

◆ move() [2/4]

void Base::Matrix4D::move ( double  x,
double  y,
double  z 
)
inline

◆ move() [3/4]

void Base::Matrix4D::move ( const Vector3f rclVct)

moves the coordinatesystem for the vector

◆ move() [4/4]

void Base::Matrix4D::move ( const Vector3d rclVct)

◆ multVec() [1/2]

void Base::Matrix4D::multVec ( const Vector3d src,
Vector3d dst 
) const
inline

◆ multVec() [2/2]

void Base::Matrix4D::multVec ( const Vector3f src,
Vector3f dst 
) const
inline

◆ nullify()

void Base::Matrix4D::nullify ( void  )

Makes a null matrix.

◆ operator !=()

bool Base::Matrix4D::operator != ( const Matrix4D rclMtrx) const
inline

Comparison.

◆ operator *() [1/3]

Matrix4D Base::Matrix4D::operator * ( const Matrix4D rclMtrx) const
inline

Matrix multiplication.

◆ operator *() [2/3]

Vector3f Base::Matrix4D::operator * ( const Vector3f rclVct) const
inline

Multiplication matrix with vector.

◆ operator *() [3/3]

Vector3d Base::Matrix4D::operator * ( const Vector3d rclVct) const
inline

◆ operator *=()

Matrix4D & Base::Matrix4D::operator *= ( const Matrix4D rclMtrx)
inline

Matrix multiplication.

◆ operator -()

Matrix4D Base::Matrix4D::operator - ( const Matrix4D rclMtrx) const
inline

Matrix subtraction.

◆ operator -=()

Matrix4D & Base::Matrix4D::operator -= ( const Matrix4D rclMtrx)
inline

◆ operator []()

double* Base::Matrix4D::operator [] ( unsigned short  usNdx)
inline

Index operator.

◆ operator+()

Matrix4D Base::Matrix4D::operator+ ( const Matrix4D rclMtrx) const
inline

Matrix addition.

◆ operator+=()

Matrix4D & Base::Matrix4D::operator+= ( const Matrix4D rclMtrx)
inline

◆ operator=()

Matrix4D & Base::Matrix4D::operator= ( const Matrix4D rclMtrx)
inline

Assignment.

◆ operator==()

bool Base::Matrix4D::operator== ( const Matrix4D rclMtrx) const
inline

Comparison.

◆ operator[]()

const double * Base::Matrix4D::operator[] ( unsigned short  usNdx) const
inline

Index operator.

◆ Outer() [1/2]

Matrix4D& Base::Matrix4D::Outer ( const Vector3f rV1,
const Vector3f rV2 
)

Outer product (Dyadic product)

◆ Outer() [2/2]

Matrix4D& Base::Matrix4D::Outer ( const Vector3d rV1,
const Vector3d rV2 
)

◆ Print()

void Base::Matrix4D::Print ( void  ) const

◆ rotLine() [1/4]

void Base::Matrix4D::rotLine ( const Vector3f rclVct,
float  fAngle 
)

Rotate around an arbitrary axis passing the origin in radians.

◆ rotLine() [2/4]

void Base::Matrix4D::rotLine ( const Vector3d rclVct,
double  fAngle 
)

Rotate around an arbitrary axis passing the origin in radians.

◆ rotLine() [3/4]

void Base::Matrix4D::rotLine ( const Vector3f rclBase,
const Vector3f rclDir,
float  fAngle 
)

Rotate around an arbitrary axis that needn't necessarily pass the origin in radians.

◆ rotLine() [4/4]

void Base::Matrix4D::rotLine ( const Vector3d rclBase,
const Vector3d rclDir,
double  fAngle 
)

Rotate around an arbitrary axis that needn't necessarily pass the origin in radians.

◆ rotX()

void Base::Matrix4D::rotX ( double  fAngle)

Rotate around the X axis (in transformed space) for the given value in radians.

◆ rotY()

void Base::Matrix4D::rotY ( double  fAngle)

Rotate around the Y axis (in transformed space) for the given value in radians.

◆ rotZ()

void Base::Matrix4D::rotZ ( double  fAngle)

Rotate around the Z axis (in transformed space) for the given value in radians.

◆ scale() [1/4]

void Base::Matrix4D::scale ( float  x,
float  y,
float  z 
)
inline

scale for the vector

◆ scale() [2/4]

void Base::Matrix4D::scale ( double  x,
double  y,
double  z 
)
inline

◆ scale() [3/4]

void Base::Matrix4D::scale ( const Vector3f rclVct)

scale for the x,y,z value

◆ scale() [4/4]

void Base::Matrix4D::scale ( const Vector3d rclVct)

◆ setGLMatrix()

void Base::Matrix4D::setGLMatrix ( const double  dMtrx[16])

set the matrix in OpenGL style

◆ setMatrix()

void Base::Matrix4D::setMatrix ( const double  dMtrx[16])

◆ setToUnity()

void Base::Matrix4D::setToUnity ( void  )

Makes unity matrix.

◆ toAxisAngle() [1/2]

bool Base::Matrix4D::toAxisAngle ( Vector3f rclBase,
Vector3f rclDir,
float &  fAngle,
float &  fTranslation 
) const

Extract the rotation axis and angle. Therefore the 3x3 submatrix must be orthogonal.

◆ toAxisAngle() [2/2]

bool Base::Matrix4D::toAxisAngle ( Vector3d rclBase,
Vector3d rclDir,
double &  fAngle,
double &  fTranslation 
) const

◆ toString()

std::string Base::Matrix4D::toString ( void  ) const

write the 16 double of the matrix into a string

◆ transform() [1/2]

void Base::Matrix4D::transform ( const Vector3f rclVct,
const Matrix4D rclMtrx 
)

transform (move,scale,rotate) around a point

◆ transform() [2/2]

void Base::Matrix4D::transform ( const Vector3d rclVct,
const Matrix4D rclMtrx 
)

◆ transpose()

void Base::Matrix4D::transpose ( void  )

The documentation for this class was generated from the following file: