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

QCameraKeyPathEditorImpl.h

Go to the documentation of this file.
00001 /* 00002 * QCameraKeyPathEditorImpl.h 00003 * $Id: 00004 * 00005 * Copyright (C) 2001 Alexander Buck, 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 // Description : Class QCameraKeyPathEditorImpl 00031 // Purpose : Provides a tool to handle camerapaths 00032 // 00033 00034 #ifndef QCAMERAKEYPATHEDITORIMPL_H 00035 #define QCAMERAKEYPATHEDITORIMPL_H 00036 00037 00038 // Qt 00040 #include <qstring.h> 00041 #include <qmenubar.h> 00042 #include <qvalidator.h> 00043 #include <qgl.h> 00044 #include <qdom.h> 00045 00046 // QGLViewer 00048 #include "CCamera.h" 00049 #include "CP3D.h" 00050 #include "CV3D.h" 00051 #include "QGLViewer.h" 00052 #include "QCameraDrag.h" 00053 #include "QSceneTreeNode.h" 00054 00055 00056 // Own 00058 #include "CList.h" 00059 #include "CCameraKeyPathAttributes.h" 00060 #include "QCameraKeyPathEditor.h" 00061 #include "CCameraKeyPathPoint.h" 00062 #include "QMyListBox.h" 00063 #include "QCameraKeyPathDrag.h" 00064 #include "QCameraKeyPathDropSite.h" 00065 #include "QIconOptions.h" 00066 00067 // Forwar declarations 00069 class QVBoxLayout; 00070 class QHBoxLayout; 00071 class QGridLayout; 00072 class QComboBox; 00073 class QLabel; 00074 class QLineEdit; 00075 class QPushButton; 00076 class QSlider; 00077 class QCheckBox; 00078 00084 class QCameraKeyPathEditorImpl : public QCameraKeyPathEditor, public QSceneTreeDrawable 00085 { 00086 Q_OBJECT 00087 00088 public: 00089 00091 // CONSTRUCTORS // 00093 00095 QCameraKeyPathEditorImpl( QGLViewer *viewer, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 00096 00097 00099 ~QCameraKeyPathEditorImpl(); 00100 00102 // PUBLIC METHODS // 00104 00106 void updateBoundingBox(); 00107 00109 virtual void draw(); 00110 00111 00112 signals: 00114 // SIGNALS // 00116 00118 void sigRedrawGL(); 00119 00121 void sigCameraKeyPath(const CList<CCameraKeyPathPoint> &); 00122 00123 public slots: 00125 // PUBLIC SLOTS // 00127 00132 void sltSetCameraPath(const CList<CCameraKeyPathPoint> &); 00133 00134 00135 private slots: 00137 // PRIVATE SLOTS // 00139 00141 void sltDeleteCamera(); 00142 00144 void sltReplaceCamera(); 00145 00147 void sltSetIconSize(double); 00148 00150 void sltSetFrustumSize(double); 00151 00153 void sltShowOptions(); 00154 00156 void sltSaveInXML(); 00157 00159 void sltSetSaveName(const QString &); 00160 00162 void sltLoadFile(); 00163 00165 void sltChangeCamValue(); 00166 00168 void sltAddNewCamera(); 00169 00171 void sltCheckValues(); 00172 00174 void sltUpdateHighlights(int); 00175 00177 void sltClearHighlights(int nIndex); 00178 00180 void sltUpdateTool(int nIndex); 00181 00183 void sltAttachCamera(); 00184 00186 void sltAbout(); 00187 00189 void sltMoveUp(); 00190 00192 void sltMoveDown(); 00193 00195 void sltUpdateName(int); 00196 00199 void sltOk() { 00200 sltApply(); 00201 hide(); 00202 }; 00203 00206 void sltApply() { 00207 emit(sigCameraKeyPath(*m_pCameraKeyPath)); 00208 }; 00209 00210 protected: 00212 // PROTECTED METHODS // 00214 00216 void dragEnterEvent(QDragEnterEvent*); 00217 00219 void dragLeaveEvent(QDragLeaveEvent*); 00220 00222 void dropEvent(QDropEvent*); 00223 00224 private: 00225 00227 // PRIVATE METHODS // 00229 00231 bool eventFilter(QObject *o, QEvent *e); 00232 00236 void setCamera(const CCamera &); 00237 00239 void saveInList(QString qname); 00240 00242 void writeAttributes(CCameraKeyPathAttributes); 00243 00247 void setSlider(int); 00248 00250 void writeCameraText(CCamera *); 00251 00253 void formatCamBox(); 00254 00256 CP3D getCurrentEyePos(); 00257 00259 CP3D getCurrentRefPoint(); 00260 00262 CV3D getCurrentViewUp(); 00263 00265 int getCurrentFovy(); 00266 00268 int getCurrentFrames(); 00269 00271 float getCurrentTension(); 00272 00274 float getCurrentContinuity(); 00275 00277 float getCurrentBias(); 00278 00280 void setMenuBar(QLayout *); 00281 00283 void makeArrowDispList(); 00284 00286 void makePathDispList(); 00287 00289 void showError(QString qError); 00290 00292 CList<CCameraKeyPathPoint>* getCamerapathPtr() 00293 { 00294 return m_pCameraKeyPath; 00295 } 00296 00298 void updateHighlights(); 00299 00301 void redraw(); 00302 00303 00305 // PRIVATE MEMBERS // 00307 00309 QMenuBar *m_pqMenuBar; 00310 00312 QGLViewer *m_pMyViewer; 00313 00315 CCameraKeyPathPoint m_camPoint; 00316 00318 CCameraKeyPathAttributes m_attributes; 00319 00321 CCamera m_myCamera; 00322 00324 CCamera m_detachCamera; 00325 00327 CList<CCameraKeyPathPoint> *m_pCameraKeyPath; 00328 00330 CList<bool> m_highlightedCams; 00331 00333 int m_nSliderIndex; 00334 00336 float m_rfIconSize; 00337 00339 float m_rfFrustumSize; 00340 00342 QDoubleValidator *m_pDValEye; 00343 00345 QDoubleValidator *m_pDValRef; 00346 00348 QDoubleValidator *m_pDValUp; 00349 00351 QDoubleValidator *m_pDValVAngle; 00352 00354 QDoubleValidator *m_pDValIcon; 00355 00357 QDoubleValidator *m_pDValFrustum; 00358 00360 QIntValidator *m_pIValFrame; 00361 00363 QDoubleValidator *m_pDValTension; 00364 00366 QDoubleValidator *m_pDValCon; 00367 00369 QDoubleValidator *m_pDValBias; 00370 00372 GLuint m_glPathDispList; 00373 00375 GLuint m_glArrowDispList; 00376 00378 QString m_qSaveName; 00379 00381 bool m_fClearSelectedCams; 00382 00384 bool m_fAttachCamera; 00385 00387 bool m_fCorrectValues; 00388 00390 bool m_fClearSelection; 00391 00393 bool m_fDeleteWithSelection; 00394 00396 QIconOptions *m_pqOptions; 00397 }; 00398 00399 #endif // QCAMERAKEYPATHEDITORIMPL_H

Generated on Sun May 16 12:02:02 2004 for QGLViewer by doxygen 1.3.7