region: add `encloses' test for subregions
This commit is contained in:
parent
72f631ab4b
commit
f36a14973a
@ -252,6 +252,15 @@ util::region<S,T>::intersection (region<S,T> rhs) const
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <size_t S, typename T>
|
||||
bool
|
||||
util::region<S,T>::encloses (const region<S,T> r) const noexcept
|
||||
{
|
||||
return all (p <= r.p) && all (p + e >= r.p + r.e);
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
template <size_t S, typename T>
|
||||
util::region<S,T>
|
||||
util::region<S,T>::inset (T mag) const
|
||||
{
|
||||
|
@ -83,6 +83,9 @@ namespace util {
|
||||
// Compute binary region combinations
|
||||
region intersection (region<S,T>) const;
|
||||
|
||||
// Test if a region lies completely within our space
|
||||
bool encloses (region<S,T>) const noexcept;
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
// Compute a region `mag` units into the region
|
||||
region inset (T mag) const;
|
||||
|
Loading…
Reference in New Issue
Block a user