00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __EX_Vector_h__
00020 #define __EX_Vector_h__
00021
00022 #include "EXPR_API.h"
00023 class ev_Matrix;
00024 class UT_Vector3;
00025 class UT_Vector4;
00026
00027
00028
00029
00030
00031 class EXPR_API ev_Vector {
00032 public:
00033 ev_Vector(int size=1);
00034 ev_Vector(const ev_Vector &src);
00035 ~ev_Vector();
00036
00037 int getSize() const { return (int)myArray[0]; }
00038 float getValue(int idx) const;
00039 float fastGet(int idx) const { return myArray[idx+1]; }
00040 void setValue(int idx, float val);
00041
00042 void copy(const ev_Vector &src);
00043 void add(const ev_Vector &src);
00044 void sub(const ev_Vector &src);
00045 void times(float scalar);
00046 void times(const ev_Matrix &src);
00047
00048 void getVector3(UT_Vector3 &v) const;
00049 void getVector4(UT_Vector4 &v) const;
00050 void setVector3(const UT_Vector3 &v);
00051 void setVector4(const UT_Vector4 &v);
00052
00053 int castFrom(const char *str);
00054 int castFrom(float val);
00055 int castFrom(ev_Matrix &from);
00056 int castTo(ev_Matrix &to) const;
00057 int castToFloat(float &rval) const;
00058 char *castToString() const;
00059
00060
00061 int scan(const char *str);
00062
00063 float operator()(int idx) const { return fastGet(idx); }
00064 float operator[](int idx) const { return getValue(idx); }
00065 void grow(int newsize);
00066
00067 private:
00068
00069 float *myArray;
00070 };
00071
00072 #endif