10 #include <wx/gdicmn.h>
14 template <
typename T,
typename TDerived>
26 return reinterpret_cast<T*
>(
this)[index];
31 return reinterpret_cast<const T*
>(
this)[index];
37 return static_cast<TDerived&
>(*this);
43 return static_cast<TDerived&
>(*this);
49 return static_cast<TDerived&
>(*this);
55 return static_cast<TDerived&
>(*this);
59 TDerived result(
static_cast<const TDerived&
>(*
this));
65 TDerived result(
static_cast<const TDerived&
>(*
this));
71 TDerived result(
static_cast<const TDerived&
>(*
this));
77 TDerived result(
static_cast<const TDerived&
>(*
this));
83 return x == other.x &&
y == other.y;
87 return !(*
this == other);
91 stream << p.
x <<
" " << p.
y;
110 explicit operator wxPoint()
const {
111 return wxPoint(this->
x, this->
y);
146 explicit operator wxPoint()
const {
147 return wxPoint(
int(
x),
int(
y));
151 template <
typename T,
typename TDerived>
#define SPH_ASSERT(x,...)
uint32_t Size
Integral type used to index arrays (by default).
Additional math routines (with more includes).
constexpr INLINE T sqr(const T &f) noexcept
Return a squared value.
INLINE T sqrt(const T f)
Return a squared root of a value.
Common macros and basic objects.
#define INLINE
Macros for conditional compilation based on selected compiler.
#define NAMESPACE_SPH_END
INLINE float getLength(const BasicPoint< T, TDerived > &p)
TDerived operator-(const TDerived &other) const
TDerived operator/(const float factor) const
const T & operator[](const Size index) const
bool operator==(const TDerived &other) const
TDerived & operator/=(const float factor)
TDerived & operator+=(const TDerived &other)
BasicPoint(const T x, const T y)
TDerived & operator-=(const TDerived &other)
TDerived operator*(const float factor) const
TDerived operator+(const TDerived &other) const
TDerived & operator*=(const float factor)
friend std::ostream & operator<<(std::ostream &stream, const BasicPoint &p)
T & operator[](const Size index)
bool operator!=(const TDerived &other) const
friend std::istream & operator>>(std::istream &stream, BasicPoint &p)
Coords operator*(const Coords &other) const
Coords operator/(const Coords &other) const
Coords(const float x, const float y)
Pixel(const int x, const int y)
Pixel(const wxPoint point)