24#ifndef QA_UNIT_TEST_UTILS_GEOM__H
25#define QA_UNIT_TEST_UTILS_GEOM__H
51template <
typename VEC>
52bool IsVecWithinTol(
const VEC& aVec,
const VEC& aExp,
typename VEC::coord_type aTol )
54 return IsWithin<typename VEC::coord_type>( aVec.x, aExp.x, aTol )
55 && IsWithin<typename VEC::coord_type>( aVec.y, aExp.y, aTol );
61template <
typename BOX>
62bool IsBoxWithinTol(
const BOX& aBox,
const BOX& aExp,
typename BOX::coord_type aTol )
65 return IsVecWithinTol<VEC>( aBox.GetPosition(), aExp.GetPosition(), aTol )
66 && IsVecWithinTol<VEC>( aBox.GetSize(), aExp.GetSize(), aTol * 2 );
const Vec & GetOrigin() const
const Vec & GetSize() const
Define a general 2D-vector/point.
std::ostream & operator<<(std::ostream &os, const BOX2I &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.