FreeCAD C++
Public Member Functions | List of all members
Base::Matrix4D Class Reference

#include <Base/Matrix.h>

Detailed Description

The Matrix4D class.

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.
 
 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 (const Matrix4D &rclMtrx)
 Construction.
 
 Matrix4D (const Vector3f &rclBase, const Vector3f &rclDir, float fAngle)
 Construction with an Axis.
 
 ~Matrix4D ()
 Destruction.
 
void getGLMatrix (double dMtrx[16]) const
 get the matrix in OpenGL style
 
void setGLMatrix (const double dMtrx[16])
 set the matrix in OpenGL style
 
std::string toString (void) const
 write the 16 double of the matrix into a string
 
void fromString (const std::string &str)
 read the 16 double of the matrix from a string
 
Operators
Matrix4D operator+ (const Matrix4D &rclMtrx) const
 Matrix addition.
 
Matrix4Doperator+= (const Matrix4D &rclMtrx)
 
Matrix4D operator - (const Matrix4D &rclMtrx) const
 Matrix subtraction.
 
Matrix4Doperator -= (const Matrix4D &rclMtrx)
 
Matrix4Doperator *= (const Matrix4D &rclMtrx)
 Matrix multiplication.
 
Matrix4Doperator= (const Matrix4D &rclMtrx)
 Assignment.
 
Matrix4D operator * (const Matrix4D &rclMtrx) const
 Matrix multiplication.
 
Vector3f operator * (const Vector3f &rclVct) const
 Multiplication matrix with vector.
 
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.
 
bool operator== (const Matrix4D &rclMtrx) const
 Comparison.
 
double * operator [] (unsigned short usNdx)
 Index operator.
 
const double * operator[] (unsigned short usNdx) const
 Index operator.
 
double determinant () const
 Compute the determinant of the matrix.
 
std::string analyse (void) const
 Analyse the transformation.
 
Matrix4DOuter (const Vector3f &rV1, const Vector3f &rV2)
 Outer product (Dyadic product)
 
Matrix4DOuter (const Vector3d &rV1, const Vector3d &rV2)
 
Matrix4DHat (const Vector3f &rV)
 Hat operator (skew symmetric)
 
Matrix4DHat (const Vector3d &rV)
 
Manipulation
void setToUnity (void)
 Makes unity matrix.
 
void nullify (void)
 Makes a null matrix.
 
void move (float x, float y, float z)
 moves the coordinatesystem for the x,y,z value
 
void move (double x, double y, double z)
 
void move (const Vector3f &rclVct)
 moves the coordinatesystem for the vector
 
void move (const Vector3d &rclVct)
 
void scale (float x, float y, float z)
 scale for the vector
 
void scale (double x, double y, double z)
 
void scale (const Vector3f &rclVct)
 scale for the x,y,z value
 
void scale (const Vector3d &rclVct)
 
void rotX (double fAngle)
 Rotate around the X axis (in transformed space) for the given value in radians.
 
void rotY (double fAngle)
 Rotate around the Y axis (in transformed space) for the given value in radians.
 
void rotZ (double fAngle)
 Rotate around the Z axis (in transformed space) for the given value in radians.
 
void rotLine (const Vector3f &rclVct, float fAngle)
 Rotate around an arbitrary axis passing the origin in radians.
 
void rotLine (const Vector3d &rclVct, double fAngle)
 Rotate around an arbitrary axis passing the origin in radians.
 
void rotLine (const Vector3f &rclBase, const Vector3f &rclDir, float fAngle)
 Rotate around an arbitrary axis that needn't necessarily pass the origin in radians.
 
void rotLine (const Vector3d &rclBase, const Vector3d &rclDir, double fAngle)
 Rotate around an arbitrary axis that needn't necessarily pass the origin in radians.
 
bool toAxisAngle (Vector3f &rclBase, Vector3f &rclDir, float &fAngle, float &fTranslation) const
 Extract the rotation axis and angle. Therefore the 3x3 submatrix must be orthogonal.
 
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
 
void transform (const Vector3d &rclVct, const Matrix4D &rclMtrx)
 
void inverse (void)
 Matrix is expected to have a 3x3 rotation submatrix.
 
void inverseOrthogonal (void)
 Matrix is expected to have a 3x3 rotation submatrix.
 
void inverseGauss (void)
 Arbitrary, non-singular matrix.
 
void transpose (void)
 

Constructor & Destructor Documentation

◆ Matrix4D()

Base::Matrix4D::Matrix4D ( void  )

Default constructor.

Initialises to an identity matrix