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 */ 00022 00023 00024 00025 #ifndef __QCAMERAPATHPLAYER_H 00026 #define __QCAMERAPATHPLAYER_H 00027 00028 00029 // Qt 00031 #include <qdialog.h> 00032 #include <qcombobox.h> 00033 #include <qpushbutton.h> 00034 #include <qlineedit.h> 00035 #include <qslider.h> 00036 #include <qtimer.h> 00037 00038 // QGLViewer 00040 #include <QGLViewer.h> 00041 00042 // Own 00044 #include "QCameraPathDrag.h" 00045 #include "QCameraPathDropSite.h" 00046 00047 00048 00056 class QCameraPathPlayer : public QDialog 00057 { 00058 Q_OBJECT 00059 00060 public: 00062 // PUBLIC METHODS // 00064 00065 QCameraPathPlayer(QGLViewer *pViewer, 00066 QWidget* parent=NULL, const char* name=NULL, 00067 bool modal=FALSE, WFlags fl=0); 00068 ~QCameraPathPlayer() { } 00069 00071 void setSlider(int i) 00072 { m_pFrameSlider->setValue(i); }; 00073 00077 CList<CCamera> &getCameraPath() { 00078 return *m_CameraList.getFullDuplicate(); 00079 }; 00080 00081 signals: 00083 // SIGNALS // 00085 00086 /* Handles redraw of the scene. */ 00087 void sigRedraw(); 00088 00093 void sigPositionChanged(const QString &qNewPosition); 00094 00096 void sigAnimationStopped(); 00097 00099 void sigAnimationStarted(); 00100 00101 00102 public slots: 00104 // PUBLIC SLOTS // 00106 00107 void sltLoad(); 00108 void sltStop(); 00109 void sltPlayPause(); 00110 void sltBegin(); 00111 void sltBwd(); 00112 void sltFwd(); 00113 void sltEnd(); 00114 void sltSliderChanged(int); 00115 void sltFpsChanged(int); 00116 void sltTimer(); 00117 00120 void sltEnableLooping(bool fFlag) { 00121 m_pLoopButton->setOn(fFlag); 00122 }; 00123 00125 void sltSetCameraPath(const CList<CCamera> &cCameraPath); 00126 00127 00128 protected: 00130 // PROTECTED METHODS // 00132 00134 void dragEnterEvent(QDragEnterEvent*); 00135 00137 void dragLeaveEvent(QDragLeaveEvent*) { return; } 00138 00140 void dropEvent(QDropEvent*); 00141 00142 private: 00144 // PRIVATE METHODS // 00146 00147 QPushButton *m_pLoopButton; 00148 QPushButton *m_pPlayPauseButton; 00149 QLabel *m_pStatusLabel; 00150 QComboBox *m_pFpsCombo; 00151 QSlider *m_pFrameSlider; 00152 QCameraPathDropSite *m_pDropSite; 00153 00154 QTimer *m_pTimer; 00155 00156 int m_nStatus; 00157 int m_nFps; 00158 00159 QGLViewer *m_pViewer; 00160 00161 CList<CCamera> m_CameraList; 00162 }; 00163 00164 #endif /* __QCAMERAPATHPLAYER_H */