The Region3 class represents the cartesian product of intervals Ix ✕ Iy ✕ Iz, one per axis, yielding an axis-aligned region of R^3 space. It can be thought of as an intersection of halfspaces. Regions may be open or closed in their boundaries, if any.
More...
#include <gz/math/Region3.hh>
|
static constexpr Region3< T > | Closed (T _xLeft, T _yLeft, T _zLeft, T _xRight, T _yRight, T _zRight) |
| Make a closed region. More...
|
|
static constexpr Region3< T > | Open (T _xLeft, T _yLeft, T _zLeft, T _xRight, T _yRight, T _zRight) |
| Make an open region. More...
|
|
|
static const Region3< T > & | Unbounded = detail::gUnboundedRegion3<T> |
| An unbounded region (-∞, ∞) ✕ (-∞, ∞) ✕ (-∞, ∞) More...
|
|
template<typename T>
class gz::math::Region3< T >
The Region3 class represents the cartesian product of intervals Ix ✕ Iy ✕ Iz, one per axis, yielding an axis-aligned region of R^3 space. It can be thought of as an intersection of halfspaces. Regions may be open or closed in their boundaries, if any.
Note that the Region3 class is essentially a set R ⊆ R^3. For 3D solid box semantics, use the AxisAlignedBox
class instead.
Example
#include <iostream>
int main(int argc, char **argv)
{
std::cout <<
"The " << defaultRegion <<
" region is empty: "
std::cout <<
"The " << openRegion <<
" region contains the "
std::cout <<
"The " << closedRegion <<
" region contains the "
std::cout <<
"Regions " << closedRegion <<
" and " << openRegion
<<
" intersect: " << closedRegion.
Intersects(openRegion)
<< " region contains all previous non-empty intervals: "
}
◆ Region3() [1/2]
◆ Region3() [2/2]
Constructor.
- Parameters
-
[in] | _ix | x-axis interval |
[in] | _iy | y-axis interval |
[in] | _iz | z-axis interval |
◆ Closed()
static constexpr Region3<T> Closed |
( |
T |
_xLeft, |
|
|
T |
_yLeft, |
|
|
T |
_zLeft, |
|
|
T |
_xRight, |
|
|
T |
_yRight, |
|
|
T |
_zRight |
|
) |
| |
|
inlinestaticconstexpr |
Make a closed region.
- Parameters
-
[in] | _xLeft | leftmost x-axis interval value |
[in] | _xRight | righmost x-axis interval value |
[in] | _yLeft | leftmost y-axis interval value |
[in] | _yRight | righmost y-axis interval value |
[in] | _zLeft | leftmost z-axis interval value |
[in] | _zRight | righmost z-axis interval value |
- Returns
- the [
_xLeft
, _xRight
] ✕ [_yLeft
, _yRight
] ✕ [_zLeft
, _zRight
] closed region
◆ Contains() [1/2]
bool Contains |
( |
const Region3< T > & |
_other | ) |
const |
|
inline |
Check if the region contains _other
region.
- Parameters
-
[in] | _other | region to check for membership |
- Returns
- true if it is contained, false otherwise
◆ Contains() [2/2]
bool Contains |
( |
const Vector3< T > & |
_point | ) |
const |
|
inline |
◆ Empty()
◆ Intersects()
bool Intersects |
( |
const Region3< T > & |
_other | ) |
const |
|
inline |
Check if the region intersects _other
region.
- Parameters
-
[in] | _other | region to check for intersection |
- Returns
- true if it is contained, false otherwise
◆ Ix()
◆ Iy()
◆ Iz()
◆ Open()
static constexpr Region3<T> Open |
( |
T |
_xLeft, |
|
|
T |
_yLeft, |
|
|
T |
_zLeft, |
|
|
T |
_xRight, |
|
|
T |
_yRight, |
|
|
T |
_zRight |
|
) |
| |
|
inlinestaticconstexpr |
Make an open region.
- Parameters
-
[in] | _xLeft | leftmost x-axis interval value |
[in] | _xRight | righmost x-axis interval value |
[in] | _yLeft | leftmost y-axis interval value |
[in] | _yRight | righmost y-axis interval value |
[in] | _zLeft | leftmost z-axis interval value |
[in] | _zRight | righmost z-axis interval value |
- Returns
- the (
_xLeft
, _xRight
) ✕ (_yLeft
, _yRight
) ✕ (_zLeft
, _zRight
) open region
◆ operator!=()
bool operator!= |
( |
const Region3< T > & |
_other | ) |
const |
|
inline |
Inequality test operator.
- Parameters
-
_other | region to check for inequality |
- Returns
- true if regions are unequal, false otherwise
References Region3< T >::Contains().
◆ operator==()
bool operator== |
( |
const Region3< T > & |
_other | ) |
const |
|
inline |
Equality test operator.
- Parameters
-
_other | region to check for equality |
- Returns
- true if regions are equal, false otherwise
References Region3< T >::Contains().
◆ Unbounded
const Region3< T > & Unbounded = detail::gUnboundedRegion3<T> |
|
static |
An unbounded region (-∞, ∞) ✕ (-∞, ∞) ✕ (-∞, ∞)
The documentation for this class was generated from the following file: