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 };
46 value_type &operator[](Side s) {
47 return m_data[
static_cast<index_type
>(s)];
49 value_type operator[](Side s)
const {
50 return m_data[
static_cast<index_type
>(s)];
54 type &operator()(Side s, value_type v) {
60 type &operator*=(
Scalar v) {
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
The main namespace for all C++ elements of the framework, internal and external.
double Scalar
Common scalar type.