#include <recti/recti.hpp>
template<typename T>
Rectangle struct
Rectangle (Rectilinear)
Template parameters | |
---|---|
T |
The struct Rectangle
is inheriting from the Point<Interval<T>>
class. This means that Rectangle
will have all the member variables and member functions of Point<Interval<T>>
. It is using the Interval<T>
template parameter to define the type of the x and y coordinates of the rectangle.
Base classes
-
template<typename T1 = int, typename T2 = T1>class Point<Interval<T>>
- Point.
Constructors, destructors, conversion operators
- Rectangle(Interval<T>&& xcoord, Interval<T>&& ycoord) constexpr noexcept
- Construct a new Rectangle object.
- Rectangle(const Interval<T>& xcoord, const Interval<T>& ycoord) constexpr
- Construct a new Rectangle object.
- Rectangle(Point<Interval<T>>&& base) constexpr noexcept
- Construct a new Rectangle object from the base object (implicitly)
- Rectangle(const Point<Interval<T>>& base) explicit constexpr
- Construct a new Rectangle object from the base object (implicitly)
Public functions
Function documentation
template<typename T>
recti:: Rectangle<T>:: Rectangle(Interval<T>&& xcoord,
Interval<T>&& ycoord) constexpr noexcept
Construct a new Rectangle object.
Parameters | |
---|---|
xcoord in | |
ycoord in |
This is a constructor for the Rectangle
struct. It takes two Interval<T>
objects, xcoord
and ycoord
, as parameters. The &&
indicates that the parameters are rvalue references, allowing the constructor to efficiently move the Interval<T>
objects into the Rectangle
object. The noexcept
specifier indicates that this constructor will not throw any exceptions.
template<typename T>
auto recti:: Rectangle<T>:: ur() const -> Point< T > constexpr
upper right corner
Returns | Point<T> |
---|
The ur()
function is a member function of the Rectangle
struct. It returns a Point<T>
object representing the upper right corner of the rectangle. It does this by accessing the xcoord()
and ycoord()
member functions of the Rectangle
object and calling their ub()
member functions to get the upper bound values. These values are then used to construct a new Point<T>
object representing the upper right corner.