5 #include "_cexports/c_core_3d.h" 10 #include "point_3d.hpp" 11 #include "matrix_3d.hpp" 30 inline AffineMatrix3D
operator+(
const AffineMatrix3D & lhs,
const AffineMatrix3D & rhs) noexcept;
41 inline AffineMatrix3D
operator-(
const AffineMatrix3D & lhs,
const AffineMatrix3D & rhs) noexcept;
53 inline AffineMatrix3D
operator*(
const AffineMatrix3D & lhs,
const AffineMatrix3D & rhs);
66 inline AffineMatrix3D
operator*(
const AffineMatrix3D & lhs,
const double & rhs) noexcept;
77 inline AffineMatrix3D
operator*(
const double & lhs,
const AffineMatrix3D & rhs) noexcept;
88 inline AffineMatrix3D
operator/(
const AffineMatrix3D & lhs,
const double & rhs);
127 , translation_(translation)
170 translation_ = translation;
191 return Internal::DoResCallValueOut<double>([&](
double & value)
193 auto thisData = reinterpret_cast<const CExports::CVC3DTransformation*>(
this);
194 return CVB_CALL_CAPI(CVC3DTransformationDeterminant(*thisData, value));
207 Internal::DoResCall([&]()
209 auto data = reinterpret_cast<const CExports::CVC3DTransformation*>(
this);
210 auto dataInv = reinterpret_cast<CExports::CVC3DTransformation*>(
this);
211 return CVB_CALL_CAPI(CVC3DInvertTransformation(*data, *dataInv));
223 return translation_ == transformation.translation_
224 && matrix_ == transformation.matrix_;
235 return !(*
this == transformation);
246 *
this = *
this + transformation;
258 *
this = *
this - transformation;
272 *
this = *
this * transformation;
284 *
this = *
this *value;
296 *
this = *
this / value;
313 return AffineMatrix3D(lhs.Matrix() + rhs.Matrix(), lhs.Translation() + rhs.Translation());
318 return AffineMatrix3D(lhs.Matrix() - rhs.Matrix(), lhs.Translation() - rhs.Translation());
324 return Internal::DoResCallValueOut<AffineMatrix3D>([&](
AffineMatrix3D & value)
326 auto valueData = reinterpret_cast<CExports::CVC3DTransformation*>(&value);
327 auto lhsData = reinterpret_cast<const CExports::CVC3DTransformation*>(&lhs);
328 auto rhsData = reinterpret_cast<const CExports::CVC3DTransformation*>(&rhs);
329 return CVB_CALL_CAPI(CVC3DMultiplyTransformations(*lhsData,
339 return AffineMatrix3D(lhs.Matrix() * rhs, lhs.Translation() * rhs);
AffineMatrix3D & operator+=(const AffineMatrix3D &transformation) noexcept
Adds and assigns to this affine matrix.
Definition: affine_matrix_3d.hpp:244
AffineMatrix3D & operator -=(const AffineMatrix3D &transformation) noexcept
Subtracts and assigns to this transformation.
Definition: affine_matrix_3d.hpp:256
AffineMatrix2D operator+(const AffineMatrix2D &lhs, const AffineMatrix2D &rhs) noexcept
Add two affine matrices.
Definition: affine_matrix_2d.hpp:217
static Matrix3D Identity() noexcept
The identity element.
Definition: matrix_3d.hpp:67
AffineMatrix3D & operator *=(const double &value) noexcept
Multiplies and assigns to this transformation.
Definition: affine_matrix_3d.hpp:282
Affine transformation matrix for 3D.
Definition: affine_matrix_3d.hpp:97
bool operator!=(const AffineMatrix3D &transformation) const noexcept
Compares to an other transformation.
Definition: affine_matrix_3d.hpp:233
AffineMatrix2D operator/(const AffineMatrix2D &lhs, const double &rhs)
Divide affine matrix by scalar.
Definition: affine_matrix_2d.hpp:301
Double precision 3x3 matrix class.
Definition: matrix_3d.hpp:58
Root namespace for the Image Manager interface.
Definition: version.hpp:11
bool operator==(const AffineMatrix3D &transformation) const noexcept
Compares to an other transformation.
Definition: affine_matrix_3d.hpp:221
AffineMatrix3D & operator *=(const AffineMatrix3D &transformation)
Multiplies and assigns to this transformation.
Definition: affine_matrix_3d.hpp:270
Multi-purpose 3D vector class.
Definition: point_3d.hpp:21
AffineMatrix3D & operator/=(const double &value) noexcept
Divides each element of this transformation by the given value.
Definition: affine_matrix_3d.hpp:294
Matrix3D Matrix() const noexcept
Gets the matrix part of the transformation.
Definition: affine_matrix_3d.hpp:137
AffineMatrix2D operator *(const AffineMatrix2D &lhs, const AffineMatrix2D &rhs) noexcept
Multiply two affine matrices.
Definition: affine_matrix_2d.hpp:245
Vector3D< double > Translation() const noexcept
Gets the translation part of the transformation.
Definition: affine_matrix_3d.hpp:157
void SetMatrix(Matrix3D matrix) noexcept
Sets the matrix part of the transformation.
Definition: affine_matrix_3d.hpp:147
void Invert()
Inverts this transformation if possible.
Definition: affine_matrix_3d.hpp:205
AffineMatrix3D() noexcept=default
Default constructor for empty transformation.
void SetTranslation(Vector3D< double > translation) noexcept
Sets the translation part of the transformation.
Definition: affine_matrix_3d.hpp:168
double Det() const
Transformation determinant.
Definition: affine_matrix_3d.hpp:189
AffineMatrix2D operator-(const AffineMatrix2D &lhs, const AffineMatrix2D &rhs) noexcept
Subtract two affine matrices.
Definition: affine_matrix_2d.hpp:231
bool IsTranslation() const noexcept
Checks if this transformation describes a translation.
Definition: affine_matrix_3d.hpp:179
static AffineMatrix3D Identity() noexcept
The identity element.
Definition: affine_matrix_3d.hpp:106