mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-05 12:00:39 +08:00
add comparision overloads for tests
This commit is contained in:
parent
9e39077035
commit
366c25888c
@ -57,6 +57,25 @@ void TransformationMatrix::swap(TransformationMatrix &other)
|
||||
std::swap(this->m33, other.m33); std::swap(this->m34, other.m34);
|
||||
}
|
||||
|
||||
bool TransformationMatrix::operator==(const TransformationMatrix &other) const
|
||||
{
|
||||
double eps = 1e-14;
|
||||
bool is_equal = true;
|
||||
is_equal &= (abs(this->m11 - other.m11) < eps);
|
||||
is_equal &= (abs(this->m12 - other.m12) < eps);
|
||||
is_equal &= (abs(this->m13 - other.m13) < eps);
|
||||
is_equal &= (abs(this->m14 - other.m14) < eps);
|
||||
is_equal &= (abs(this->m21 - other.m21) < eps);
|
||||
is_equal &= (abs(this->m22 - other.m22) < eps);
|
||||
is_equal &= (abs(this->m23 - other.m23) < eps);
|
||||
is_equal &= (abs(this->m24 - other.m24) < eps);
|
||||
is_equal &= (abs(this->m31 - other.m31) < eps);
|
||||
is_equal &= (abs(this->m32 - other.m32) < eps);
|
||||
is_equal &= (abs(this->m33 - other.m33) < eps);
|
||||
is_equal &= (abs(this->m34 - other.m34) < eps);
|
||||
return is_equal;
|
||||
}
|
||||
|
||||
std::vector<double> TransformationMatrix::matrix3x4f() const
|
||||
{
|
||||
std::vector<double> out_arr(0);
|
||||
|
@ -22,6 +22,9 @@ public:
|
||||
TransformationMatrix& operator= (TransformationMatrix other);
|
||||
void swap(TransformationMatrix &other);
|
||||
|
||||
bool operator== (const TransformationMatrix &other) const;
|
||||
bool operator!= (const TransformationMatrix &other) const { return !(*this == other); };
|
||||
|
||||
/// matrix entries
|
||||
double m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34;
|
||||
|
||||
|
@ -17,6 +17,9 @@
|
||||
Clone<TransformationMatrix> inverse()
|
||||
%code{% RETVAL = THIS->inverse(); %};
|
||||
|
||||
bool equal(TransformationMatrix* other)
|
||||
%code{% RETVAL = (*THIS == *other); %};
|
||||
|
||||
double determinante();
|
||||
|
||||
double m11()
|
||||
|
Loading…
x
Reference in New Issue
Block a user