#include <Magnum/Math/Range.h>
template<class T>
Range3D class
Three-dimensional range.
See Range for more information.
Base classes
-
template<UnsignedInt dimensions, class T>class Range<3, T>
- N-dimensional range.
Constructors, destructors, conversion operators
- Range3D() constexpr noexcept
- Default constructor.
- Range3D(ZeroInitT) explicit constexpr noexcept
- Construct a zero range.
-
Range3D(Magnum::
NoInitT) explicit noexcept - Construct without initializing the contents.
- Range3D(const Vector3<T>& min, const Vector3<T>& max) constexpr noexcept
- Construct a range from minimal and maximal coordinates.
-
Range3D(const Containers::
Pair<Vector3<T>, Vector3<T>>& minmax) constexpr noexcept new in 2020.06 - Construct a range from a pair of minimal and maximal coordinates.
-
Range3D(const Containers::
Pair<Vector<3, T>, Vector<3, T>>& minmax) constexpr noexcept new in 2020.06 -
template<class U>Range3D(const Range3D<U>& other) explicit constexpr noexcept
- Construct a range from another of different type.
-
template<class U, class = decltype(Implementation::RangeConverter<3, T, U>::from(std::Range3D(const U& other) explicit constexpr noexcept
declval<U>()))> - Construct a range from external representation.
- Range3D(const Range<3, T>& other) constexpr noexcept
- Copy constructor.
Public functions
- auto backBottomLeft() -> Vector3<T>&
- Back bottom left corner.
- auto backBottomLeft() const -> Vector3<T> constexpr
- auto backBottomRight() const -> Vector3<T> constexpr
- Back bottom right corner.
- auto backTopLeft() const -> Vector3<T> constexpr
- Back top right corner.
- auto backTopRight() const -> Vector3<T> constexpr
- Back top right corner.
- auto frontTopRight() -> Vector3<T>&
- Front top right corner.
- auto frontTopRight() const -> Vector3<T> constexpr
- auto frontTopLeft() const -> Vector3<T> constexpr
- Front top left corner.
- auto frontBottomRight() const -> Vector3<T> constexpr
- Front bottom right corner.
- auto frontBottomLeft() const -> Vector3<T> constexpr
- Front bottom left corner.
- auto left() -> T&
- Left edge.
- auto left() const -> T constexpr
- auto right() -> T&
- Right edge.
- auto right() const -> T constexpr
- auto bottom() -> T&
- Bottom edge.
- auto bottom() const -> T constexpr
- auto top() -> T&
- Top edge.
- auto top() const -> T constexpr
- auto back() -> T&
- Back edge.
- auto back() const -> T constexpr
- auto front() -> T&
- Front edge.
- auto front() const -> T constexpr
- auto x() const -> Range<1, T> constexpr
- Range in the X axis.
- auto y() const -> Range<1, T> constexpr
- Range in the Y axis.
- auto z() const -> Range<1, T> constexpr
- Range in the Z axis.
- auto xy() const -> Range2D<T> constexpr
- Range in the XY plane.
- auto sizeX() const -> T
- Range width.
- auto sizeY() const -> T
- Range height.
- auto sizeZ() const -> T
- Range depth.
- auto centerX() const -> T
- Range center on X axis.
- auto centerY() const -> T
- Range center on Y axis.
- auto centerZ() const -> T
- Range center on Z axis.
Function documentation
template<class T>
Magnum:: Math:: Range3D<T>:: Range3D() constexpr noexcept
Default constructor.
Equivalent to Range3D(ZeroInitT).
template<class T>
Magnum:: Math:: Range3D<T>:: Range3D(const Containers:: Pair<Vector3<T>, Vector3<T>>& minmax) constexpr noexcept new in 2020.06
Construct a range from a pair of minimal and maximal coordinates.
Useful in combination with e.g. minmax(), here for example to calculate bounds of a triangle:
Vector3 a, b, c; Range3D bounds = Math::minmax({a, b, c});
template<class T>
Magnum:: Math:: Range3D<T>:: Range3D(const Containers:: Pair<Vector<3, T>, Vector<3, T>>& minmax) constexpr noexcept new in 2020.06
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<class T>
template<class U>
Magnum:: Math:: Range3D<T>:: Range3D(const Range3D<U>& other) explicit constexpr noexcept
Construct a range from another of different type.
Performs only default casting on the values, no rounding or anything else. Example usage:
Range2D floatingPoint{{1.3f, 2.7f}, {-15.0f, 7.0f}}; Range2Di integral{floatingPoint}; // {{1, 2}, {-15, 7}}
template<class T>
Vector3<T>& Magnum:: Math:: Range3D<T>:: backBottomLeft()
Back bottom left corner.
Equivalent to min().
template<class T>
Vector3<T> Magnum:: Math:: Range3D<T>:: backBottomLeft() const constexpr
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<class T>
Vector3<T>& Magnum:: Math:: Range3D<T>:: frontTopRight()
Front top right corner.
Equivalent to max().
template<class T>
Vector3<T> Magnum:: Math:: Range3D<T>:: frontTopRight() const constexpr
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<class T>
T Magnum:: Math:: Range3D<T>:: left() const constexpr
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<class T>
T Magnum:: Math:: Range3D<T>:: right() const constexpr
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<class T>
T Magnum:: Math:: Range3D<T>:: bottom() const constexpr
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<class T>
T Magnum:: Math:: Range3D<T>:: top() const constexpr
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<class T>
T Magnum:: Math:: Range3D<T>:: back() const constexpr
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<class T>
T Magnum:: Math:: Range3D<T>:: front() const constexpr
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<class T>
T Magnum:: Math:: Range3D<T>:: sizeX() const
Range width.
template<class T>
T Magnum:: Math:: Range3D<T>:: sizeY() const
Range height.
template<class T>
T Magnum:: Math:: Range3D<T>:: sizeZ() const
Range depth.
template<class T>
T Magnum:: Math:: Range3D<T>:: centerX() const
Range center on X axis.
template<class T>
T Magnum:: Math:: Range3D<T>:: centerY() const
Range center on Y axis.
template<class T>
T Magnum:: Math:: Range3D<T>:: centerZ() const
Range center on Z axis.