Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

Camera.h

00001 /***************************************************************************
00002  *   Copyright (C) 2004 by Raphael Langerhorst                             *
00003  *   raphael-langerhorst@gmx.at                                            *
00004  *                                                                         *
00005  *   Permission is hereby granted, free of charge, to any person obtaining *
00006  *   a copy of this software and associated documentation files (the       *
00007  *   "Software"), to deal in the Software without restriction, including   *
00008  *   without limitation the rights to use, copy, modify, merge, publish,   *
00009  *   distribute, sublicense, and/or sell copies of the Software, and to    *
00010  *   permit persons to whom the Software is furnished to do so, subject to *
00011  *   the following conditions:                                             *
00012  *                                                                         *
00013  *   The above copyright notice and this permission notice shall be        *
00014  *   included in all copies or substantial portions of the Software.       *
00015  *                                                                         *
00016  *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       *
00017  *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    *
00018  *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*
00019  *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR     *
00020  *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
00021  *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR *
00022  *   OTHER DEALINGS IN THE SOFTWARE.                                       *
00023  ***************************************************************************/
00024 
00025 #ifndef GCECAMERAH
00026 #define GCECAMERAH
00027 
00028 #include <GForm.h>
00029 
00030 #include <qobject.h>
00031 #include <qthread.h>
00032 #include <qevent.h>
00033 #include <qdatetime.h>
00034 
00035 #include "OpenGLFrame.h"
00036 
00037 namespace GCE {
00038 
00055 class Camera : public QObject, protected QThread
00056 {
00057   Q_OBJECT
00058   
00059   protected:
00060   
00064     QTime KeyUpdateTime;
00065   
00070     OpenGLFrame* Frame;
00071     
00075     GForm* Form;
00076     
00085     double ViewDistancePercent;
00086     
00090     double speedx;
00091     
00095     double speedy;
00096     
00100     bool shutdown;
00101     
00102     
00103     // KEY STATES
00104     bool left_key_down;
00105     bool right_key_down;
00106     bool up_key_down;
00107     bool down_key_down;
00108     bool space_key_down;
00109   
00110   public:
00114     Camera(OpenGLFrame* frame = NULL, GCS::GForm* form = NULL, QObject* parent = 0, const char* name = 0);
00115 
00119     ~Camera();
00120     
00121   protected:
00122   
00126     virtual void run();
00127     
00131     virtual bool eventFilter(QObject* watched, QEvent* e);
00132    
00133   public slots:
00134   
00140     virtual void setFrame(OpenGLFrame* frame);
00141     
00146     virtual void setForm(GCS::GForm* form);
00147     
00151     virtual void startCamera();
00152     
00157     virtual void stopCamera();
00158     
00163     virtual void setViewDistance(int new_distance_percent);
00164 
00165 };
00166 
00167 };
00168 
00169 #endif

Generated on Thu Oct 21 21:18:03 2004 for G System by doxygen 1.3.6