Go to the documentation of this file.
13 #include <boost/operators.hpp>
24 :
public boost::addable<Point<T>>
25 ,
public boost::subtractable<Point<T>>
26 ,
public boost::multipliable2<Point<T>, T>
27 ,
public boost::dividable2<Point<T>, T>
52 explicit Point(
const GdkPoint& other)
102 template <
typename U>
105 return {
static_cast<U
>(
x),
static_cast<U
>(
y)};
108 [[nodiscard]] GdkPoint
toGdkPoint()
const {
return {
static_cast<int>(
x),
static_cast<int>(
y)}; }
115 template <
typename T>
121 template <
typename T>
127 template <
typename T>
130 return os <<
'(' << p.
x <<
',' << p.
y <<
')';
133 template <
typename T,
typename U>
136 using R =
typename std::common_type<T, U>::type;
143 template <
typename T,
typename U>
146 using R =
typename std::common_type<T, U>::type;
153 template <
typename T,
typename U>
156 using R =
typename std::common_type<T, U>::type;
163 template <
typename T,
typename U>
166 using R =
typename std::common_type<T, U>::type;
173 template <
typename T,
typename U>
179 template <
typename T,
typename U>
185 template <
typename T>
192 template <
typename T>
199 template <
typename T>
206 template <
typename T>
213 template <
typename T>
220 template <
typename T>
227 template <
typename T>
Point< value_type > & operator/=(value_type other)
Definition: point.hh:84
Point< typename std::common_type< T, U >::type > operator+(Point< T > left, Point< U > right)
Definition: point.hh:144
Definition: assertions.hh:14
Point< typename std::common_type< T, U >::type > operator-(Point< T > left, Point< U > right)
Definition: point.hh:134
Point< value_type > & operator*=(const Point< value_type > &other)
Definition: point.hh:77
Point< value_type > & operator*=(value_type other)
Definition: point.hh:70
double magnitude() const
Definition: point.hh:100
Point< value_type > & operator+=(const Point< value_type > &other)
Definition: point.hh:61
Point< value_type > & operator-=(const Point< value_type > &other)
Definition: point.hh:68
value_type x
Definition: point.hh:111
Point< T > make_point(T x, T y)
Definition: point.hh:116
Point(value_type x_, value_type y_)
Definition: point.hh:39
Point< value_type > & operator/=(const Point< value_type > &other)
Definition: point.hh:91
Point< T > ceil(Point< T > p)
Definition: point.hh:228
Point< U > to() const
Definition: point.hh:103
Point< T > rounded_divide_by(Point< T > value, Point< T > factor)
Definition: point.hh:207
bool operator!=(const Point< value_type > &other) const
Definition: point.hh:59
Point< T > ceiled_divide_by(Point< T > value, T factor)
Definition: point.hh:193
Point(Point< U > other)
Definition: point.hh:46
Point< T > floored_divide_by(Point< T > value, Point< T > factor)
Definition: point.hh:221
Point(const GdkPoint &other)
Definition: point.hh:52
Point< T > floored_divide_by(Point< T > value, T factor)
Definition: point.hh:200
Point(value_type xy)
Definition: point.hh:34
int value_type
Definition: point.hh:30
Point< T > rounded_divide_by(Point< T > value, T factor)
Definition: point.hh:186
bool operator==(const Point< value_type > &other) const
Definition: point.hh:58
GdkPoint toGdkPoint() const
Definition: point.hh:108
Point< value_type > operator-() const
Definition: point.hh:98
Point< T > ceiled_divide_by(Point< T > value, Point< T > factor)
Definition: point.hh:214
Point< typename std::common_type< T, U >::type > operator*(Point< T > left, Point< U > right)
Definition: point.hh:154
std::ostream & operator<<(std::ostream &os, const Segment< T > &s)
Definition: linearsegment.hh:235
value_type y
Definition: point.hh:112
Point< typename std::common_type< T, U >::type > operator/(Point< T > left, Point< U > right)
Definition: point.hh:164