CVB++ 14.1
AffineMatrix2D Class Referencefinal

Compacted affine matrix describing the Common Vision Blox coordinate system. More...

#include <cvb/affine_matrix_2d.hpp>

Public Member Functions

 AffineMatrix2D () noexcept=default
 Default constructor for empty affine matrix. More...
 
 AffineMatrix2D (Cvb::Matrix2D matrix, Vector2D< double > translation) noexcept
 Define an affine matrix. More...
 
Cvb::Matrix2D Matrix () const noexcept
 Get the transformation part of the affine matrix. More...
 
void SetMatrix (Cvb::Matrix2D matrix) noexcept
 Set the transformation part of the affine matrix. More...
 
Vector2D< double > Translation () const noexcept
 Get the translation part of the affine matrix. More...
 
void SetTranslation (Vector2D< double > translation) noexcept
 Set the translation part of the affine matrix. More...
 
void Invert ()
 Invert this affine transformation in-place if possible. More...
 
AffineMatrix2D Inverse ()
 Gets the inverse of this affine transformation if possible. More...
 
bool IsTranslation () const noexcept
 Check if this affine matrix only describes a translation. More...
 
bool operator== (const AffineMatrix2D &affineMatrix) const noexcept
 Compares to an other matrix. More...
 
bool operator!= (const AffineMatrix2D &affineMatrix) const noexcept
 Compares to an other matrix. More...
 
AffineMatrix2Doperator+= (const AffineMatrix2D &affineMatrix) noexcept
 Adds and assigns to this affine matrix. More...
 
AffineMatrix2Doperator-= (const AffineMatrix2D &affineMatrix) noexcept
 Subtracts and assigns to this affine matrix. More...
 
AffineMatrix2Doperator*= (const AffineMatrix2D &affineMatrix) noexcept
 Multiplies and assigns to this affine matrix. More...
 
AffineMatrix2Doperator*= (const double &value) noexcept
 Multiplies and assigns to this affine matrix. More...
 
AffineMatrix2Doperator/= (const double &value) noexcept
 Divides each element of this affine matrix by the given value. More...
 

Static Public Member Functions

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

Related Functions

(Note that these are not member functions.)

AffineMatrix2D operator+ (const AffineMatrix2D &lhs, const AffineMatrix2D &rhs) noexcept
 Add two affine matrices. More...
 
AffineMatrix2D operator- (const AffineMatrix2D &lhs, const AffineMatrix2D &rhs) noexcept
 Subtract two affine matrices. More...
 
AffineMatrix2D operator* (const AffineMatrix2D &lhs, const AffineMatrix2D &rhs) noexcept
 Multiply two affine matrices. More...
 
Point2D< double > operator* (const AffineMatrix2D &lhs, const Point2D< double > &rhs) noexcept
 Multiply affine matrix with 2D point. More...
 
AffineMatrix2D operator* (const AffineMatrix2D &lhs, const double &rhs) noexcept
 Multiply affine matrix with scalar. More...
 
AffineMatrix2D operator* (const double &lhs, const AffineMatrix2D &rhs) noexcept
 Multiply scalar with affine matrix . More...
 
AffineMatrix2D operator/ (const AffineMatrix2D &lhs, const double &rhs)
 Divide affine matrix by scalar. More...
 

Detailed Description

Compacted affine matrix describing the Common Vision Blox coordinate system.

Constructor & Destructor Documentation

◆ AffineMatrix2D() [1/2]

AffineMatrix2D ( )
defaultnoexcept

Default constructor for empty affine matrix.

Exceptions
Doesnot throw any exception.

◆ AffineMatrix2D() [2/2]

AffineMatrix2D ( Cvb::Matrix2D  matrix,
Vector2D< double >  translation 
)
inlinenoexcept

Define an affine matrix.

Parameters
[in]matrixThe transformation part.
[in]translationThe translation part.
Exceptions
Doesnot throw any exception.

Member Function Documentation

◆ Identity()

static AffineMatrix2D Identity ( )
inlinestaticnoexcept

The identity element.

Returns
An identity matrix.
Exceptions
Doesnot throw any exception.

◆ Inverse()

AffineMatrix2D Inverse ( )
inline

Gets the inverse of this affine transformation if possible.

Exceptions
Anyexception derived from std::exception including CvbException.
Returns
Inverse.

Might cause division by zero.

◆ Invert()

void Invert ( )
inline

Invert this affine transformation in-place if possible.

Exceptions
Anyexception derived from std::exception including CvbException.

Might cause division by zero.

◆ IsTranslation()

bool IsTranslation ( ) const
inlinenoexcept

Check if this affine matrix only describes a translation.

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

◆ Matrix()

Cvb::Matrix2D Matrix ( ) const
inlinenoexcept

Get the transformation part of the affine matrix.

Returns
The transformation matrix.
Exceptions
Doesnot throw any exception.

◆ operator!=()

bool operator!= ( const AffineMatrix2D affineMatrix) const
inlinenoexcept

Compares to an other matrix.

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

◆ operator*=() [1/2]

AffineMatrix2D & operator*= ( const AffineMatrix2D affineMatrix)
inlinenoexcept

Multiplies and assigns to this affine matrix.

Parameters
[in]affineMatrixOther affine matrix.
Returns
This affine matrix.
Exceptions
Doesnot throw any exception.

◆ operator*=() [2/2]

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

Multiplies and assigns to this affine matrix.

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

◆ operator+=()

AffineMatrix2D & operator+= ( const AffineMatrix2D affineMatrix)
inlinenoexcept

Adds and assigns to this affine matrix.

Parameters
[in]affineMatrixOther affine matrix.
Returns
This affine matrix.
Exceptions
Doesnot throw any exception.

◆ operator-=()

AffineMatrix2D & operator-= ( const AffineMatrix2D affineMatrix)
inlinenoexcept

Subtracts and assigns to this affine matrix.

Parameters
[in]affineMatrixOther affine matrix.
Returns
This affine matrix.
Exceptions
Doesnot throw any exception.

◆ operator/=()

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

Divides each element of this affine matrix by the given value.

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

◆ operator==()

bool operator== ( const AffineMatrix2D affineMatrix) const
inlinenoexcept

Compares to an other matrix.

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

◆ SetMatrix()

void SetMatrix ( Cvb::Matrix2D  matrix)
inlinenoexcept

Set the transformation part of the affine matrix.

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

◆ SetTranslation()

void SetTranslation ( Vector2D< double >  translation)
inlinenoexcept

Set the translation part of the affine matrix.

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

◆ Translation()

Vector2D< double > Translation ( ) const
inlinenoexcept

Get the translation part of the affine matrix.

Returns
The 2D translation part.
Exceptions
Doesnot throw any exception.

Friends And Related Function Documentation

◆ operator*() [1/4]

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

Multiply two affine matrices.

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

◆ operator*() [2/4]

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

Multiply affine matrix with scalar.

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

◆ operator*() [3/4]

Point2D< double > operator* ( const AffineMatrix2D lhs,
const Point2D< double > &  rhs 
)
related

Multiply affine matrix with 2D point.

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

◆ operator*() [4/4]

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

Multiply scalar with affine matrix .

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

◆ operator+()

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

Add two affine matrices.

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

◆ operator-()

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

Subtract two affine matrices.

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

◆ operator/()

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

Divide affine matrix by scalar.

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