24#ifndef QA_UNIT_TEST_UTILS_GEOM__H
25#define QA_UNIT_TEST_UTILS_GEOM__H
50template <
typename VEC>
51bool IsVecWithinTol(
const VEC& aVec,
const VEC& aExp,
typename VEC::coord_type aTol )
53 return IsWithin<typename VEC::coord_type>( aVec.x, aExp.x, aTol )
54 && IsWithin<typename VEC::coord_type>( aVec.y, aExp.y, aTol );
60template <
typename BOX>
61bool IsBoxWithinTol(
const BOX& aBox,
const BOX& aExp,
typename BOX::coord_type aTol )
64 return IsVecWithinTol<VEC>( aBox.GetPosition(), aExp.GetPosition(), aTol )
65 && IsVecWithinTol<VEC>( aBox.GetSize(), aExp.GetSize(), aTol * 2 );
A 2D bounding box built on top of an origin point and size vector.
constexpr const Vec & GetOrigin() const
constexpr const SizeVec & GetSize() const
Define a general 2D-vector/point.
std::ostream & boost_test_print_type(std::ostream &os, const BOX2< T > &aBox)
Define a stream function for logging this type.
bool IsBoxWithinTol(const BOX &aBox, const BOX &aExp, typename BOX::coord_type aTol)
Check that a box is close enough to another box.
bool IsVecWithinTol(const VEC &aVec, const VEC &aExp, typename VEC::coord_type aTol)
Check that both x and y of a vector are within expected error.
Numerical test predicates.