From: Mikko L. <laz...@us...> - 2004-06-15 19:30:22
|
Update of /cvsroot/rtk/rtk/rtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17438 Modified Files: Matrix.h Log Message: minor changes in method names Index: Matrix.h =================================================================== RCS file: /cvsroot/rtk/rtk/rtk/Matrix.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Matrix.h 15 Jun 2004 19:12:45 -0000 1.1 --- Matrix.h 15 Jun 2004 19:30:12 -0000 1.2 *************** *** 57,75 **** { public: ! Matrix() { set_identity(); } ! Matrix(float M11, float M12, float M21, float M22, float X, float Y) { set_matrix(M11, M12, M21, M22, X, Y); } Matrix(const Matrix &m) { ! copy(m); } Matrix& operator=(const Matrix &m) { ! return copy(m); } ! Matrix& copy(const Matrix &m); ! void set_matrix(float M11, float M12, float M21, float M22, float X, float Y, bool trivial = false); /// X scaling factor --- 57,75 ---- { public: ! Matrix() { SetIdentity(); } ! Matrix(float M11, float M12, float M21, float M22, float X, float Y) { SetMatrix(M11, M12, M21, M22, X, Y); } Matrix(const Matrix &m) { ! CopyFrom(m); } Matrix& operator=(const Matrix &m) { ! return CopyFrom(m); } ! Matrix& CopyFrom(const Matrix &m); ! void SetMatrix(float M11, float M12, float M21, float M22, float X, float Y, bool trivial = false); /// X scaling factor *************** *** 98,118 **** * All elements are set to zero, except m[0][0] and m[1][1] (scaling) which are set to 1. */ ! void set_identity() { set_matrix(1, 0, 0, 1, 0, 0, true); } ! void translate(float dx, float dy); ! void translate(int dx, int dy); ! void transform(float &dx, float &dy) const; ! void transform(int &dx, int &dy) const; ! void transform_distance(float &dx, float &dy) const; ! void rotate(float degrees); ! void scale(float factor_x, float factor_y); ! void scale(float factor) { scale(factor, factor); } ! void shear(float factor_h, float factor_v); /** Multiply this matrix by given values. */ ! void multiply(float M11, float M12, float M21, float M22, float X, float Y); ! void multiply(const Matrix &m) { multiply(m.m11, m.m12, m.m21, m.m22, m.x, m.y); } ! Matrix &operator *= (const Matrix &m) { multiply(m); return *this; } bool operator == (const Matrix &m) const { --- 98,118 ---- * All elements are set to zero, except m[0][0] and m[1][1] (scaling) which are set to 1. */ ! void SetIdentity() { SetMatrix(1, 0, 0, 1, 0, 0, true); } ! void Translate(float dx, float dy); ! void Translate(int dx, int dy); ! void Transform(float &dx, float &dy) const; ! void Transform(int &dx, int &dy) const; ! void Transform_distance(float &dx, float &dy) const; ! void Rotate(float degrees); ! void Scale(float factor_x, float factor_y); ! void Scale(float factor) { Scale(factor, factor); } ! void Shear(float factor_h, float factor_v); /** Multiply this matrix by given values. */ ! void Multiply(float M11, float M12, float M21, float M22, float X, float Y); ! void Multiply(const Matrix &m) { Multiply(m.m11, m.m12, m.m21, m.m22, m.x, m.y); } ! Matrix &operator *= (const Matrix &m) { Multiply(m); return *this; } bool operator == (const Matrix &m) const { |