IvfVec4d.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 // Written by Jonas Lindemann
00023 //
00024 
00025 #ifndef _CIvfVec4d_h_
00026 #define _CIvfVec4d_h_
00027 
00028 #include <ivf/ivfconfig.h>
00029 #include <ivfmath/IvfMathBase.h>
00030 
00031 IvfSmartPointer(CIvfVec4d);
00032 
00041 class IVFMATH_API CIvfVec4d : public CIvfMathBase {
00042 private:
00043         double m_vector[4];
00044 public:
00046         CIvfVec4d();
00047 
00049         CIvfVec4d(double vx, double vy, double vz);
00050 
00052         CIvfVec4d(double vx, double vy, double vz, double vw);
00053 
00055         CIvfVec4d(CIvfVec4d& v);
00056 
00058         virtual ~CIvfVec4d();
00059 
00060         IvfClassInfo("CIvfVec4d",CIvfMathBase);
00061 
00063         void rotate(CIvfVec4d& axis, double angle);
00064 
00066         void normalize();
00067 
00069         double length();
00070 
00072         void negate();
00073 
00074 #ifdef IVF_HAVE_IOSTREAM
00075 
00076         void print(std::ostream &out);
00077 #else
00078 
00079         void print(ostream &out);
00080 #endif
00081 
00083         void getEulerAngles(double &pitch, double &heading);
00084 
00086         void setComponents(double vx, double vy, double vz);
00087 
00089         void setComponents(double vx, double vy, double vz, double vw);
00090 
00092         void getComponents(double &vx, double &vy, double &vz, double &vw);
00093 
00095         void getComponents(double &vx, double &vy, double &vz);
00096 
00098         void setComponents(const double *v);
00099 
00101         void getComponents(double* v);
00102 
00104         void setZ(double value);
00105 
00107         void setY(double value);
00108 
00110         void setX(double value);
00111 
00113         CIvfVec4d& operator+=(CIvfVec4d& a);
00114 
00116         CIvfVec4d& operator-=(CIvfVec4d& a);
00117 
00118         
00120         CIvfVec4d& operator=(CIvfVec4d& a);
00121 
00123         double operator[](const int idx);
00124 
00125 };
00126 
00128 IVFMATH_API CIvfVec4d& operator*(CIvfVec4d& a, CIvfVec4d& b);
00129 
00131 IVFMATH_API CIvfVec4d& operator*(CIvfVec4d& a, double b); 
00132 
00134 IVFMATH_API CIvfVec4d& operator*(double a, CIvfVec4d& b);
00135 
00137 IVFMATH_API CIvfVec4d& operator+(CIvfVec4d& a, CIvfVec4d& b);
00138 
00140 IVFMATH_API CIvfVec4d& operator-(CIvfVec4d& a, CIvfVec4d& b);
00141 
00142 IVFMATH_API CIvfVec4d& ivfGetTempVec4d();
00143 
00146 #endif 

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