From e573c0bcc6b906c9398cf880741c9b9cb39b6348 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Thu, 24 Aug 2017 17:52:46 +1000 Subject: [PATCH] geom/aabb: style and headers --- geom/aabb.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/geom/aabb.cpp b/geom/aabb.cpp index a5258ba7..74b75a1f 100644 --- a/geom/aabb.cpp +++ b/geom/aabb.cpp @@ -24,9 +24,9 @@ using util::geom::aabb; -//----------------------------------------------------------------------------- +/////////////////////////////////////////////////////////////////////////////// template -aabb::aabb (point _p0, point _p1): +aabb::aabb (const point _p0, const point _p1): p0 (_p0), p1 (_p1) { @@ -34,7 +34,7 @@ aabb::aabb (point _p0, point _p1): } -//----------------------------------------------------------------------------- +/////////////////////////////////////////////////////////////////////////////// template T aabb::diameter (void) const @@ -55,7 +55,7 @@ aabb::magnitude (void) const //----------------------------------------------------------------------------- template util::point -aabb::closest (point q) const +aabb::closest (const point q) const { return limit (q, p0, p1); } @@ -64,7 +64,7 @@ aabb::closest (point q) const /////////////////////////////////////////////////////////////////////////////// template aabb -aabb::expand (vector mag) const noexcept +aabb::expand (const vector mag) const noexcept { CHECK (all (mag >= T{0})); @@ -75,7 +75,7 @@ aabb::expand (vector mag) const noexcept //----------------------------------------------------------------------------- template aabb -aabb::expand (T mag) const noexcept +aabb::expand (const T mag) const noexcept { CHECK_GE (mag, T{0}); @@ -83,10 +83,10 @@ aabb::expand (T mag) const noexcept } -/////////////////////////////////////////////////////////////////////////////// +//----------------------------------------------------------------------------- template aabb -aabb::contract (util::vector mag) const noexcept +aabb::contract (const util::vector mag) const noexcept { CHECK (all (mag >= T{0})); CHECK (all (2 * mag <= p1 - p0)); @@ -98,7 +98,7 @@ aabb::contract (util::vector mag) const noexcept //----------------------------------------------------------------------------- template aabb -aabb::contract (T mag) const noexcept +aabb::contract (const T mag) const noexcept { CHECK_GE (mag, T{0}); CHECK (all (2 * mag <= p1 - p0)); @@ -107,10 +107,10 @@ aabb::contract (T mag) const noexcept } -/////////////////////////////////////////////////////////////////////////////// +//----------------------------------------------------------------------------- template void -aabb::cover (point p) +aabb::cover (const point p) { p0 = min (p, p0); p1 = max (p, p1); @@ -120,7 +120,7 @@ aabb::cover (point p) /////////////////////////////////////////////////////////////////////////////// template aabb -aabb::operator+ (vector v) const +aabb::operator+ (const vector v) const { return { p0 + v, p1 + v }; } @@ -129,7 +129,7 @@ aabb::operator+ (vector v) const //----------------------------------------------------------------------------- template aabb -aabb::operator- (vector v) const +aabb::operator- (const vector v) const { return { p0 - v, p1 - v }; }