Frapper  1.0a
ViewportPanel.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of FRAPPER
4 research.animationsinstitut.de
5 sourceforge.net/projects/frapper
6 
7 Copyright (c) 2008-2009 Filmakademie Baden-Wuerttemberg, Institute of Animation
8 
9 This program is free software; you can redistribute it and/or modify it under
10 the terms of the GNU Lesser General Public License as published by the Free Software
11 Foundation; version 2.1 of the License.
12 
13 This program is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16 
17 You should have received a copy of the GNU Lesser General Public License along with
18 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20 http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
21 -----------------------------------------------------------------------------
22 */
23 
33 
34 #ifndef VIEWPORTPANEL_H
35 #define VIEWPORTPANEL_H
36 
37 #include "FrapperPrerequisites.h"
38 #include "ViewPanel.h"
39 #include "ViewportWidget.h"
40 #include "ui_ViewportPanel.h"
41 #include <QtGui/QDoubleSpinBox>
42 #include <QtGui/QCheckBox>
43 #include <QtGui/QComboBox>
44 #include <QtGui/QPushButton>
45 #include <QtGui/QLabel>
46 
47 
48 namespace Frapper {
49 
53 class FRAPPER_GUI_EXPORT ViewportPanel : public ViewPanel, protected Ui::ViewportPanel
54 {
55 
56  Q_OBJECT
57 
58 public: // constructors and destructors
59 
66  ViewportPanel ( QWidget *parent = 0, Qt::WindowFlags flags = 0 );
67 
75  virtual ~ViewportPanel ();
76 
77 public: // functions
78 
85  virtual void fillToolBars ( QToolBar *mainToolBar, QToolBar *panelToolBar );
86 
92  ViewportWidget * getViewportWidget () const;
93 
97  void setPanelParameters ( const QMap<QString, QString> &parameterMap );
98 
99 public slots: //
100 
107  //void addCamera ( const QString &cameraName );
108 
115  //void removeCamera ( const QString &cameraName );
116 
120  void updateCameras ( const QList<Node *> &cameraNodes, const QString &cameraName );
121 
122 signals: //
123 
127  void fullscreenEnabled ();
128 
135  void newCameraRequested ( ViewingParameters *viewingParameters );
136 
143  void selectCameraRequested ( const QString &cameraName, bool toggle );
144 
153  void updateCameraRequested ( const QString &cameraName, ViewingParameters *viewingParameters );
154 
160  void deleteCameraRequested ( const QString &cameraName );
161 
169  void applyCameraRequested ( const QString &cameraName, ViewingParameters *viewingParameters );
170 
174  void requestCameraList ();
175 
179  void triggerRebuild ();
180 
181 protected: // events
182 
188  void keyPressEvent ( QKeyEvent *event );
189 
195  void keyReleaseEvent ( QKeyEvent *event );
196 
197 protected slots: //
198 
204  void toggleFullscreen ( bool enable );
205 
211  void toggleStereo ( bool enable );
212 
216  void showStereoDialog ();
217 
221  void setStereoParameters ();
222 
223 private slots: //
224 
230  void on_ui_addCameraAction_triggered ( bool checked = false );
231 
238  void on_ui_linkViewAction_toggled ( bool checked );
239 
245  void on_ui_selectCameraAction_triggered ( bool checked = false );
246 
252  void on_ui_removeCameraAction_triggered ( bool checked = false );
253 
259  void on_ui_overlayOnlyAction_toggled ( bool checked = false );
260 
266  void selectCamera ( const QString &cameraName );
267 
274  void updateCamera ( ViewingParameters *viewingParameters );
275 
282  void selectStage ( /*QAction *triggeredAction*/ );
283 
287  void changeFog ( float value );
288 
292  void changeFog ( int value );
293 
297  void changeFogColor ();
298 
302  void changeBackgroundColor ();
303 
304 
305 private: // data
306 
311 
316 
320  QMap<QString, QDoubleSpinBox *> m_stereoParameterSBMap;
321 
325  QDoubleSpinBox *m_fogSpinBox;
326 
330  QCheckBox *m_fogCheckBox;
331 
335  QPushButton *m_fogColorButton;
336 
341 
345  QActionGroup *m_stageActionGroup;
346 
350  QComboBox *m_cameraComboBox;
351 
356 
357 };
358 
359 } // end namespace Frapper
360 
361 #endif