00001 /* 00002 * QCameraPathPlayer.h 00003 * $Id: 00004 * 00005 * Copyright (C) 2001 Thomas Woerner, Michael Meissner, Markus Janich 00006 * 00007 * This program is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 * 00021 * As a special exception to the GPL, the QGLViewer authors (Markus 00022 * Janich, Michael Meissner, Richard Guenther, Alexander Buck and Thomas 00023 * Woerner) give permission to link this program with Qt (non-)commercial 00024 * edition, and distribute the resulting executable, without including 00025 * the source code for the Qt (non-)commercial edition in the source 00026 * distribution. 00027 * 00028 */ 00029 00030 00031 00032 #ifndef __QCAMERAPATHPLAYER_H 00033 #define __QCAMERAPATHPLAYER_H 00034 00035 00036 // Qt 00038 #include <qdialog.h> 00039 #include <qcombobox.h> 00040 #include <qpushbutton.h> 00041 #include <qlineedit.h> 00042 #include <qslider.h> 00043 #include <qtimer.h> 00044 00045 // QGLViewer 00047 #include <QGLViewer.h> 00048 00049 // Own 00051 #include "QCameraPathDrag.h" 00052 #include "QCameraPathDropSite.h" 00053 00054 00055 00063 class QCameraPathPlayer : public QDialog 00064 { 00065 Q_OBJECT 00066 00067 public: 00069 // PUBLIC METHODS // 00071 00072 QCameraPathPlayer(QGLViewer *pViewer, 00073 QWidget* parent=NULL, const char* name=NULL, 00074 bool modal=FALSE, WFlags fl=0); 00075 ~QCameraPathPlayer() { } 00076 00078 void setSlider(int i) 00079 { m_pFrameSlider->setValue(i); }; 00080 00084 CList<CCamera> &getCameraPath() { 00085 return *m_CameraList.getFullDuplicate(); 00086 }; 00087 00088 signals: 00090 // SIGNALS // 00092 00093 /* Handles redraw of the scene. */ 00094 void sigRedraw(); 00095 00100 void sigPositionChanged(const QString &qNewPosition); 00101 00103 void sigAnimationStopped(); 00104 00106 void sigAnimationStarted(); 00107 00108 00109 public slots: 00111 // PUBLIC SLOTS // 00113 00114 void sltLoad(); 00115 void sltStop(); 00116 void sltPlayPause(); 00117 void sltBegin(); 00118 void sltBwd(); 00119 void sltFwd(); 00120 void sltEnd(); 00121 void sltSliderChanged(int); 00122 void sltFpsChanged(int); 00123 void sltTimer(); 00124 00127 void sltEnableLooping(bool fFlag) { 00128 m_pLoopButton->setOn(fFlag); 00129 }; 00130 00132 void sltSetCameraPath(const CList<CCamera> &cCameraPath); 00133 00134 00135 protected: 00137 // PROTECTED METHODS // 00139 00141 void dragEnterEvent(QDragEnterEvent*); 00142 00144 void dragLeaveEvent(QDragLeaveEvent*) { return; } 00145 00147 void dropEvent(QDropEvent*); 00148 00149 private: 00151 // PRIVATE METHODS // 00153 00154 QPushButton *m_pLoopButton; 00155 QPushButton *m_pPlayPauseButton; 00156 QLabel *m_pStatusLabel; 00157 QComboBox *m_pFpsCombo; 00158 QSlider *m_pFrameSlider; 00159 QCameraPathDropSite *m_pDropSite; 00160 00161 QTimer *m_pTimer; 00162 00163 int m_nStatus; 00164 int m_nFps; 00165 00166 QGLViewer *m_pViewer; 00167 00168 CList<CCamera> m_CameraList; 00169 }; 00170 00171 #endif /* __QCAMERAPATHPLAYER_H */