HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EX_Vector.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: evvector.C ( EXPR Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __EX_Vector_h__
12 #define __EX_Vector_h__
13 
14 #include "EXPR_API.h"
15 class ev_Matrix;
16 
17 #include <SYS/SYS_Types.h>
18 #include <UT/UT_VectorTypes.h>
19 
20 //
21 // Class definition for array data types
22 //
23 
25 public:
26  ev_Vector(int size=1);
27  ev_Vector(const ev_Vector &src);
28  ~ev_Vector();
29 
30  int getSize() const { return (int)myArray[0]; }
31  fpreal getValue(int idx) const;
32  fpreal fastGet(int idx) const { return myArray[idx+1]; }
33  void setValue(int idx, fpreal val);
34  void fastSet(int idx, fpreal val) { myArray[idx+1] = val; }
35 
36  void copy(const ev_Vector &src);
37  void add(const ev_Vector &src);
38  void sub(const ev_Vector &src);
39  void times(fpreal scalar);
40  void times(const ev_Matrix &src);
41 
42  void getVector3(UT_Vector3R &v) const;
43  void getVector4(UT_Vector4R &v) const;
44  void setVector3(const UT_Vector3R &v);
45  void setVector4(const UT_Vector4R &v);
46 
47  int castFrom(const char *str);
48  int castFrom(fpreal val);
49  int castFrom(ev_Matrix &from);
50  int castTo(ev_Matrix &to) const;
51  int castToFloat(fpreal &rval) const;
52  char *castToString() const;
53 
54  // Returns 1 if it's a valid vector string
55  int scan(const char *str);
56 
57  fpreal operator()(int idx) const { return fastGet(idx); }
58  fpreal operator[](int idx) const { return getValue(idx); }
59  void grow(int newsize);
60 
61 private:
62 
63  fpreal *myArray;
64 };
65 
66 #endif
const GLdouble * v
Definition: glcorearb.h:836
fpreal operator()(int idx) const
Definition: EX_Vector.h:57
GLsizeiptr size
Definition: glcorearb.h:663
int getSize() const
Definition: EX_Vector.h:30
void fastSet(int idx, fpreal val)
Definition: EX_Vector.h:34
double fpreal
Definition: SYS_Types.h:270
fpreal operator[](int idx) const
Definition: EX_Vector.h:58
GLuint GLfloat * val
Definition: glcorearb.h:1607
fpreal fastGet(int idx) const
Definition: EX_Vector.h:32
#define EXPR_API
Definition: EXPR_API.h:10
GLenum src
Definition: glcorearb.h:1792