region: remove `expanded' function
we're trying to move away from mutating operators. also, we do the bad thing of just renaming the non-mutating operator given it appears no one is using the mutating operator in our code bases anyway...
This commit is contained in:
parent
b6edf25cd8
commit
72f631ab4b
27
region.cpp
27
region.cpp
@ -274,31 +274,10 @@ util::region<S,T>::inset (vector<S,T> mag) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
template <size_t S, typename T>
|
|
||||||
util::region<S,T>&
|
|
||||||
util::region<S,T>::expand (vector<S,T> v)
|
|
||||||
{
|
|
||||||
p -= v;
|
|
||||||
e += v * T{2};
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
template <size_t S, typename T>
|
|
||||||
util::region<S,T>&
|
|
||||||
util::region<S,T>::expand (T mag)
|
|
||||||
{
|
|
||||||
return expand (vector<S,T> {mag});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
template <size_t S, typename T>
|
template <size_t S, typename T>
|
||||||
util::region<S,T>
|
util::region<S,T>
|
||||||
util::region<S,T>::expanded (vector<S,T> v) const
|
util::region<S,T>::expand (vector<S,T> v) const
|
||||||
{
|
{
|
||||||
return {
|
return {
|
||||||
p - v,
|
p - v,
|
||||||
@ -310,9 +289,9 @@ util::region<S,T>::expanded (vector<S,T> v) const
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
template <size_t S, typename T>
|
template <size_t S, typename T>
|
||||||
util::region<S,T>
|
util::region<S,T>
|
||||||
util::region<S,T>::expanded (T mag) const
|
util::region<S,T>::expand (T mag) const
|
||||||
{
|
{
|
||||||
return expanded (vector<S,T> {mag});
|
return expand (vector<S,T> {mag});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -88,11 +88,8 @@ namespace util {
|
|||||||
region inset (T mag) const;
|
region inset (T mag) const;
|
||||||
region inset (vector<S,T> mag) const;
|
region inset (vector<S,T> mag) const;
|
||||||
|
|
||||||
region expanded (T mag) const;
|
region expand (T mag) const;
|
||||||
region expanded (vector<S,T>) const;
|
region expand (vector<S,T>) const;
|
||||||
|
|
||||||
region& expand (T mag);
|
|
||||||
region& expand (vector<S,T>);
|
|
||||||
|
|
||||||
// arithmetic operators
|
// arithmetic operators
|
||||||
region operator+ (vector<S,T>) const;
|
region operator+ (vector<S,T>) const;
|
||||||
|
Loading…
Reference in New Issue
Block a user