| 
      
      
      From: Jonathan P. <jp...@us...> - 2004-10-30 15:55:35
      
     | 
| Update of /cvsroot/sheepengine/sheep/src/common/math In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31142/src/common/math Modified Files: matrix.cpp matrix.h matrix3.cpp matrix3.h matrix4.cpp matrix4.h octree.h point2.cpp point2.h point3.cpp point3.h quaternion.cpp quaternion.h vector.cpp vector.h vector2.cpp vector2.h vector3.cpp vector3.h vector4.cpp vector4.h Log Message: dictoon's remaining changes : - htmlstream removed - ProgressMonitor renamed to IProgressMonitor - ConsoleProgressMonitor no longer single-line - misc const improvements - BinaryStream rewritten - Stopwatch class Index: matrix3.h =================================================================== RCS file: /cvsroot/sheepengine/sheep/src/common/math/matrix3.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** matrix3.h 13 May 2004 23:12:24 -0000 1.2 --- matrix3.h 30 Oct 2004 15:55:06 -0000 1.3 *************** *** 24,28 **** #define SHEEP_MATH_MATRIX3_H - #include "common/misc/htmlstream.h" #include "quaternion.h" #include "real.h" --- 24,27 ---- *************** *** 100,106 **** Matrix3 operator*(Real r, const Matrix3 &m); - //! Deprecated. - htmlstream& operator<<(htmlstream& s, const Matrix3 &m); - #include "matrix3.inl" --- 99,102 ---- Index: point3.cpp =================================================================== RCS file: /cvsroot/sheepengine/sheep/src/common/math/point3.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** point3.cpp 13 May 2004 23:12:24 -0000 1.2 --- point3.cpp 30 Oct 2004 15:55:06 -0000 1.3 *************** *** 22,42 **** #include "point3.h" // include first - - #include <iostream> - - using namespace sheep; - using std::endl; - - htmlstream &operator<<(htmlstream &s, const Point3 &p) { - s << "<table border=\"1\">" << endl; - s << "<tr>" << endl; - - s << "<td>" << p.m_x << "</td>" << endl; - s << "<td>" << p.m_y << "</td>" << endl; - s << "<td>" << p.m_z << "</td>" << endl; - - s << "</tr>" << endl; - s << "</table>" << endl; - - return s; - } --- 22,23 ---- Index: matrix.h =================================================================== RCS file: /cvsroot/sheepengine/sheep/src/common/math/matrix.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** matrix.h 13 May 2004 23:12:24 -0000 1.2 --- matrix.h 30 Oct 2004 15:55:06 -0000 1.3 *************** *** 24,28 **** #define SHEEP_MATH_MATRIX_H - #include "common/misc/htmlstream.h" #include "real.h" #include "vector.h" --- 24,27 ---- *************** *** 102,108 **** Matrix operator*(Real r, const Matrix &m); - //! Deprecated. - htmlstream& operator<<(htmlstream& s, const Matrix &m); - #include "matrix.inl" --- 101,104 ---- Index: quaternion.h =================================================================== RCS file: /cvsroot/sheepengine/sheep/src/common/math/quaternion.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** quaternion.h 13 May 2004 23:12:24 -0000 1.2 --- quaternion.h 30 Oct 2004 15:55:06 -0000 1.3 *************** *** 24,28 **** #define SHEEP_MATH_QUATERNION_H - #include "common/misc/htmlstream.h" #include "real.h" #include "vector3.h" --- 24,27 ---- *************** *** 89,95 **** Quaternion operator*(Real r, const Quaternion &q); - //! Deprecated. - htmlstream& operator<<(htmlstream& s, const Quaternion &q); - #include "quaternion.inl" --- 88,91 ---- Index: matrix4.cpp =================================================================== RCS file: /cvsroot/sheepengine/sheep/src/common/math/matrix4.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** matrix4.cpp 13 May 2004 23:12:24 -0000 1.2 --- matrix4.cpp 30 Oct 2004 15:55:06 -0000 1.3 *************** *** 22,47 **** #include "matrix4.h" // include first - - #include <iostream> - - using namespace sheep; - - using std::endl; - - htmlstream &operator<<(htmlstream &s, const Matrix4 &m) { - s << "<table border=\"1\">" << endl; - - for(int i = 0; i < 4; ++i) { - s << "<tr>" << endl; - - for(int j = 0; j < 4; ++j) { - s << "<td>" << m(i, j) << "</td>" << endl; - } - - s << "</tr>" << endl; - } - - s << "</table>" << endl; - - return s; - } --- 22,23 ---- Index: octree.h =================================================================== RCS file: /cvsroot/sheepengine/sheep/src/common/math/octree.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** octree.h 6 Jun 2004 12:19:57 -0000 1.4 --- octree.h 30 Oct 2004 15:55:06 -0000 1.5 *************** *** 148,154 **** // If it is a leaf, visit it. if(m_is_leaf) { ! Real t0 = max<Real>(tx0, ty0, tz0); ! Real t1 = min<Real>(tx1, ty1, tz1); ! return visitor.Trace(this, t0, t1); } --- 148,153 ---- // If it is a leaf, visit it. if(m_is_leaf) { ! const Real t0 = max<Real>(tx0, ty0, tz0); ! const Real t1 = min<Real>(tx1, ty1, tz1); return visitor.Trace(this, t0, t1); } *************** *** 163,167 **** const Real &z1 = m_voxel.m_max.m_z; ! const Real INF = 1e9; Real txm, tym, tzm; --- 162,166 ---- const Real &z1 = m_voxel.m_max.m_z; ! const Real INF = 1.0e9; Real txm, tym, tzm; *************** *** 323,329 **** assert(m_root); ! Real x = point.m_x; ! Real y = point.m_y; ! Real z = point.m_z; const Point3 &box_min = m_root->m_voxel.m_min; --- 322,328 ---- assert(m_root); ! const Real x = point.m_x; ! const Real y = point.m_y; ! const Real z = point.m_z; const Point3 &box_min = m_root->m_voxel.m_min; *************** *** 353,357 **** //! entitled "An Efficient Parametric Algorithm for Octree Traversal" by //! J. Revelles, C. Urena and M. Lastra. This paper can be found at the ! //! following address: http://wscg.zcu.cz/wscg2000/Papers_2000/X31.pdf. template<typename Visitor> void Trace(Point3 origin, Vector3 direction, Visitor &visitor) const { --- 352,356 ---- //! entitled "An Efficient Parametric Algorithm for Octree Traversal" by //! J. Revelles, C. Urena and M. Lastra. This paper can be found at the ! //! address http://wscg.zcu.cz/wscg2000/Papers_2000/X31.pdf. template<typename Visitor> void Trace(Point3 origin, Vector3 direction, Visitor &visitor) const { *************** *** 396,407 **** direction.m_x != 0.0 && direction.m_y != 0.0 && ! direction.m_z != 0.0); ! Real tx0 = (box_min.m_x - origin.m_x) / direction.m_x; ! Real tx1 = (box_max.m_x - origin.m_x) / direction.m_x; ! Real ty0 = (box_min.m_y - origin.m_y) / direction.m_y; ! Real ty1 = (box_max.m_y - origin.m_y) / direction.m_y; ! Real tz0 = (box_min.m_z - origin.m_z) / direction.m_z; ! Real tz1 = (box_max.m_z - origin.m_z) / direction.m_z; if(max(tx0, ty0, tz0) < min(tx1, ty1, tz1)) --- 395,407 ---- direction.m_x != 0.0 && direction.m_y != 0.0 && ! direction.m_z != 0.0 ! ); ! const Real tx0 = (box_min.m_x - origin.m_x) / direction.m_x; ! const Real tx1 = (box_max.m_x - origin.m_x) / direction.m_x; ! const Real ty0 = (box_min.m_y - origin.m_y) / direction.m_y; ! const Real ty1 = (box_max.m_y - origin.m_y) / direction.m_y; ! const Real tz0 = (box_min.m_z - origin.m_z) / direction.m_z; ! const Real tz1 = (box_max.m_z - origin.m_z) / direction.m_z; if(max(tx0, ty0, tz0) < min(tx1, ty1, tz1)) Index: matrix.cpp =================================================================== RCS file: /cvsroot/sheepengine/sheep/src/common/math/matrix.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** matrix.cpp 13 May 2004 23:12:24 -0000 1.2 --- matrix.cpp 30 Oct 2004 15:55:06 -0000 1.3 *************** *** 23,32 **** #include "matrix.h" // include first - #include <iostream> - using namespace sheep; - using std::endl; - Matrix Matrix::operator*(const Matrix &m) const { assert(m_c == m.m_r); --- 23,28 ---- *************** *** 194,216 **** //!\todo Implement. ! return 0; ! } ! ! htmlstream &operator<<(htmlstream &s, const Matrix &m) { ! s << "<table border=\"1\">" << endl; ! ! for(int i = 0; i < m.GetRows(); ++i) { ! s << "<tr>" << endl; ! ! for(int j = 0; j < m.GetColumns(); ++j) { ! s << "<td>" << m(i, j) << "</td>" << endl; ! } ! ! s << "</tr>" << endl; ! } ! ! s << "</table>" << endl; ! ! return s; } --- 190,195 ---- //!\todo Implement. + assert(!"Not implemented yet."); ! return 0.0; } Index: matrix4.h =================================================================== RCS file: /cvsroot/sheepengine/sheep/src/common/math/matrix4.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** matrix4.h 13 May 2004 23:12:24 -0000 1.2 --- matrix4.h 30 Oct 2004 15:55:06 -0000 1.3 *************** *** 24,28 **** #define SHEEP_MATH_MATRIX4_H - #include "common/misc/htmlstream.h" #include "quaternion.h" #include "point3.h" --- 24,27 ---- *************** *** 106,112 **** Matrix4 operator*(Real r, const Matrix4 &m); - //! Deprecated. - htmlstream& operator<<(htmlstream& s, const Matrix4 &m); - #include "matrix4.inl" --- 105,108 ---- Index: point2.cpp =================================================================== RCS file: /cvsroot/sheepengine/sheep/src/common/math/point2.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** point2.cpp 13 May 2004 23:12:24 -0000 1.2 --- point2.cpp 30 Oct 2004 15:55:06 -0000 1.3 *************** *** 22,41 **** #include "point2.h" // include first - - #include <iostream> - - using namespace sheep; - using std::endl; - - htmlstream &operator<<(htmlstream &s, const Point2 &p) { - s << "<table border=\"1\">" << endl; - s << "<tr>" << endl; - - s << "<td>" << p.m_x << "</td>" << endl; - s << "<td>" << p.m_y << "</td>" << endl; - - s << "</tr>" << endl; - s << "</table>" << endl; - - return s; - } --- 22,23 ---- Index: vector4.h =================================================================== RCS file: /cvsroot/sheepengine/sheep/src/common/math/vector4.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** vector4.h 13 May 2004 23:12:25 -0000 1.2 --- vector4.h 30 Oct 2004 15:55:06 -0000 1.3 *************** *** 24,28 **** #define SHEEP_MATH_VECTOR4_H - #include "common/misc/htmlstream.h" #include "real.h" --- 24,27 ---- *************** *** 78,84 **** Vector4 operator*(Real r, const Vector4 &v); - //! Deprecated. - htmlstream& operator<<(htmlstream &s, const Vector4 &v); - #include "vector4.inl" --- 77,80 ---- Index: vector3.cpp =================================================================== RCS file: /cvsroot/sheepengine/sheep/src/common/math/vector3.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** vector3.cpp 13 May 2004 23:12:24 -0000 1.2 --- vector3.cpp 30 Oct 2004 15:55:06 -0000 1.3 *************** *** 22,42 **** #include "vector3.h" // include first - - #include <iostream> - - using namespace sheep; - using std::endl; - - htmlstream &operator<<(htmlstream &s, const Vector3 &v) { - s << "<table border=\"1\">" << endl; - s << "<tr>" << endl; - - s << "<td>" << v.m_x << "</td>" << endl; - s << "<td>" << v.m_y << "</td>" << endl; - s << "<td>" << v.m_z << "</td>" << endl; - - s << "</tr>" << endl; - s << "</table>" << endl; - - return s; - } --- 22,23 ---- Index: point3.h =================================================================== RCS file: /cvsroot/sheepengine/sheep/src/common/math/point3.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** point3.h 13 May 2004 23:12:24 -0000 1.2 --- point3.h 30 Oct 2004 15:55:06 -0000 1.3 *************** *** 24,28 **** #define SHEEP_MATH_POINT3_H - #include "common/misc/htmlstream.h" #include "real.h" #include "vector3.h" --- 24,27 ---- *************** *** 60,66 **** Point3 &operator/=(Point3 &lhs, Real rhs); - //! Deprecated. - htmlstream& operator<<(htmlstream &s, const Point3 &p); - #include "point3.inl" --- 59,62 ---- Index: matrix3.cpp =================================================================== RCS file: /cvsroot/sheepengine/sheep/src/common/math/matrix3.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** matrix3.cpp 13 May 2004 23:12:24 -0000 1.2 --- matrix3.cpp 30 Oct 2004 15:55:06 -0000 1.3 *************** *** 22,47 **** #include "matrix3.h" // include first - - #include <iostream> - - using namespace sheep; - - using std::endl; - - htmlstream &operator<<(htmlstream &s, const Matrix3 &m) { - s << "<table border=\"1\">" << endl; - - for(int i = 0; i < 3; ++i) { - s << "<tr>" << endl; - - for(int j = 0; j < 3; ++j) { - s << "<td>" << m(i, j) << "</td>" << endl; - } - - s << "</tr>" << endl; - } - - s << "</table>" << endl; - - return s; - } --- 22,23 ---- Index: vector.h =================================================================== RCS file: /cvsroot/sheepengine/sheep/src/common/math/vector.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** vector.h 13 May 2004 23:12:24 -0000 1.2 --- vector.h 30 Oct 2004 15:55:06 -0000 1.3 *************** *** 24,28 **** #define SHEEP_MATH_VECTOR_H - #include "common/misc/htmlstream.h" #include "real.h" --- 24,27 ---- *************** *** 90,96 **** Vector operator*(Real r, const Vector &v); - //! Deprecated. - htmlstream& operator<<(htmlstream &s, const Vector &v); - #include "vector.inl" --- 89,92 ---- Index: vector4.cpp =================================================================== RCS file: /cvsroot/sheepengine/sheep/src/common/math/vector4.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** vector4.cpp 13 May 2004 23:12:25 -0000 1.2 --- vector4.cpp 30 Oct 2004 15:55:06 -0000 1.3 *************** *** 22,43 **** #include "vector4.h" // include first - - #include <iostream> - - using namespace sheep; - using std::endl; - - htmlstream &operator<<(htmlstream &s, const Vector4 &v) { - s << "<table border=\"1\">" << endl; - s << "<tr>" << endl; - - s << "<td>" << v.m_x << "</td>" << endl; - s << "<td>" << v.m_y << "</td>" << endl; - s << "<td>" << v.m_z << "</td>" << endl; - s << "<td>" << v.m_w << "</td>" << endl; - - s << "</tr>" << endl; - s << "</table>" << endl; - - return s; - } --- 22,23 ---- Index: vector2.cpp =================================================================== RCS file: /cvsroot/sheepengine/sheep/src/common/math/vector2.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** vector2.cpp 13 May 2004 23:12:24 -0000 1.2 --- vector2.cpp 30 Oct 2004 15:55:06 -0000 1.3 *************** *** 22,41 **** #include "vector2.h" // include first - - #include <iostream> - - using namespace sheep; - using std::endl; - - htmlstream &operator<<(htmlstream &s, const Vector2 &v) { - s << "<table border=\"1\">" << endl; - s << "<tr>" << endl; - - s << "<td>" << v.m_x << "</td>" << endl; - s << "<td>" << v.m_y << "</td>" << endl; - - s << "</tr>" << endl; - s << "</table>" << endl; - - return s; - } --- 22,23 ---- Index: quaternion.cpp =================================================================== RCS file: /cvsroot/sheepengine/sheep/src/common/math/quaternion.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** quaternion.cpp 13 May 2004 23:12:24 -0000 1.2 --- quaternion.cpp 30 Oct 2004 15:55:06 -0000 1.3 *************** *** 22,42 **** #include "quaternion.h" // include first - - #include <iostream> - - using namespace sheep; - - using std::endl; - - htmlstream &operator<<(htmlstream &s, const Quaternion &q) { - s << "<table border=\"1\">" << endl; - s << "<tr>" << endl; - - s << "<td>" << q.m_s << "</td>" << endl; - s << "<td>" << q.m_v << "</td>" << endl; - - s << "</tr>" << endl; - s << "</table>" << endl; - - return s; - } --- 22,23 ---- Index: point2.h =================================================================== RCS file: /cvsroot/sheepengine/sheep/src/common/math/point2.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** point2.h 13 May 2004 23:12:24 -0000 1.2 --- point2.h 30 Oct 2004 15:55:06 -0000 1.3 *************** *** 24,28 **** #define SHEEP_MATH_POINT2_H - #include "common/misc/htmlstream.h" #include "real.h" #include "vector2.h" --- 24,27 ---- *************** *** 60,66 **** Point2 &operator/=(Point2 &lhs, Real rhs); - //! Deprecated. - htmlstream& operator<<(htmlstream &s, const Point2 &p); - #include "point2.inl" --- 59,62 ---- Index: vector2.h =================================================================== RCS file: /cvsroot/sheepengine/sheep/src/common/math/vector2.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** vector2.h 13 May 2004 23:12:24 -0000 1.2 --- vector2.h 30 Oct 2004 15:55:06 -0000 1.3 *************** *** 24,28 **** #define SHEEP_MATH_VECTOR2_H - #include "common/misc/htmlstream.h" #include "real.h" --- 24,27 ---- *************** *** 80,86 **** Real operator*(const Vector2 &lhs, const Vector2 &rhs); - //! Deprecated. - htmlstream& operator<<(htmlstream &s, const Vector2 &v); - #include "vector2.inl" --- 79,82 ---- Index: vector.cpp =================================================================== RCS file: /cvsroot/sheepengine/sheep/src/common/math/vector.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** vector.cpp 13 May 2004 23:12:24 -0000 1.2 --- vector.cpp 30 Oct 2004 15:55:06 -0000 1.3 *************** *** 22,42 **** #include "vector.h" // include first - - #include <iostream> - - using namespace sheep; - - using std::endl; - - htmlstream &operator<<(htmlstream &s, const Vector &v) { - s << "<table border=\"1\">" << endl; - s << "<tr>" << endl; - - for(int i = 0; i < v.GetDimension(); ++i) - s << "<td>" << v[i] << "</td>" << endl; - - s << "</tr>" << endl; - s << "</table>" << endl; - - return s; - } --- 22,23 ---- Index: vector3.h =================================================================== RCS file: /cvsroot/sheepengine/sheep/src/common/math/vector3.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** vector3.h 13 May 2004 23:12:25 -0000 1.2 --- vector3.h 30 Oct 2004 15:55:06 -0000 1.3 *************** *** 24,28 **** #define SHEEP_MATH_VECTOR3_H - #include "common/misc/htmlstream.h" #include "real.h" --- 24,27 ---- *************** *** 90,96 **** bool fnz(const Vector3 &a, Real e = EPS); //!< Not zero: a != 0. - //! Deprecated. - htmlstream& operator<<(htmlstream &s, const Vector3 &v); - #include "vector3.inl" --- 89,92 ---- |