tracker.h

00001 /* Copyright (c) 2006, Dustin Wueest <wueest@dustin.ch>
00002  *
00003  * This library is free software; you can redistribute it and/or modify it under
00004  * the terms of the GNU Lesser General Public License version 2.1 as published
00005  * by the Free Software Foundation.
00006  *  
00007  * This library is distributed in the hope that it will be useful, but WITHOUT
00008  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00009  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00010  * details.
00011  * 
00012  * You should have received a copy of the GNU Lesser General Public License
00013  * along with this library; if not, write to the Free Software Foundation, Inc.,
00014  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00015  */
00016 
00017 #ifndef FOB_TRACKER_H
00018 #define FOB_TRACKER_H
00019 
00020 #include <eq/eq.h>
00021 #include <string>
00022 
00023 namespace eqPly
00024 {
00025     class Tracker
00026     {
00027     public:
00031         Tracker();
00032 
00042         bool init( const std::string& port );
00043 
00050         void setWorldToEmitter( const eq::Matrix4f& matrix )
00051             { _worldToEmitter = matrix; }
00052 
00059         void setSensorToObject( const eq::Matrix4f& matrix )
00060             { _sensorToObject = matrix; }
00061 
00068         bool isRunning() const { return _running; }
00069 
00079         bool update();
00080 
00088         const eq::Matrix4f& getMatrix() const { return _matrix; }
00089 
00090     private:
00091         bool _update(); //update without state checking
00092         bool _read( unsigned char* buffer, const size_t size,
00093                     const unsigned long int timeout );
00094 
00096         bool  _running;
00097 
00098         int   _fd;
00099 
00101         eq::Matrix4f _matrix;
00102 
00104         eq::Matrix4f _worldToEmitter;
00106         eq::Matrix4f _sensorToObject;
00107     };
00108 }
00109 
00110 #endif // FOB_TRACKER_H
Generated on Mon Aug 10 18:58:41 2009 for Equalizer 0.9 by  doxygen 1.5.8