From f77cdabaee0ba43400bc4e60e26019fb2779e533 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Thu, 24 Aug 2017 16:47:02 +1000 Subject: [PATCH] geom/aabb: dont use mutating function naming convention --- geom/aabb.cpp | 8 ++++---- geom/aabb.hpp | 8 ++++---- test/geom/aabb.cpp | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/geom/aabb.cpp b/geom/aabb.cpp index ad122a4b..50aa3d21 100644 --- a/geom/aabb.cpp +++ b/geom/aabb.cpp @@ -86,7 +86,7 @@ aabb::closest (point q) const /////////////////////////////////////////////////////////////////////////////// template aabb -aabb::expanded (vector mag) const noexcept +aabb::expand (vector mag) const noexcept { CHECK (all (mag >= T{0})); CHECK (all (mag < p1 - p0)); @@ -101,7 +101,7 @@ aabb::expanded (vector mag) const noexcept //----------------------------------------------------------------------------- template aabb -aabb::expanded (T t) const noexcept +aabb::expand (T t) const noexcept { CHECK_GE (t, T{0}); CHECK (all (t < p1 - p0)); @@ -116,7 +116,7 @@ aabb::expanded (T t) const noexcept /////////////////////////////////////////////////////////////////////////////// template aabb -aabb::contracted (util::vector mag) const noexcept +aabb::contract (util::vector mag) const noexcept { CHECK (all (mag > T{0})); CHECK (all (mag <= p1 - p0)); @@ -131,7 +131,7 @@ aabb::contracted (util::vector mag) const noexcept //----------------------------------------------------------------------------- template aabb -aabb::contracted (T mag) const noexcept +aabb::contract (T mag) const noexcept { CHECK_GE (mag, T{0}); CHECK (all (mag <= p1 - p0)); diff --git a/geom/aabb.hpp b/geom/aabb.hpp index 62793d7d..6f11b6aa 100644 --- a/geom/aabb.hpp +++ b/geom/aabb.hpp @@ -36,11 +36,11 @@ namespace util::geom { point closest (point) const; - aabb expanded (util::vector) const noexcept; - aabb expanded (T) const noexcept; + aabb expand (util::vector) const noexcept; + aabb expand (T) const noexcept; - aabb contracted (util::vector) const noexcept; - aabb contracted (T) const noexcept; + aabb contract (util::vector) const noexcept; + aabb contract (T) const noexcept; void cover (point); diff --git a/test/geom/aabb.cpp b/test/geom/aabb.cpp index 8e1cf651..f9346f44 100644 --- a/test/geom/aabb.cpp +++ b/test/geom/aabb.cpp @@ -17,7 +17,7 @@ main (int, char**) const aabb2f val { { 2, 2 }, { 8, 8 } }; const aabb2f res { { 3, 3 }, { 7, 7 } }; - tap.expect_eq (val.contracted (2.f), res, "over contraction"); + tap.expect_eq (val.contract (2.f), res, "over contraction"); } { @@ -25,7 +25,7 @@ main (int, char**) const aabb2f val { { 2, 2 }, { 8, 8 } }; const aabb2f res { { 1, 1 }, { 9, 9 } }; - tap.expect_eq (val.expanded (2.f), res, "expansion"); + tap.expect_eq (val.expand (2.f), res, "expansion"); } return tap.status ();