5#include "_cexports/c_core_3d.h"
10#include "point_3d.hpp"
11#include "matrix_3d.hpp"
30inline AffineMatrix3D
operator+(
const AffineMatrix3D & lhs,
const AffineMatrix3D & rhs)
noexcept;
41inline AffineMatrix3D
operator-(
const AffineMatrix3D & lhs,
const AffineMatrix3D & rhs)
noexcept;
53inline AffineMatrix3D
operator*(
const AffineMatrix3D & lhs,
const AffineMatrix3D & rhs);
66inline AffineMatrix3D
operator*(
const AffineMatrix3D & lhs,
const double & rhs)
noexcept;
77inline AffineMatrix3D
operator*(
const double & lhs,
const AffineMatrix3D & rhs)
noexcept;
88inline AffineMatrix3D
operator/(
const AffineMatrix3D & lhs,
const double & rhs);
126 , translation_(translation)
169 translation_ = translation;
190 return Internal::DoResCallValueOut<double>([&](
double & value)
192 auto thisData =
reinterpret_cast<const CExports::CVC3DTransformation*
>(
this);
193 return CVB_CALL_CAPI(CVC3DTransformationDeterminant(*thisData, value));
206 Internal::DoResCall([&]()
208 auto data =
reinterpret_cast<const CExports::CVC3DTransformation*
>(
this);
209 auto dataInv =
reinterpret_cast<CExports::CVC3DTransformation*
>(
this);
210 return CVB_CALL_CAPI(CVC3DInvertTransformation(*data, *dataInv));
236 return translation_ == transformation.translation_
237 && matrix_ == transformation.matrix_;
248 return !(*
this == transformation);
259 *
this = *
this + transformation;
271 *
this = *
this - transformation;
285 *
this = *
this * transformation;
297 *
this = *
this *value;
309 *
this = *
this / value;
326 return AffineMatrix3D(lhs.Matrix() + rhs.Matrix(), lhs.Translation() + rhs.Translation());
331 return AffineMatrix3D(lhs.Matrix() - rhs.Matrix(), lhs.Translation() - rhs.Translation());
337 return Internal::DoResCallValueOut<AffineMatrix3D>([&](
AffineMatrix3D & value)
339 auto valueData =
reinterpret_cast<CExports::CVC3DTransformation*
>(&value);
340 auto lhsData =
reinterpret_cast<const CExports::CVC3DTransformation*
>(&lhs);
341 auto rhsData =
reinterpret_cast<const CExports::CVC3DTransformation*
>(&rhs);
342 return CVB_CALL_CAPI(CVC3DMultiplyTransformations(*lhsData,
352 return AffineMatrix3D(lhs.Matrix() * rhs, lhs.Translation() * rhs);
Affine transformation for 3D containing a transformation matrix and a translation vector.
Definition: affine_matrix_3d.hpp:97
AffineMatrix3D Inverse()
Gets the inverse of this transformation if possible.
Definition: affine_matrix_3d.hpp:221
bool operator==(const AffineMatrix3D &transformation) const noexcept
Compares to an other transformation.
Definition: affine_matrix_3d.hpp:234
static AffineMatrix3D Identity() noexcept
The identity element.
Definition: affine_matrix_3d.hpp:105
Vector3D< double > Translation() const noexcept
Gets the translation part of the transformation.
Definition: affine_matrix_3d.hpp:156
Matrix3D Matrix() const noexcept
Gets the matrix part of the transformation.
Definition: affine_matrix_3d.hpp:136
AffineMatrix3D & operator*=(const AffineMatrix3D &transformation)
Multiplies and assigns to this transformation.
Definition: affine_matrix_3d.hpp:283
AffineMatrix3D & operator/=(const double &value) noexcept
Divides each element of this transformation by the given value.
Definition: affine_matrix_3d.hpp:307
AffineMatrix3D() noexcept=default
Default constructor for empty transformation.
bool IsTranslation() const noexcept
Checks if this transformation describes a translation.
Definition: affine_matrix_3d.hpp:178
double Det() const
Transformation determinant.
Definition: affine_matrix_3d.hpp:188
bool operator!=(const AffineMatrix3D &transformation) const noexcept
Compares to an other transformation.
Definition: affine_matrix_3d.hpp:246
void SetTranslation(Vector3D< double > translation) noexcept
Sets the translation part of the transformation.
Definition: affine_matrix_3d.hpp:167
AffineMatrix3D & operator-=(const AffineMatrix3D &transformation) noexcept
Subtracts and assigns to this transformation.
Definition: affine_matrix_3d.hpp:269
void SetMatrix(Matrix3D matrix) noexcept
Sets the matrix part of the transformation.
Definition: affine_matrix_3d.hpp:146
void Invert()
Inverts this transformation in-place if possible.
Definition: affine_matrix_3d.hpp:204
AffineMatrix3D & operator+=(const AffineMatrix3D &transformation) noexcept
Adds and assigns to this affine matrix.
Definition: affine_matrix_3d.hpp:257
Double precision 3x3 matrix class.
Definition: matrix_3d.hpp:60
static Matrix3D Identity() noexcept
The identity element.
Definition: matrix_3d.hpp:68
Multi-purpose 3D vector class.
Definition: point_3d.hpp:22
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24
AffineMatrix2D operator+(const AffineMatrix2D &lhs, const AffineMatrix2D &rhs) noexcept
Add two affine matrices.
Definition: affine_matrix_2d.hpp:231
AffineMatrix2D operator*(const AffineMatrix2D &lhs, const AffineMatrix2D &rhs) noexcept
Multiply two affine matrices.
Definition: affine_matrix_2d.hpp:259
AffineMatrix2D operator/(const AffineMatrix2D &lhs, const double &rhs)
Divide affine matrix by scalar.
Definition: affine_matrix_2d.hpp:315
AffineMatrix2D operator-(const AffineMatrix2D &lhs, const AffineMatrix2D &rhs) noexcept
Subtract two affine matrices.
Definition: affine_matrix_2d.hpp:245