8#ifndef _SPoint_DEFINED_
9#define _SPoint_DEFINED_
11#include <interface/SRender-i.h>
12#include <matrix/SFloat.h>
16struct SOUI_EXP SPoint :
public fPoint
18 static SPoint Make(
float x,
float y)
25 static SPoint IMake(int32_t x, int32_t y)
32 static SPoint IMake(
const POINT &src)
35 pt.iset(src.x, src.y);
53 return (0 == fX) & (0 == fY);
57 void set(
float x,
float y)
66 void iset(int32_t x, int32_t y);
71 void iset(
const POINT &p);
77 return SPoint::Length(fX, fY);
81 SPoint operator-()
const
91 void operator+=(
const SPoint &v)
99 void operator-=(
const SPoint &v)
105 friend bool operator==(
const SPoint &a,
const SPoint &b)
107 return a.fX == b.fX && a.fY == b.fY;
110 friend bool operator!=(
const SPoint &a,
const SPoint &b)
112 return a.fX != b.fX || a.fY != b.fY;
118 friend SPoint operator-(
const SPoint &a,
const SPoint &b)
121 v.set(a.fX - b.fX, a.fY - b.fY);
127 friend SPoint operator+(
const SPoint &a,
const SPoint &b)
130 v.set(a.fX + b.fX, a.fY + b.fY);
135 static float Length(
float x,
float y);
139 static float DotProduct(
const SPoint &a,
const SPoint &b);
141 float dot(
const SPoint &vec)
const;
143 POINT toPoint()
const;
146typedef SPoint SVector2D;