25 #ifndef INCLUDED_Rect_h_GUID_A81C8929_371D_4EBC_C6BB_A7264EF642E6
26 #define INCLUDED_Rect_h_GUID_A81C8929_371D_4EBC_C6BB_A7264EF642E6
39 template <
typename Scalar =
double>
class Rect {
43 enum Side { LEFT = 0, RIGHT = 1, TOP = 2, BOTTOM = 3 };
47 return m_data[
static_cast<index_type
>(s)];
50 return m_data[
static_cast<index_type
>(s)];
61 for (
auto &e : m_data) {
68 typedef std::array<Scalar, 4> storage_type;
69 typedef std::size_t index_type;
74 template <
typename StreamType,
typename Scalar>
75 StreamType &operator<<(StreamType &os, Rect<Scalar>
const &rect) {
76 typedef Rect<Scalar> R;
77 os <<
"L: " << rect[R::LEFT];
78 os <<
" R: " << rect[R::RIGHT];
79 os <<
" T: " << rect[R::TOP];
80 os <<
" B: " << rect[R::BOTTOM];
86 #endif // INCLUDED_Rect_h_GUID_A81C8929_371D_4EBC_C6BB_A7264EF642E6
type & operator()(Side s, value_type v)
Chained function call operator for setting sides.
type & operator*=(Scalar v)
Componentwise multiplication by scalar.
value_type & operator[](Side s)
Access by side.
double Scalar
Common scalar type.