ionflux.org | Impressum

Vector3.hpp

Go to the documentation of this file.
00001 #ifndef IONFLUX_TOOLS_VECTOR3
00002 #define IONFLUX_TOOLS_VECTOR3
00003 /* ==========================================================================
00004  * Ionflux Tools
00005  * Copyright (c) 2005 Joern P. Meier
00006  * mail@ionflux.org
00007  * --------------------------------------------------------------------------
00008  * Vector3.hpp                       Vector (R3).
00009  * ==========================================================================
00010  * 
00011  * This file is part of Ionflux Tools.
00012  * 
00013  * Ionflux Tools is free software; you can redistribute it and/or modify it
00014  * under the terms of the GNU General Public License as published by the 
00015  * Free Software Foundation; either version 2 of the License, or (at your 
00016  * option) any later version.
00017  * 
00018  * Ionflux Tools is distributed in the hope that it will be useful, but 
00019  * WITHOUT ANY WARRANTY; without even the implied warranty of 
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
00021  * General Public License for more details.
00022  * 
00023  * You should have received a copy of the GNU General Public License along 
00024  * with Ionflux Tools; if not, write to the Free Software Foundation, Inc.,
00025  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00026  * 
00027  * ========================================================================== */
00028 
00029 #include <string>
00030 #include <iostream>
00031 #include <sstream>
00032 #include "ionflux/ManagedObject.hpp"
00033 
00034 namespace Ionflux
00035 {
00036 
00037 namespace Tools
00038 {
00039 
00051 class Vector3
00052 : public ManagedObject
00053 {
00054     protected:
00056         double* comp;
00057         
00058     public:
00063         Vector3();
00064         
00073         Vector3(double initX1, double initX2, double initX3);
00074         
00081         Vector3(const Vector3& initVec);
00082         
00091         Vector3(const double* initComp);
00092         
00097         virtual ~Vector3();
00098         
00107         virtual void setComps(double newX1, double newX2, double newX3);
00108         
00117         virtual void setComps(const double* newComp);
00118         
00128         virtual void setComp(int compIndex, double newComp);
00129         
00135         virtual std::string toString() const;
00136         
00143         virtual Vector3& operator=(const Vector3& newVec);
00144         
00151         virtual Vector3 operator+(const Vector3& otherVec) const;
00152         
00159         virtual Vector3 operator-(const Vector3& otherVec) const;
00160         
00167         virtual Vector3& operator+=(const Vector3& otherVec);
00168         
00175         virtual Vector3& operator-=(const Vector3& otherVec);
00176         
00183         virtual double operator*(const Vector3& otherVec) const;
00184         
00191         virtual Vector3& operator*=(double a);
00192         
00199         virtual Vector3 operator*(double a) const;
00200         
00209         virtual double operator[](int compIndex) const;
00210         
00217         virtual void setX1(double newX1);
00218         
00225         virtual void setX2(double newX2);
00226         
00233         virtual void setX3(double newX3);
00234         
00239         virtual double getX1() const;
00240         
00245         virtual double getX2() const;
00246         
00251         virtual double getX3() const;
00252 };
00253 
00261 Vector3 operator*(double a, const Vector3& vec);
00262 
00264 
00265 }
00266 
00267 }
00268 
00272 #endif

Generated on Tue Mar 14 20:58:30 2006 for Ionflux Tools Class Library (iftools) by  doxygen 1.4.6