source: cpp/frams/vm/classes/3dobject.h @ 112

Last change on this file since 112 was 109, checked in by sz, 11 years ago

source reorganization (see README)
new feature added: part/joint shapes (see frams/_demos/part_shapes.cpp)

  • Property svn:eol-style set to native
File size: 2.5 KB
Line 
1#ifndef _3DOBJECT_H_
2#define _3DOBJECT_H_
3
4#include <frams/util/3d.h>
5#include <frams/util/extvalue.h>
6
7class Pt3D_Ext: public DestrBase
8{
9  public:
10Pt3D p;
11
12Pt3D_Ext(double x,double y,double z):p(x,y,z) {}
13Pt3D_Ext():p(0,0,0) {}
14Pt3D_Ext(const Pt3D &i):p(i) {}
15#define STATRICKCLASS Pt3D_Ext
16PARAMPROCDEF(p_new);
17PARAMPROCDEF(p_newFromVector);
18PARAMPROCDEF(p_clone);
19PARAMGETDEF(length);
20PARAMPROCDEF(p_addvec);
21PARAMPROCDEF(p_subvec);
22PARAMPROCDEF(p_scale);
23PARAMPROCDEF(p_rotate);
24PARAMPROCDEF(p_revrotate);
25PARAMPROCDEF(p_normalize);
26PARAMGETDEF(toString);
27PARAMGETDEF(toVector);
28PARAMPROCDEF(p_set);
29PARAMPROCDEF(p_set3);
30PARAMPROCDEF(p_get);
31#undef STATRICKCLASS
32
33static ParamInterface* getInterface();
34static ExtObject makeStaticObject(Pt3D* p);
35static ExtObject makeDynamicObject(Pt3D_Ext* p);
36static Pt3D_Ext* fromObject(const ExtValue& v);
37static Param& getStaticParam();
38static ParamEntry* getStaticParamtab();
39};
40
41class Orient_Ext: public DestrBase
42{
43  public:
44Orient o;
45
46Orient_Ext():o(Orient_1) {}
47Orient_Ext(const Orient& other):o(other) {}
48#define STATRICKCLASS Orient_Ext
49PARAMPROCDEF(p_new);
50PARAMPROCDEF(p_newFromVector);
51PARAMPROCDEF(p_clone);
52PARAMGETDEF(toString);
53PARAMGETDEF(toVector);
54PARAMGETDEF(x);
55PARAMGETDEF(y);
56PARAMGETDEF(z);
57PARAMPROCDEF(p_rotate3);
58PARAMPROCDEF(p_rotate);
59PARAMPROCDEF(p_revrotate);
60PARAMPROCDEF(p_lookat);
61PARAMPROCDEF(p_normalize);
62PARAMPROCDEF(p_between2);
63PARAMPROCDEF(p_betweenOV);
64PARAMPROCDEF(p_set);
65PARAMPROCDEF(p_reset);
66PARAMPROCDEF(p_localToWorld);
67PARAMPROCDEF(p_worldToLocal);
68#undef STATRICKCLASS
69
70static ParamInterface* getInterface();
71static ExtObject makeStaticObject(Orient* p);
72static ExtObject makeDynamicObject(Orient_Ext* p);
73static Orient_Ext* fromObject(const ExtValue& v);
74static Param& getStaticParam();
75static ParamEntry* getStaticParamtab();
76};
77
78class ReferenceObj: public DestrBase
79{
80  public:
81ExtValue *value;
82ExtObject obj;
83int prop;
84
85ReferenceObj(ExtValue *val):value(val) {}
86ReferenceObj() {}
87ReferenceObj(const ExtObject &o,int p):value(0),obj(o),prop(p) {}
88ReferenceObj(const ExtObject &o,const SString &p);
89#define STATRICKCLASS ReferenceObj
90PARAMPROCDEF(p_newS);
91PARAMPROCDEF(p_newO);
92PARAMPROCDEF(p_copyFrom);
93PARAMGETDEF(toString);
94PARAMGETDEF(value);
95PARAMSETDEF(value);
96#undef STATRICKCLASS
97
98static ParamInterface* getInterface();
99static ExtObject makeDynamicObject(ReferenceObj* r);
100static ReferenceObj* fromObject(const ExtValue& v);
101static Param& getStaticParam();
102static ParamEntry* getStaticParamtab();
103};
104
105#endif
Note: See TracBrowser for help on using the repository browser.