ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-3.0/src/primitives/StuntDouble.hpp
Revision: 1683
Committed: Thu Oct 28 22:34:02 2004 UTC (19 years, 8 months ago)
File size: 2174 byte(s)
Log Message:
This commit was manufactured by cvs2svn to create branch 'new_design'.

File Contents

# Content
1 #ifndef __STUNTDOUBLE_HPP__
2 #define __STUNTDOUBLE_HPP__
3
4 #include <map>
5 #include "utils/GenericData.hpp"
6
7 #define OT_ATOM 0
8 #define OT_DATOM 1
9 #define OT_RIGIDBODY 2
10
11 using namespace std;
12 using namespace oopse;
13
14 class BaseVisitor;
15
16 class StuntDouble {
17 public:
18 virtual ~StuntDouble();
19
20 int getObjType();
21
22 bool isAtom(){
23 return objType == OT_ATOM || objType == OT_DATOM;
24 }
25
26 bool isDirectionalAtom(){
27 return objType == OT_DATOM;
28 }
29
30 bool isRigidBody(){
31 return objType == OT_RIGIDBODY;
32 }
33
34 bool isDirectional(){
35 return isDirectionalAtom() || isRigidBody();
36 }
37
38 virtual double getMass(void);
39
40 virtual void getPos(double pos[3]);
41 virtual void setPos(double pos[3]);
42
43 virtual void getVel(double vel[3]);
44 virtual void setVel(double vel[3]);
45
46 virtual void getFrc(double frc[3]);
47 virtual void addFrc(double frc[3]);
48
49 virtual void getA(double A[3][3]);
50 virtual void setA(double A[3][3]);
51
52 virtual void getJ(double j[3]);
53 virtual void setJ(double j[3]);
54
55 virtual void getQ( double q[4] ); // get the quanternions
56 virtual void setQ( double q[4] );
57
58 virtual void setType(char* type) = 0;
59 virtual char* getType() = 0;
60
61
62 virtual void getTrq(double trq[3]);
63 virtual void addTrq(double trq[3]);
64
65 virtual void getI(double I[3][3]);
66 virtual void lab2Body(double vec[3]);
67
68 virtual void getGrad(double grad[6]);
69 virtual void setEuler(double phi, double theta, double psi);
70 virtual void getEulerAngles(double eulers[3]);
71
72 virtual bool isLinear() {return false;}
73 virtual int linearAxis() {return -1;}
74
75 virtual double getZangle();
76 virtual void setZangle(double zAngle);
77 virtual void addZangle(double zAngle);
78
79 virtual void accept(BaseVisitor* v) = 0;
80
81 void addProperty(GenericData* data);
82 void removeProperty(const string& propName);
83 GenericData* getProperty(const string& propName);
84
85 protected:
86 StuntDouble(){}
87
88 //prevent default copy constructor copy information from properties which will cause problem
89 StuntDouble(const StuntDouble& sd){
90 objType = sd.objType;
91 }
92
93 int objType;
94
95 map<string, GenericData*> properties;
96 };
97
98 #endif

Properties

Name Value
svn:executable *