IvfMat4d.h

00001 //
00002 // Copyright 1999-2006 by Structural Mechanics, Lund University.
00003 //
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Library General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2 of the License, or (at your option) any later version.
00008 //
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // Library General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU Library General Public
00015 // License along with this library; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00017 // USA.
00018 //
00019 // Please report all bugs and problems to "ivf@byggmek.lth.se".
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         //CIvfVec4d operator*(CIvfVec4d& v);
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 

Generated on Fri Sep 1 15:36:47 2006 for Interactive Visualisation Framework - Ivf++ by  doxygen 1.4.6-NO