CVB++ 14.0
AffineMatrix3D Class Referencefinal

Affine transformation matrix for 3D. More...

#include <cvb/affine_matrix_3d.hpp>

Public Member Functions

 AffineMatrix3D () noexcept=default
 Default constructor for empty transformation. More...
 
 AffineMatrix3D (Matrix3D matrix, Vector3D< double > translation) noexcept
 Defines a transformation. More...
 
Matrix3D Matrix () const noexcept
 Gets the matrix part of the transformation. More...
 
void SetMatrix (Matrix3D matrix) noexcept
 Sets the matrix part of the transformation. More...
 
Vector3D< double > Translation () const noexcept
 Gets the translation part of the transformation. More...
 
void SetTranslation (Vector3D< double > translation) noexcept
 Sets the translation part of the transformation. More...
 
bool IsTranslation () const noexcept
 Checks if this transformation describes a translation. More...
 
double Det () const
 Transformation determinant. More...
 
void Invert ()
 Inverts this transformation if possible. More...
 
bool operator== (const AffineMatrix3D &transformation) const noexcept
 Compares to an other transformation. More...
 
bool operator!= (const AffineMatrix3D &transformation) const noexcept
 Compares to an other transformation. More...
 
AffineMatrix3Doperator+= (const AffineMatrix3D &transformation) noexcept
 Adds and assigns to this affine matrix. More...
 
AffineMatrix3Doperator-= (const AffineMatrix3D &transformation) noexcept
 Subtracts and assigns to this transformation. More...
 
AffineMatrix3Doperator*= (const AffineMatrix3D &transformation)
 Multiplies and assigns to this transformation. More...
 
AffineMatrix3Doperator*= (const double &value) noexcept
 Multiplies and assigns to this transformation. More...
 
AffineMatrix3Doperator/= (const double &value) noexcept
 Divides each element of this transformation by the given value. More...
 

Static Public Member Functions

static AffineMatrix3D Identity () noexcept
 The identity element. More...
 

Related Functions

(Note that these are not member functions.)

AffineMatrix3D operator+ (const AffineMatrix3D &lhs, const AffineMatrix3D &rhs) noexcept
 Add two transformations. More...
 
AffineMatrix3D operator- (const AffineMatrix3D &lhs, const AffineMatrix3D &rhs) noexcept
 Subtract two transformations. More...
 
AffineMatrix3D operator* (const AffineMatrix3D &lhs, const AffineMatrix3D &rhs)
 Multiply two transformations. More...
 
AffineMatrix3D operator* (const AffineMatrix3D &lhs, const double &rhs) noexcept
 Multiply transformation with scalar. More...
 
AffineMatrix3D operator* (const double &lhs, const AffineMatrix3D &rhs) noexcept
 Multiply scalar with transformation. More...
 
AffineMatrix3D operator/ (const AffineMatrix3D &lhs, const double &rhs)
 Divide transformation by scalar. More...
 

Detailed Description

Affine transformation matrix for 3D.

This is a compact version of CVC3DMatrixH with the last row being { 0, 0, 0, 1 }. So no perspective transformation is possible, but translation, rotation and scaling is.

Examples
Foundation/CppMetricCalibration, Foundation/CppMetricCalibrationInclinationLaserPlane, and Foundation/CppMetricCalibrationRigidBodyTrafo.

Constructor & Destructor Documentation

◆ AffineMatrix3D() [1/2]

AffineMatrix3D ( )
defaultnoexcept

Default constructor for empty transformation.

Exceptions
Doesnot throw any exception.

◆ AffineMatrix3D() [2/2]

AffineMatrix3D ( Matrix3D  matrix,
Vector3D< double >  translation 
)
inlinenoexcept

Defines a transformation.

Parameters
[in]matrixRow-major 3x3 matrix for e.g. scaling or rotation.
[in]translationComputes the translation matrix
Exceptions
Doesnot throw any exception.

Member Function Documentation

◆ Det()

double Det ( ) const
inline

Transformation determinant.

Returns
The determinant.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ Identity()

static AffineMatrix3D Identity ( )
inlinestaticnoexcept

The identity element.

Returns
An identity transformation.
Exceptions
Doesnot throw any exception.

◆ Invert()

void Invert ( )
inline

Inverts this transformation if possible.

Exceptions
Anyexception derived from std::exception including CvbException.

Might cause division by zero.

◆ IsTranslation()

bool IsTranslation ( ) const
inlinenoexcept

Checks if this transformation describes a translation.

Returns
bool True if this transformation corresponds to a pure translation, false otherwise.
Exceptions
Doesnot throw any exception.

◆ Matrix()

Matrix3D Matrix ( ) const
inlinenoexcept

Gets the matrix part of the transformation.

Returns
The matrix.
Exceptions
Doesnot throw any exception.
Examples
Foundation/CppMetricCalibration, Foundation/CppMetricCalibrationInclinationLaserPlane, and Foundation/CppMetricCalibrationRigidBodyTrafo.

◆ operator!=()

bool operator!= ( const AffineMatrix3D transformation) const
inlinenoexcept

Compares to an other transformation.

Parameters
[in]transformationOther transformation.
Returns
True if not equal, otherwise false.
Exceptions
Doesnot throw any exception.

◆ operator*=() [1/2]

AffineMatrix3D & operator*= ( const AffineMatrix3D transformation)
inline

Multiplies and assigns to this transformation.

Parameters
[in]transformationOther transformation.
Returns
This transformation.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ operator*=() [2/2]

AffineMatrix3D & operator*= ( const double &  value)
inlinenoexcept

Multiplies and assigns to this transformation.

Parameters
[in]valueFactor.
Returns
This transformation.
Exceptions
Doesnot throw any exception.

◆ operator+=()

AffineMatrix3D & operator+= ( const AffineMatrix3D transformation)
inlinenoexcept

Adds and assigns to this affine matrix.

Parameters
[in]transformationOther transformation.
Returns
This transformation.
Exceptions
Doesnot throw any exception.

◆ operator-=()

AffineMatrix3D & operator-= ( const AffineMatrix3D transformation)
inlinenoexcept

Subtracts and assigns to this transformation.

Parameters
[in]transformationOther transformation.
Returns
This transformation.
Exceptions
Doesnot throw any exception.

◆ operator/=()

AffineMatrix3D & operator/= ( const double &  value)
inlinenoexcept

Divides each element of this transformation by the given value.

Parameters
[in]valueDivisor.
Returns
This transformation.
Exceptions
Doesnot throw any exception.

◆ operator==()

bool operator== ( const AffineMatrix3D transformation) const
inlinenoexcept

Compares to an other transformation.

Parameters
[in]transformationOther transformation.
Returns
True if equal, otherwise false.
Exceptions
Doesnot throw any exception.

◆ SetMatrix()

void SetMatrix ( Matrix3D  matrix)
inlinenoexcept

Sets the matrix part of the transformation.

Parameters
[in]matrixThe matrix.
Exceptions
Doesnot throw any exception.

◆ SetTranslation()

void SetTranslation ( Vector3D< double >  translation)
inlinenoexcept

Sets the translation part of the transformation.

Parameters
[in]translationThe 3D translation part.
Exceptions
Doesnot throw any exception.

◆ Translation()

Vector3D< double > Translation ( ) const
inlinenoexcept

Gets the translation part of the transformation.

Returns
The 3D translation part.
Exceptions
Doesnot throw any exception.
Examples
Foundation/CppMetricCalibration, Foundation/CppMetricCalibrationInclinationLaserPlane, and Foundation/CppMetricCalibrationRigidBodyTrafo.

Friends And Related Function Documentation

◆ operator*() [1/3]

AffineMatrix3D operator* ( const AffineMatrix3D lhs,
const AffineMatrix3D rhs 
)
related

Multiply two transformations.

Parameters
[in]lhsRight hand side transformation.
[in]rhsLeft hand side transformation.
Returns
The computation result.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ operator*() [2/3]

AffineMatrix3D operator* ( const AffineMatrix3D lhs,
const double &  rhs 
)
related

Multiply transformation with scalar.

Parameters
[in]lhsRight hand side transformation.
[in]rhsLeft hand side value.
Returns
The computation result.
Exceptions
Doesnot throw any exception.

◆ operator*() [3/3]

AffineMatrix3D operator* ( const double &  lhs,
const AffineMatrix3D rhs 
)
related

Multiply scalar with transformation.

Parameters
[in]lhsRight hand side value.
[in]rhsLeft hand side transformation.
Returns
The computation result.
Exceptions
Doesnot throw any exception.

◆ operator+()

AffineMatrix3D operator+ ( const AffineMatrix3D lhs,
const AffineMatrix3D rhs 
)
related

Add two transformations.

Parameters
[in]lhsRight hand side transformation.
[in]rhsLeft hand side transformation.
Returns
The computation result.
Exceptions
Doesnot throw any exception.

◆ operator-()

AffineMatrix3D operator- ( const AffineMatrix3D lhs,
const AffineMatrix3D rhs 
)
related

Subtract two transformations.

Parameters
[in]lhsRight hand side affine matrix.
[in]rhsLeft hand side affine matrix.
Returns
The computation result.
Exceptions
Doesnot throw any exception.

◆ operator/()

AffineMatrix3D operator/ ( const AffineMatrix3D lhs,
const double &  rhs 
)
related

Divide transformation by scalar.

Parameters
[in]lhsRight hand side transformation.
[in]rhsLeft hand side value.
Returns
The computation result.
Exceptions
Anyexception derived from std::exception including CvbException.