Go to the documentation of this file.
12 #include <boost/operators.hpp>
23 :
public boost::addable2<Rectangle<T>, Point<T>>
24 ,
public boost::subtractable2<Rectangle<T>, Point<T>>
25 ,
public boost::multipliable2<Rectangle<T>, T>
26 ,
public boost::multipliable2<Rectangle<T>, Point<T>>
27 ,
public boost::dividable2<Rectangle<T>, T>
28 ,
public boost::dividable2<Rectangle<T>, Point<T>>
48 explicit Rectangle(
const cairo_rectangle_int_t& rect)
55 template <bool T_is_int = std::is_same<int, typename std::remove_cv<T>::type>::value>
100 template <
typename U>
103 using R =
typename std::common_type<T, U>::type;
269 template <
typename U>
283 template <
typename T>
289 template <
typename T>
295 template <
typename T>
301 template <
typename T>
309 inline std::ostream&
operator<<(std::ostream& os,
const cairo_rectangle_int_t& r) {
return os << Rectangle<double>(r); }
311 template <
typename T,
typename U>
315 result *=
static_cast<typename std::common_type<T, U>::type
>(right);
319 template <
typename T,
typename U>
329 template <
typename T,
typename U>
332 using R =
typename std::common_type<T, U>::type;
351 template <
typename T>
bool isEmpty() const
Definition: rectangle.hh:141
void setSize(xy_type const &s)
Definition: rectangle.hh:261
xy_type getTopLeft() const
Definition: rectangle.hh:133
value_type x() const
Definition: rectangle.hh:125
Point< T > xy_type
Definition: rectangle.hh:32
Definition: assertions.hh:14
Point< typename std::common_type< T, U >::type > operator-(Point< T > left, Point< U > right)
Definition: point.hh:134
Rectangle< value_type > above(Rectangle< value_type > const &r) const
Definition: rectangle.hh:183
Rectangle< value_type > rightOf(value_type v) const
Definition: rectangle.hh:148
value_type width() const
Definition: rectangle.hh:129
Rectangle< value_type > & operator/=(value_type other)
Definition: rectangle.hh:243
const Segment< value_type > & getVertically() const
Definition: rectangle.hh:259
Rectangle< typename std::common_type< T, U >::type > intersection(const Rectangle< U > &other) const
Definition: rectangle.hh:101
Rectangle< value_type > & operator-=(xy_type const &other)
Definition: rectangle.hh:227
Rectangle< value_type > below(Rectangle< value_type > const &r) const
Definition: rectangle.hh:193
Segment< value_type > vertically
Definition: rectangle.hh:280
void setRight(value_type v)
Definition: rectangle.hh:119
Rectangle(value_type x_, value_type y_, value_type width_, value_type height_)
Definition: rectangle.hh:36
Rectangle< double > roundCorners(Rectangle< double > r)
Definition: rectangle.hh:345
value_type getBottom() const
Definition: rectangle.hh:112
xy_type getBottomLeft() const
Definition: rectangle.hh:137
Rectangle< value_type > & operator/=(xy_type const &other)
Definition: rectangle.hh:250
bool contains(value_type p) const
Definition: linearsegment.hh:77
Rectangle< U > to() const
Definition: rectangle.hh:270
Rectangle intersection(const Rectangle &other) const
Definition: rectangle.hh:95
bool operator==(const Rectangle &other) const
Definition: rectangle.hh:203
Rectangle(const Segment< value_type > &horizontally_, const Segment< value_type > &vertically_)
Definition: rectangle.hh:42
Rectangle< T > make_rect(T x, T y, T width, T height)
Definition: rectangle.hh:284
value_type getHeight() const
Definition: rectangle.hh:123
value_type x
Definition: point.hh:111
Point< T > make_point(T x, T y)
Definition: point.hh:116
value_type getEnd() const
Definition: linearsegment.hh:135
Segment< T > make_segment_from_start_end(T start, T end)
Definition: linearsegment.hh:229
Rectangle< value_type > & operator*=(xy_type const &other)
Definition: rectangle.hh:236
bool intersects(const Rectangle &other) const
Definition: rectangle.hh:84
Rectangle moveTo(value_type const &x, value_type const &y) const
Definition: rectangle.hh:69
bool operator!=(const Rectangle &other) const
Definition: rectangle.hh:218
Rectangle(const cairo_rectangle_int_t &rect)
Definition: rectangle.hh:48
void setLeft(value_type v)
Definition: rectangle.hh:117
Rectangle< value_type > leftOf(Rectangle< value_type > const &r) const
Definition: rectangle.hh:163
void setSize(value_type n)
Definition: linearsegment.hh:191
Rectangle moveTo(xy_type const &other) const
Definition: rectangle.hh:67
int value_type
Definition: rectangle.hh:31
xy_type getBottomRight() const
Definition: rectangle.hh:139
bool contains(const Rectangle &other) const
Definition: rectangle.hh:79
Rectangle< value_type > below(value_type v) const
Definition: rectangle.hh:158
xy_type getSize() const
Definition: rectangle.hh:267
value_type getWidth() const
Definition: rectangle.hh:121
bool intersects(const Segment< value_type > &other) const
Definition: linearsegment.hh:84
value_type getRight() const
Definition: rectangle.hh:114
T round_to_multiple_of(T value, T factor)
Definition: rounding.hh:32
void setTop(value_type v)
Definition: rectangle.hh:116
Rectangle< T > make_rect_from_start_end(Point< T > start, Point< T > end)
Definition: rectangle.hh:296
Rectangle(typename std::enable_if<!T_is_int, Rectangle< int > const & >::type rect)
Definition: rectangle.hh:56
Segment< value_type > horizontally
Definition: rectangle.hh:279
value_type getLeft() const
Definition: rectangle.hh:110
bool contains(xy_type const &other) const
Definition: rectangle.hh:74
xy_type getTopRight() const
Definition: rectangle.hh:135
void reduceSizeToMultipleOf(value_type m)
Definition: linearsegment.hh:89
const Segment< value_type > & getHorizontally() const
Definition: rectangle.hh:257
value_type height() const
Definition: rectangle.hh:131
Rectangle< value_type > above(value_type v) const
Definition: rectangle.hh:153
cairo_rectangle_int_t toGdkRectangle() const
Definition: rectangle.hh:62
Segment moveTo(value_type p) const
Definition: linearsegment.hh:75
Segment< value_type > intersection(const Segment< value_type > &other) const
Definition: linearsegment.hh:91
void setEnd(value_type n)
Definition: linearsegment.hh:192
value_type y() const
Definition: rectangle.hh:127
Rectangle< value_type > & operator*=(value_type other)
Definition: rectangle.hh:229
T center(Segment< T > s)
Definition: linearsegment.hh:246
Point< typename std::common_type< T, U >::type > operator*(Point< T > left, Point< U > right)
Definition: point.hh:154
value_type getStart() const
Definition: linearsegment.hh:133
void setBottom(value_type v)
Definition: rectangle.hh:118
Rectangle< value_type > rightOf(Rectangle< value_type > const &r) const
Definition: rectangle.hh:173
Definition: rectangle.hh:22
std::ostream & operator<<(std::ostream &os, const Segment< T > &s)
Definition: linearsegment.hh:235
Segment< double > roundOutward(Segment< double > s)
Definition: linearsegment.hh:240
cairo_rectangle_int_t createCairoIntRectangle(int x, int y, int width, int height)
Definition: gtk-helpers.hh:71
bool isEmpty() const
Definition: linearsegment.hh:139
value_type getTop() const
Definition: rectangle.hh:108
Rectangle< value_type > leftOf(value_type v) const
Definition: rectangle.hh:143
value_type getSize() const
Definition: linearsegment.hh:137
value_type y
Definition: point.hh:112
Rectangle< value_type > & operator+=(xy_type const &other)
Definition: rectangle.hh:220
Segment< value_type > before(value_type v) const
Definition: linearsegment.hh:107
void reduceSizeToMultipleOf(value_type size)
Definition: rectangle.hh:89
Segment< value_type > after(value_type v) const
Definition: linearsegment.hh:120
void setStart(value_type n)
Definition: linearsegment.hh:185