00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _CIvfMat4d_h_
00023 #define _CIvfMat4d_h_
00024
00025 #include <ivf/ivfconfig.h>
00026 #include <ivfmath/IvfMathBase.h>
00027 #include <ivfmath/IvfVec4d.h>
00028
00036 class IVFMATH_API CIvfMat4d : public CIvfMathBase {
00037 private:
00038 double m_matrix[4][4];
00039 int LU_Decompose (double matrix[4][4], int* index);
00040 void LU_Backsub (double matrix[4][4], int* index, double* B);
00041 public:
00043 CIvfMat4d();
00044
00046 CIvfMat4d(CIvfMat4d& M);
00047
00049 CIvfMat4d(double scalar);
00050
00052 virtual ~CIvfMat4d();
00053
00055 void one();
00056
00058 void identity();
00059
00061 void zero();
00062
00064 void translate(double tx, double ty, double tz);
00065
00072 void rotateX(double angle);
00073
00080 void rotateY(double angle);
00081
00088 void rotateZ(double angle);
00089
00096 void rotate(double vx, double vy, double vz, double theta);
00097
00103 void scaling(double sx, double sy, double sz);
00104
00105 #ifdef IVF_HAVE_IOSTREAM
00106
00107 void print(std::ostream &out);
00108 #else
00109
00110 void print(ostream &out);
00111 #endif
00112
00118 void setComponent(int row, int col, double value);
00119
00121 double getComponent(int row, int col);
00122
00124 void setColumn(int col, double v1, double v2, double v3, double v4);
00125
00127 void setRow(int row, double v1, double v2, double v3, double v4);
00128
00130 CIvfMat4d& t();
00131
00133 CIvfMat4d& inv();
00134
00136 CIvfMat4d& operator=(CIvfMat4d& A);
00137
00139 CIvfMat4d& operator=(double a);
00140
00142 CIvfMat4d& operator+=(CIvfMat4d& A);
00143
00145 CIvfMat4d& operator-=(CIvfMat4d& A);
00146
00148 CIvfMat4d& operator*(CIvfMat4d& A);
00149
00151 CIvfVec4d& operator*(CIvfVec4d& v);
00152
00154
00155
00157 CIvfMat4d& operator*(double scalar);
00158
00160 CIvfMat4d& operator/(double scalar);
00161
00163 CIvfMat4d& operator+(CIvfMat4d& A);
00164 };
00165
00166 IVFMATH_API CIvfMat4d& ivfGetTempMatrix4d();
00167
00170 #endif