diff --git a/src_main/_unsused/pigeometry.h b/src_main/math/pigeometry.h old mode 100755 new mode 100644 similarity index 93% rename from src_main/_unsused/pigeometry.h rename to src_main/math/pigeometry.h index 635d7ebf..1fb42f97 --- a/src_main/_unsused/pigeometry.h +++ b/src_main/math/pigeometry.h @@ -20,7 +20,7 @@ #ifndef PIGEOMETRY_H #define PIGEOMETRY_H -#include "pimath.h" +#include "pimathbase.h" template class PIP_EXPORT PIPoint { @@ -28,14 +28,14 @@ public: Type x; Type y; - PIPoint() {x = y = 0;}; + PIPoint() {x = y = 0;} PIPoint(Type x_, Type y_) {set(x_, y_);} PIPoint & set(Type x_, Type y_) {x = x_; y = y_; return *this;} PIPoint & move(Type x_, Type y_) {x += x_; y += y_; return *this;} PIPoint & move(const PIPoint & p) {x += p.x; y += p.y; return *this;} double angleRad() const {return atan2(y, x);} - int angleDeg() const {return round(atan2(y, x) * 180. / M_PI);} + int angleDeg() const {return round(atan2(y, x) * rad2deg);} PIPoint toPolar(bool isDeg = false) const {return PIPoint(sqrt(x*x + y*y), isDeg ? angleDeg() : angleRad());} static PIPoint fromPolar(const PIPoint & p) {return PIPoint(p.y * cos(p.x), p.y * sin(p.x));} @@ -52,7 +52,7 @@ public: }; template -std::ostream & operator <<(std::ostream & s, const PIPoint & v) {s << '{' << v.x << ", " << v.y << '}'; return s;} +PICout operator <<(PICout & s, const PIPoint & v) {s.setControl(0, true); s << '{' << v.x << ", " << v.y << '}'; s.restoreControl(); return s;} template class PIP_EXPORT PIRect { @@ -62,7 +62,7 @@ public: Type x1; Type y1; - PIRect() {x0 = y0 = x1 = y1 = 0;}; + PIRect() {x0 = y0 = x1 = y1 = 0;} PIRect(Type x, Type y, Type w, Type h) {set(x, y, w, h);} PIRect(const PIPoint & tl, const PIPoint & br) {set(tl.x, tl.y, br.x, br.y);} PIRect(const PIPoint & p0, const PIPoint & p1, const PIPoint & p2) {set(piMin(p0.x, p1.x, p2.x), piMin(p0.y, p1.y, p2.y), @@ -122,7 +122,7 @@ public: }; template -std::ostream & operator <<(std::ostream & s, const PIRect & v) {s << '{' << v.x0 << ", " << v.y0 << "; " << v.x1 - v.x0 << ", " << v.y1 - v.y0 << '}'; return s;} +PICout operator <<(PICout & s, const PIRect & v) {s.setControl(0, true); s << '{' << v.x0 << ", " << v.y0 << "; " << v.x1 - v.x0 << ", " << v.y1 - v.y0 << '}'; s.restoreControl(); return s;} typedef PIPoint PIPointi; typedef PIPoint PIPointu; diff --git a/src_main/piversion.h b/src_main/piversion.h index be234bc7..60571897 100644 --- a/src_main/piversion.h +++ b/src_main/piversion.h @@ -3,7 +3,7 @@ #define PIVERSION_H #define PIP_VERSION_MAJOR 1 -#define PIP_VERSION_MINOR 2 +#define PIP_VERSION_MINOR 3 #define PIP_VERSION_REVISION 0 #define PIP_VERSION_SUFFIX "_alpha"