Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

TrackerDevice.h

Go to the documentation of this file.
00001 
00003 //
00004 //  Copyright (c) 2002, Perry L. Miller IV
00005 //  All rights reserved.
00006 //  BSD License: http://www.opensource.org/licenses/bsd-license.html
00007 //
00009 
00011 //
00012 //  Wrapper class for a single gadget::PositionInterface.
00013 //
00015 
00016 #ifndef _VRJGA_TRACKER_DEVICE_H_
00017 #define _VRJGA_TRACKER_DEVICE_H_
00018 
00019 #include "vrjGA/Referenced.h"
00020 
00021 #include "gadget/Type/PositionInterface.h"
00022 
00023 #include "gmtl/Matrix.h"
00024 
00025 #include <string>
00026 
00027 
00028 namespace vrjGA {
00029 
00030 
00031 class VRJ_GA_EXPORT TrackerDevice : public Referenced
00032 {
00033 public:
00034 
00035   // Useful typedefs.
00036   typedef Referenced BaseClass;
00037   typedef gadget::PositionInterface PI;
00038 
00039   // Smart-pointer definitions.
00040   VRJGA_DECLARE_POINTER ( TrackerDevice );
00041 
00042   // Constructor.
00043   TrackerDevice ( const std::string &name );
00044 
00045   // Get the device's matrix.
00046   const gmtl::Matrix44f&   matrix() const { return _matrix; }
00047 
00048   // Get the time
00049   double time() { return _time; }
00050 
00051   // Update the internal state.
00052   void                      update();
00053 
00054   // Get the position.
00055   float                     x() const { return _matrix ( 0, 3 ); }
00056   float                     y() const { return _matrix ( 1, 3 ); }
00057   float                     z() const { return _matrix ( 2, 3 ); }
00058 
00059 protected:
00060   virtual ~TrackerDevice();
00061 
00062 private:
00063 
00064   // Not copyable.
00065   TrackerDevice ( const TrackerDevice & );
00066   TrackerDevice& operator = ( const TrackerDevice & );
00067 
00068   PI _pi;
00069   gmtl::Matrix44f _matrix;
00070   double _time;
00071 };
00072 
00073 
00074 }; // namespace vrjGA
00075 
00076 
00077 #endif // _VRJGA_TRACKER_DEVICE_H_

Generated on Thu Aug 12 16:42:14 2004 for vrjGA by doxygen 1.3.5