00001 /* 00002 * QCameraInterpolationTool.h 00003 * $Id: 00004 * 00005 * Copyright (C) 2001 Thomas Woerner, Michael Meissner 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 _QCAMERAINTERPOLATION_TOOL_H 00026 #define _QCAMERAINTERPOLATION_TOOL_H 00027 00028 00029 // Qt 00031 #include <QGLExaminerViewer.h> 00032 #include <qdialog.h> 00033 #include <qcombobox.h> 00034 #include <qpushbutton.h> 00035 #include <qlineedit.h> 00036 00037 // Own 00039 #include "CCameraPathInterpolator.h" 00040 #include "QCameraPathDrag.h" 00041 #include "QCameraPathDropSite.h" 00042 #include "QCameraKeyPathDrag.h" 00043 #include "QCameraKeyPathDropSite.h" 00044 #include "QIconOptions.h" 00045 #include "QSceneTreeNode.h" 00046 00047 00054 class QCameraInterpolationTool : public QDialog, public QSceneTreeDrawable 00055 { 00056 Q_OBJECT 00057 00058 public: 00060 // PUBLIC METHODS // 00062 00064 QCameraInterpolationTool(QGLViewer *pQGLViewer, QWidget* parent=NULL, const char* name=NULL, 00065 bool modal=FALSE, WFlags fl=0); 00067 ~QCameraInterpolationTool() {} 00068 00070 void updateBoundingBox(); 00071 00073 virtual void draw(); 00074 00078 CList<CCamera> &getCameraPath() { 00079 return *m_CameraList.getFullDuplicate(); 00080 }; 00081 00082 signals: 00084 // SIGNALS // 00086 00088 void sigRedraw(); 00089 00093 void sigCameraPathChanged(const CList<CCamera> &cCameraPath); 00094 00095 00096 public slots: 00098 // PUBLIC SLOTS // 00100 00102 void sltKeyLoad(); 00103 00105 void sltKeySave(); 00106 00108 void sltSave(); 00109 00111 void sltShapeSave(); 00112 00114 void sltInterpolate(); 00115 00117 void sltUndo(); 00118 00120 void sltShowOptions(); 00121 00123 void sltArrowSize(double); 00124 00126 void sltFrustumSize(double); 00127 00129 void sltSetCameraPath(const CList<CCamera> &list); 00130 00132 void sltSetCameraKeyPath(const CList<CCameraKeyPathPoint> &path); 00133 00134 00135 protected: 00137 // PROTECTED METHODS // 00139 00141 void makeArrowDispList(); 00142 00144 void makePathDispList(); 00145 00147 void dragEnterEvent(QDragEnterEvent*); 00148 00150 void dragLeaveEvent(QDragLeaveEvent*) { return; } 00151 00153 void dropEvent(QDropEvent*); 00154 00155 private: 00157 // PRIVATE METHODS // 00159 00160 QComboBox *m_pAlgoCombo; 00161 QComboBox *m_pPathCombo; 00162 QLineEdit *m_pKeysLine; 00163 QLineEdit *m_pFramesLine; 00164 QPushButton *m_pInterpolateButton; 00165 QPushButton *m_pUndoButton; 00166 QCameraKeyPathDropSite *m_pKeyDropSite; 00167 QCameraPathDropSite *m_pDropSite; 00168 00169 QIconOptions *m_pOptions; 00170 00171 float m_rfIconSize; 00172 float m_rfFrustumSize; 00173 GLuint m_glPathDispList; 00174 GLuint m_glArrowDispList; 00175 00176 QGLViewer *m_pQGLViewer; 00177 00178 CList<CCameraKeyPathPoint> m_KeyPathList; 00179 CList<CCameraKeyPathPoint> m_ShapePathList; 00180 00181 // CCamera list for drop site 00182 CList<CCamera> m_CameraList; 00183 }; 00184 00185 #endif /* QINTERPOLATION_TOOL_H */