math/Matrix4x4.h

Go to the documentation of this file.
00001 #ifndef Matrix4x4_h
00002 #define Matrix4x4_h 1
00003 
00004 //#include "Matrix.h"
00005 #include <iostream>
00006 
00007 class Vector4;
00008 class Matrixmxn;
00009 
00010 class Matrix4x4
00011 {
00012 
00013   public:
00014       Matrix4x4 ();
00015 
00016       virtual ~Matrix4x4();
00017 
00018 
00019       Matrix4x4 operator * (const Matrix4x4& right) const;
00020 
00021       Vector4 operator * (const Vector4& right) const;
00022 
00023       //        this returns the inverse of the matrix
00024       Matrix4x4 Inverse () const;
00025 
00026       Matrix4x4& operator *= (const Matrix4x4& right);
00027 
00028 
00029       static Matrix4x4 Identity ();
00030 
00031       //## Operation: operator()%926300306
00032       //        this is the accessor function for the matrix class.
00033       double& operator () (const unsigned int row, const unsigned int col);
00034 
00035       //## Operation: operator()%926300307
00036       //        this is the accessor function for the matrix class.
00037       const double& operator () (const unsigned int row, const unsigned int col) const;
00038 
00039       //## Operation: Scale%927223872
00040       //        this function multiplies the current matrix by a scaling
00041       //        matrix
00042       void Scale (const double x, const double y, const double z);
00043 
00044       //## Operation: Translate%927223873
00045       //        this function multiplies the current matrix by a scaling
00046       //        matrix
00047       void Translate (const double x, const double y, const double z);
00048 
00049       //## Operation: Rotate%928263345
00050       void Rotate (const Vector4& axis, double angle);
00051           void Rotate2 (const Vector4& axis, double angle);
00052 
00053       //## Operation: Translate%936229637
00054       //        this function multiplies the current matrix by a scaling
00055       //        matrix
00056       void Translate (const Vector4& offset);
00057 
00058       //## Operation: Transpose%945817286
00059       Matrix4x4 Transpose () const;
00060 
00061           //gets the values out of the matrix in an OpenGlCompatible way
00062           void GetValuesOpenGl ( double values[ 16 ] );
00063 
00064       //## Operation: SetValues%969569780
00065       void SetValues ( const double values[ 16 ] );
00066 
00067       //## Operation: SetValues%969569780
00068       void SetValues (const Matrix4x4& values);
00069 
00070           // Compare if two matrices are equal to within a given tolerance
00071           bool Compare ( const Matrix4x4& right, const double& tol ) const;
00072 
00073 
00074     // Data Members for Class Attributes
00075 
00076       //## Attribute: values%3724CF1503B6
00077       //## begin Matrix4x4::values%3724CF1503B6.attr preserve=no  public: double[4][4] {UA} 
00078       double values[4][4];
00079       //## end Matrix4x4::values%3724CF1503B6.attr
00080 
00081     // Additional Public Declarations
00082       //## begin Matrix4x4%36FE7C2C01F4.public preserve=yes
00083           bool operator < (const Matrix4x4& right) const;
00084           bool operator ==(const Matrix4x4& right) const;
00085           bool operator !=(const Matrix4x4& right) const;
00086       //## end Matrix4x4%36FE7C2C01F4.public
00087 
00088           operator Matrixmxn() const;
00089   protected:
00090     // Additional Protected Declarations
00091       //## begin Matrix4x4%36FE7C2C01F4.protected preserve=yes
00092       //## end Matrix4x4%36FE7C2C01F4.protected
00093 
00094   private:
00095     // Additional Private Declarations
00096       //## begin Matrix4x4%36FE7C2C01F4.private preserve=yes
00097       //## end Matrix4x4%36FE7C2C01F4.private
00098 
00099   private: //## implementation
00100     // Additional Implementation Declarations
00101       //## begin Matrix4x4%36FE7C2C01F4.implementation preserve=yes
00102       //## end Matrix4x4%36FE7C2C01F4.implementation
00103 
00104 };
00105 
00106 //## begin Matrix4x4%36FE7C2C01F4.postscript preserve=yes
00107 //## end Matrix4x4%36FE7C2C01F4.postscript
00108 
00109 // Class Matrix4x4 
00110 
00111 
00112 //## Other Operations (inline)
00113 inline double& Matrix4x4::operator () (const unsigned int row, const unsigned int col)
00114 {
00115   //## begin Matrix4x4::operator()%926300306.body preserve=yes
00116         return values[ row ][ col ] ;
00117   //## end Matrix4x4::operator()%926300306.body
00118 }
00119 
00120 inline const double& Matrix4x4::operator () (const unsigned int row, const unsigned int col) const
00121 {
00122   //## begin Matrix4x4::operator()%926300307.body preserve=yes
00123         return values[ row ][ col ] ;
00124   //## end Matrix4x4::operator()%926300307.body
00125 }
00126 
00127 //## begin module%36FE7C2C01F4.epilog preserve=yes
00128 //## end module%36FE7C2C01F4.epilog
00129 
00130 std::ostream & operator<<( std::ostream &os, const Matrix4x4& m ) ;
00131 std::istream & operator>>( std::istream &is, Matrix4x4& m ) ;
00132 
00133 #endif

Generated on Sat Apr 1 21:30:38 2006 for Motion Planning Kernel by  doxygen 1.4.6-NO