OpenPose 1.0.0rc2 OpenPose: A Real-Time Multi-Person Key-Point Detection And Multi-Threading C++ Library

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
point.hpp
Go to the documentation of this file.
1 #ifndef OPENPOSE_CORE_POINT_HPP
2 #define OPENPOSE_CORE_POINT_HPP
3
4 #include <string>
5 #include <openpose/core/macros.hpp>
6
7 namespace op
8 {
9 template<typename T>
10 struct Point
11 {
12 T x;
13 T y;
14
15 Point(const T x = 0, const T y = 0);
16
25 Point<T>(const Point<T>& point);
26
33 Point<T>& operator=(const Point<T>& point);
34
40 Point<T>(Point<T>&& point);
41
48 Point<T>& operator=(Point<T>&& point);
49
50 inline T area() const
51 {
52 return x * y;
53 }
54
60 std::string toString() const;
61
62
63
64
65
66 // ------------------------------ Comparison operators ------------------------------ //
72 inline bool operator<(const Point<T>& point) const
73 {
74 return area() < point.area();
75 }
76
82 inline bool operator>(const Point<T>& point) const
83 {
84 return area() > point.area();
85 }
86
92 inline bool operator<=(const Point<T>& point) const
93 {
94 return area() <= point.area();
95 }
96
102 inline bool operator>=(const Point<T>& point) const
103 {
104 return area() >= point.area();
105 }
106
112 inline bool operator==(const Point<T>& point) const
113 {
114 return area() == point.area();
115 }
116
122 inline bool operator!=(const Point<T>& point) const
123 {
124 return area() != point.area();
125 }
126
127
128
129
130
131 // ------------------------------ Basic Operators ------------------------------ //
132 Point<T>& operator+=(const Point<T>& point);
133
134 Point<T> operator+(const Point<T>& point) const;
135
136 Point<T>& operator+=(const T value);
137
138 Point<T> operator+(const T value) const;
139
140 Point<T>& operator-=(const Point<T>& point);
141
142 Point<T> operator-(const Point<T>& point) const;
143
144 Point<T>& operator-=(const T value);
145
146 Point<T> operator-(const T value) const;
147
148 Point<T>& operator*=(const T value);
149
150 Point<T> operator*(const T value) const;
151
152 Point<T>& operator/=(const T value);
153
154 Point<T> operator/(const T value) const;
155 };
156
157 // Static methods
158 OVERLOAD_C_OUT(Point)
159 }
160
161 #endif // OPENPOSE_CORE_POINT_HPP
op::Point::Point
Point(const T x=0, const T y=0)
op::Point::toString
std::string toString() const
op::Point::y
T y
Definition: point.hpp:13
op::Point::operator!=
bool operator!=(const Point< T > &point) const
Definition: point.hpp:122
op::Point::operator+
Point< T > operator+(const Point< T > &point) const
op::Point::operator=
Point< T > & operator=(const Point< T > &point)
op::Point
Definition: point.hpp:10
op::Point::operator*=
Point< T > & operator*=(const T value)
OVERLOAD_C_OUT
#define OVERLOAD_C_OUT(className)
Definition: macros.hpp:61
op::Point::operator-=
Point< T > & operator-=(const Point< T > &point)
op::Point::operator==
bool operator==(const Point< T > &point) const
Definition: point.hpp:112
op::Point::operator>=
bool operator>=(const Point< T > &point) const
Definition: point.hpp:102
op::Point::operator*
Point< T > operator*(const T value) const
op::Point::operator-
Point< T > operator-(const Point< T > &point) const
macros.hpp
op::Point::operator>
bool operator>(const Point< T > &point) const
Definition: point.hpp:82
op::Point::operator+=
Point< T > & operator+=(const Point< T > &point)
op::Point::operator/=
Point< T > & operator/=(const T value)
op::Point::area
T area() const
Definition: point.hpp:50
op::Point::x
T x
Definition: point.hpp:12
op::Point::operator/
Point< T > operator/(const T value) const
cl::string
std::string string
Definition: cl2.hpp:574