00001 #ifndef _room6d_H_
00002 #define _room6d_H_
00003
00004 #include "std/config.H"
00005 #include "event/event.H"
00006 #include "dev/dev.H"
00007
00008 MAKE_PTR_SUBC(EVENTroom6d, EVENT);
00009
00010
00011 class Wtransf;
00012 typedef const Wtransf cWtransf;
00013 typedef Greal RAWmat[4][4];
00014
00015 class DllImpExp EVENTroom6d : public EVENT {
00016 virtual bool compare(cEVENTptr &e) const { return true; }
00017 cWtransf &_cur, &_old;
00018 double _time;
00019
00020 public:
00021 EVENTroom6d(Cstr_ptr &n);
00022 EVENTroom6d(cEVENTsource *s);
00023 EVENTroom6d(cEVENTsource *s, cWtransf &o, cWtransf &c, double t):
00024 EVENT(s),_cur(c),_old(o),_time(t) { }
00025
00026
00027
00028
00029
00030
00031
00032 cWtransf &cur() const { return _cur; }
00033 cWtransf &old() const { return _old; }
00034 Wtransf delta() const;
00035 double time() const { return _time; }
00036
00037
00038
00039 void cur (RAWmat &d, bool row=true) const;
00040 void old (RAWmat &d, bool row=true) const;
00041 void delta(RAWmat &d, bool row=true) const;
00042
00043 DEFINE_DERIVED_TYPE(EVENTroom6d, EVENT, cEVENTptr);
00044
00045 static EVENTroom6dptr cast(cEVENTptr &e) { return EVENTroom6d::isa(e) ?
00046 (EVENTroom6d *)&*e : 0; }
00047 };
00048
00049
00050
00051
00052
00053 MAKE_PTR_SUBC(EVENTroom6d_vr, EVENTroom6d);
00054 class DllImpExp EVENTroom6d_vr : public EVENTroom6d {
00055
00056 protected:
00057 cWtransf &_head;
00058
00059 public:
00060
00061 EVENTroom6d_vr(Cstr_ptr &n);
00062 EVENTroom6d_vr(cEVENTsource *s);
00063 EVENTroom6d_vr(cEVENTsource *s, cWtransf &o, cWtransf &c, cWtransf &h, double t=0);
00064
00065 cWtransf &head() const;
00066
00067
00068
00069 DEFINE_DERIVED_TYPE(EVENTroom6d_vr, EVENTroom6d, cEVENTptr);
00070 static EVENTroom6d_vrptr cast(cEVENTptr &e) { return EVENTroom6d_vr::isa(e) ?
00071 (EVENTroom6d_vr *)&*e : 0; }
00072 };
00073
00074 class DllImpExp DEVice_room6d : public DEVice {
00075 protected:
00076 Wtransf &_cur;
00077 int _report_normalized_xforms;
00078
00079 public:
00080 static ARRAY<DEVice_room6d *> devs;
00081
00082 DEVice_room6d(Cstr_ptr &root);
00083 virtual ~DEVice_room6d() { devs -= this; }
00084
00085 cWtransf &cur() const { return _cur; }
00086 void cur(RAWmat &d, bool row=true) const;
00087
00088 virtual void event(cWtransf &, double time=-1);
00089
00090
00091 DEFINE_DERIVED_TYPE(DEVice_room6d, DEVice, const DEVice *);
00092 };
00093
00094 #endif