mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Use assert less for boundingbox methods.
This commit is contained in:
parent
7499811564
commit
090293c421
@ -232,7 +232,7 @@ Vec3d BoundingBox::center() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
Vec3d BoundingBox::extent() const
|
||||
{
|
||||
CVF_TIGHT_ASSERT(isValid());
|
||||
if (!isValid()) return { 0,0,0 };
|
||||
|
||||
return (m_max - m_min);
|
||||
}
|
||||
@ -243,7 +243,7 @@ Vec3d BoundingBox::extent() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double BoundingBox::radius() const
|
||||
{
|
||||
CVF_TIGHT_ASSERT(isValid());
|
||||
if (!isValid()) return 0.0;
|
||||
|
||||
return extent().length() / 2.0;
|
||||
}
|
||||
@ -278,7 +278,7 @@ const Vec3d& BoundingBox::max() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool BoundingBox::contains(const Vec3d& point) const
|
||||
{
|
||||
CVF_TIGHT_ASSERT(isValid());
|
||||
if (!isValid()) return false;
|
||||
|
||||
if (point.x() >= m_min.x() && point.x() <= m_max.x() &&
|
||||
point.y() >= m_min.y() && point.y() <= m_max.y() &&
|
||||
@ -298,8 +298,7 @@ bool BoundingBox::contains(const Vec3d& point) const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool BoundingBox::intersects(const BoundingBox& box) const
|
||||
{
|
||||
CVF_TIGHT_ASSERT(isValid());
|
||||
CVF_TIGHT_ASSERT(box.isValid());
|
||||
if (!isValid() || !box.isValid()) return false;
|
||||
|
||||
if (m_max.x() < box.m_min.x() || m_min.x() > box.m_max.x()) return false;
|
||||
if (m_max.y() < box.m_min.y() || m_min.y() > box.m_max.y()) return false;
|
||||
|
Loading…
Reference in New Issue
Block a user