00001 #ifndef IONFLUX_TOOLS_VECTOR3
00002 #define IONFLUX_TOOLS_VECTOR3
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
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