All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
point.hpp
Go to the documentation of this file.
#ifndef OPENPOSE_CORE_POINT_HPP
#define OPENPOSE_CORE_POINT_HPP
#include <string>
#include <openpose/core/macros.hpp>
namespace op
{
template<typename T>
struct Point
{
T x;
T y;
Point(const T x = 0, const T y = 0);
Point<T>(const Point<T>& point);
Point<T>& operator=(const Point<T>& point);
Point<T>(Point<T>&& point);
Point<T>& operator=(Point<T>&& point);
inline T area() const
{
return x * y;
}
std::string toString() const;
// ------------------------------ Comparison operators ------------------------------ //
inline bool operator<(const Point<T>& point) const
{
return area() < point.area();
}
inline bool operator>(const Point<T>& point) const
{
return area() > point.area();
}
inline bool operator<=(const Point<T>& point) const
{
return area() <= point.area();
}
inline bool operator>=(const Point<T>& point) const
{
return area() >= point.area();
}
inline bool operator==(const Point<T>& point) const
{
return area() == point.area();
}
inline bool operator!=(const Point<T>& point) const
{
return area() != point.area();
}
// ------------------------------ Basic Operators ------------------------------ //
Point<T>& operator+=(const Point<T>& point);
Point<T> operator+(const Point<T>& point) const;
Point<T>& operator+=(const T value);
Point<T> operator+(const T value) const;
Point<T>& operator-=(const Point<T>& point);
Point<T> operator-(const Point<T>& point) const;
Point<T>& operator-=(const T value);
Point<T> operator-(const T value) const;
Point<T>& operator*=(const T value);
Point<T> operator*(const T value) const;
Point<T>& operator/=(const T value);
Point<T> operator/(const T value) const;
};
// Static methods
OVERLOAD_C_OUT(Point)
}
#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