git-svn-id: svn://db.shs.com.ru/pip@765 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2019-02-27 12:21:43 +00:00
parent 0435c2b332
commit b2da8546f5
5 changed files with 14 additions and 5 deletions

View File

@@ -28,6 +28,8 @@
#include "pivarianttypes.h"
#include "pitime.h"
#include "pigeometry.h"
#include "pimathmatrix.h"
#ifndef QNX
# define CUSTOM_PIVARIANT

View File

@@ -26,7 +26,6 @@
#define PIVARIANTYPES_H
#include "pistring.h"
#include "pimathmatrix.h"
class PIPropertyStorage;

View File

@@ -59,7 +59,7 @@ template<typename Type>
PICout operator <<(PICout & s, const PIPoint<Type> & v) {s.setControl(0, true); s << "Point{" << v.x << ", " << v.y << "}"; s.restoreControl(); return s;}
template<typename Type>
inline PIByteArray & operator <<(PIByteArray & s, PIPoint<Type> v) {s << v.x << v.y; return s;}
inline PIByteArray & operator <<(PIByteArray & s, const PIPoint<Type> & v) {s << v.x << v.y; return s;}
template<typename Type>
inline PIByteArray & operator >>(PIByteArray & s, PIPoint<Type> & v) {s >> v.x >> v.y; return s;}
@@ -144,7 +144,7 @@ template<typename Type>
PICout operator <<(PICout & s, const PIRect<Type> & v) {s.setControl(0, true); s << "Rect{" << v.x0 << ", " << v.y0 << "; " << v.x1 - v.x0 << ", " << v.y1 - v.y0 << "}"; s.restoreControl(); return s;}
template<typename Type>
inline PIByteArray & operator <<(PIByteArray & s, PIRect<Type> v) {s << v.x0 << v.x1 << v.y0 << v.y1; return s;}
inline PIByteArray & operator <<(PIByteArray & s, const PIRect<Type> & v) {s << v.x0 << v.x1 << v.y0 << v.y1; return s;}
template<typename Type>
inline PIByteArray & operator >>(PIByteArray & s, PIRect<Type> & v) {s >> v.x0 >> v.x1 >> v.y0 >> v.y1; return s;}

View File

@@ -494,6 +494,12 @@ inline std::ostream & operator <<(std::ostream & s, const PIMathMatrix<Type> & m
template<typename Type>
inline PICout operator <<(PICout s, const PIMathMatrix<Type> & m) {s << "Matrix{"; for (uint r = 0; r < m.rows(); ++r) { for (uint c = 0; c < m.cols(); ++c) { s << m.element(r, c); if (c < m.cols() - 1 || r < m.rows() - 1) s << ", ";} if (r < m.rows() - 1) s << PICoutManipulators::NewLine << " ";} s << "}"; return s;}
template<typename Type>
inline PIByteArray & operator <<(PIByteArray & s, const PIMathMatrix<Type> & v) {s << (const PIVector2D<Type> &)v; return s;}
template<typename Type>
inline PIByteArray & operator >>(PIByteArray & s, PIMathMatrix<Type> & v) {s >> (PIVector2D<Type> &)v; return s;}
/// Multiply matrices {CR x Rows0} on {Cols1 x CR}, result is {Cols1 x Rows0}
template<typename Type>
inline PIMathMatrix<Type> operator *(const PIMathMatrix<Type> & fm,

View File

@@ -178,6 +178,8 @@ typedef PIMathVectorT<4u, double> PIMathVectorT4d;
template<typename Type>
class PIP_EXPORT PIMathVector {
typedef PIMathVector<Type> _CVector;
template<typename TypeOp> friend PIByteArray & operator <<(PIByteArray & s, const PIMathVector<TypeOp> & v);
template<typename TypeOp> friend PIByteArray & operator >>(PIByteArray & s, PIMathVector<TypeOp> & v);
public:
PIMathVector(const uint size = 0) {c.resize(size);}
PIMathVector(const PIVector<Type> & val) {c.resize(val.size()); PIMV_FOR(i, 0) c[i] = val[i];}
@@ -258,9 +260,9 @@ inline std::ostream & operator <<(std::ostream & s, const PIMathVector<Type> & v
template<typename Type>
inline PICout operator <<(PICout s, const PIMathVector<Type> & v) {s << "Vector{"; for (uint i = 0; i < v.size(); ++i) {s << v[i]; if (i < v.size() - 1) s << ", ";} s << "}"; return s;}
template<uint Size, typename Type>
template<typename Type>
inline PIByteArray & operator <<(PIByteArray & s, const PIMathVector<Type> & v) {s << v.c; return s;}
template<uint Size, typename Type>
template<typename Type>
inline PIByteArray & operator >>(PIByteArray & s, PIMathVector<Type> & v) {s >> v.c; return s;}