lib/client/observer.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef EQ_OBSERVER_H
00019 #define EQ_OBSERVER_H
00020
00021 #include <eq/client/object.h>
00022 #include <eq/client/types.h>
00023 #include <eq/client/visitorResult.h>
00024
00025 #include <string>
00026
00027 namespace eq
00028 {
00029 class Config;
00030 class ObserverVisitor;
00031
00038 class Observer : public Object
00039 {
00040 public:
00044 EQ_EXPORT Observer();
00045
00047 EQ_EXPORT virtual ~Observer();
00048
00054 EQ_EXPORT void setEyeBase( const float eyeBase );
00055
00057 float getEyeBase() const { return _eyeBase; }
00058
00070 EQ_EXPORT void setHeadMatrix( const Matrix4f& matrix );
00071
00073 const Matrix4f& getHeadMatrix() const { return _headMatrix; }
00075
00086 EQ_EXPORT VisitorResult accept( ObserverVisitor& visitor );
00087
00089 EQ_EXPORT virtual void deregister();
00091
00092 protected:
00094 EQ_EXPORT virtual void serialize( net::DataOStream& os,
00095 const uint64_t dirtyBits );
00097 EQ_EXPORT virtual void deserialize( net::DataIStream& is,
00098 const uint64_t dirtyBits );
00099
00100 enum DirtyBits
00101 {
00102 DIRTY_EYE_BASE = Object::DIRTY_CUSTOM << 0,
00103 DIRTY_HEAD = Object::DIRTY_CUSTOM << 1,
00104 DIRTY_FILL1 = Object::DIRTY_CUSTOM << 2,
00105 DIRTY_FILL2 = Object::DIRTY_CUSTOM << 3,
00106 DIRTY_CUSTOM = Object::DIRTY_CUSTOM << 4
00107 };
00108
00109 private:
00111 Config* _config;
00112 friend class Config;
00113
00115 float _eyeBase;
00116
00118 Matrix4f _headMatrix;
00119
00120 union
00121 {
00122 char dummy[64];
00123 };
00124 };
00125
00126 EQ_EXPORT std::ostream& operator << ( std::ostream&, const Observer* );
00127 }
00128 #endif // EQ_OBSERVER_H